diff --git a/src/win/core.c b/src/win/core.c index 540fb5fa..f37ef4a1 100644 --- a/src/win/core.c +++ b/src/win/core.c @@ -26,9 +26,7 @@ #include #include #include -#if !defined(__MINGW32__) #include -#endif #include "uv.h" #include "internal.h" @@ -44,11 +42,11 @@ static uv_once_t uv_init_guard_ = UV_ONCE_INIT; static uv_once_t uv_default_loop_init_guard_ = UV_ONCE_INIT; -#if defined(_DEBUG) && !defined(__MINGW32__) +#if defined(_DEBUG) /* Our crt debug report handler allows us to temporarily disable asserts */ /* just for the current thread. */ -__declspec( thread ) int uv__crt_assert_enabled = TRUE; +UV_THREAD_LOCAL int uv__crt_assert_enabled = TRUE; static int uv__crt_dbg_report_handler(int report_type, char *message, int *ret_val) { if (uv__crt_assert_enabled || report_type != _CRT_ASSERT) diff --git a/src/win/internal.h b/src/win/internal.h index 83c4a668..14c4e4b5 100644 --- a/src/win/internal.h +++ b/src/win/internal.h @@ -31,13 +31,16 @@ #ifdef _MSC_VER # define INLINE __inline +# define UV_THREAD_LOCAL __declspec( thread ) #else # define INLINE inline +# define UV_THREAD_LOCAL __thread #endif #ifdef _DEBUG -extern __declspec( thread ) int uv__crt_assert_enabled; + +extern UV_THREAD_LOCAL int uv__crt_assert_enabled; #define UV_BEGIN_DISABLE_CRT_ASSERT() \ { \