From be528adea5abfaab21270fcbde77ed4299bfdd27 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 7 Jun 2025 10:21:25 +0100 Subject: [PATCH] thanks michaelsoft! --- src/core/thread_pool.cpp | 2 +- src/r_draw_span.c | 22 ++++++++++++++-------- src/sdl/i_system.c | 8 ++++---- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/core/thread_pool.cpp b/src/core/thread_pool.cpp index 6917aee93..11aa6f1bb 100644 --- a/src/core/thread_pool.cpp +++ b/src/core/thread_pool.cpp @@ -17,7 +17,7 @@ #include #include -#include +//#include //#include #include "../cxxutil.hpp" diff --git a/src/r_draw_span.c b/src/r_draw_span.c index ce8ac392e..90e082862 100644 --- a/src/r_draw_span.c +++ b/src/r_draw_span.c @@ -15,7 +15,13 @@ // SPANS // ========================================================================== +#ifdef _WIN32 +#include +#define local_for_thread static __thread +#else #include +#define local_for_thread thread_local static +#endif #define SPANSIZE 16 #define INVSPAN 0.0625f @@ -596,8 +602,8 @@ void R_DrawSpan_Tilted(drawspandata_t* ds) float endz, endu, endv; UINT32 stepu, stepv; register UINT32 bit; - thread_local static INT32 *tiltlighting = NULL; - thread_local static INT32 oldviewwidth = 0; + local_for_thread INT32 *tiltlighting = NULL; + local_for_thread INT32 oldviewwidth = 0; // dont realloc every frame pls thx if (tiltlighting == NULL || oldviewwidth != viewwidth) @@ -743,8 +749,8 @@ void R_DrawTranslucentSpan_Tilted(drawspandata_t* ds) float endz, endu, endv; UINT32 stepu, stepv; register UINT32 bit; - thread_local static INT32 *tiltlighting = NULL; - thread_local static INT32 oldviewwidth = 0; + local_for_thread INT32 *tiltlighting = NULL; + local_for_thread INT32 oldviewwidth = 0; // dont realloc every frame pls thx if (tiltlighting == NULL || oldviewwidth != viewwidth) @@ -891,8 +897,8 @@ void R_DrawTranslucentWaterSpan_Tilted(drawspandata_t* ds) float endz, endu, endv; UINT32 stepu, stepv; register UINT32 bit; - thread_local static INT32 *tiltlighting = NULL; - thread_local static INT32 oldviewwidth = 0; + local_for_thread INT32 *tiltlighting = NULL; + local_for_thread INT32 oldviewwidth = 0; // dont realloc every frame pls thx if (tiltlighting == NULL || oldviewwidth != viewwidth) @@ -1039,8 +1045,8 @@ void R_DrawSplat_Tilted(drawspandata_t* ds) float endz, endu, endv; UINT32 stepu, stepv; register UINT32 bit; - thread_local static INT32 *tiltlighting = NULL; - thread_local static INT32 oldviewwidth = 0; + local_for_thread INT32 *tiltlighting = NULL; + local_for_thread INT32 oldviewwidth = 0; // dont realloc every frame pls thx if (tiltlighting == NULL || oldviewwidth != viewwidth) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 84d0fb218..b74a3aa31 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -496,14 +496,13 @@ static void I_ReportSignal(int num, int coredumped) #ifndef NEWSIGNALHANDLER FUNCNORETURN static ATTRNORETURN void signal_handler(INT32 num) { - if (g_main_thread_id != std::this_thread::get_id()) + /*if (g_main_thread_id != std::this_thread::get_id()) { // Do not attempt any sort of recovery if this signal triggers off the main thread signal(num, SIG_DFL); raise(num); exit(-2); - } - + }*/ g_in_exiting_signal_handler = true; @@ -1569,7 +1568,8 @@ static void I_SetupMumble(void) if (!hMap) return; - mumble = static_cast(MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(*mumble))); + //mumble = static_cast(MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(*mumble))); + mumble = MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(*mumble)); if (!mumble) CloseHandle(hMap); #elif defined (HAVE_SHM)