From 536b20b16429719024b6acaa333251910a46373c Mon Sep 17 00:00:00 2001 From: wolfy1339 Date: Thu, 12 Oct 2017 23:33:05 -0400 Subject: [PATCH] Fix pthread deprecation warning, fixes #502 --- SConscript | 2 +- src/common/tpt-thread.h | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/SConscript b/SConscript index 69e1945b1d..ee2e92728f 100644 --- a/SConscript +++ b/SConscript @@ -473,7 +473,7 @@ elif GetOption('release'): if GetOption('static'): if platform == "Windows": - env.Append(CPPDEFINES=['PTW32_STATIC_LIB']) + env.Append(CPPDEFINES=['_PTW32_STATIC_LIB']) if msvc: env.Append(CPPDEFINES=['ZLIB_WINAPI']) else: diff --git a/src/common/tpt-thread.h b/src/common/tpt-thread.h index c360550855..9299f68a60 100644 --- a/src/common/tpt-thread.h +++ b/src/common/tpt-thread.h @@ -2,7 +2,7 @@ #define TPT_THREAD_H #if defined(WIN) && defined(__GNUC__) -#define TH_ENTRY_POINT __attribute__((force_align_arg_pointer)) +#define TH_ENTRY_POINT __attribute__((force_align_arg_pointer)) #define _TIMESPEC_DEFINED #else #define TH_ENTRY_POINT @@ -16,4 +16,11 @@ #include #undef GetUserName +// Fix deprecation warnings with recent pthread versions on Windows +#ifdef _PTW32_STATIC_LIB +#if PTW32_VERSION =< 2, 8, 0, 0 +#define PTW32_STATIC_LIB +#endif +#endif + #endif