From 42a19860d5aac59ae0d91a72d5f758895498008f Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 10 May 2022 14:11:51 +0200 Subject: [PATCH] Fix errors when compiling headers with MinGW --- dtool/src/dtoolbase/mutexImpl.h | 2 +- dtool/src/dtoolbase/mutexWin32Impl.cxx | 4 ++-- dtool/src/dtoolbase/mutexWin32Impl.h | 4 ++-- dtool/src/dtoolbase/selectThreadImpl.h | 2 +- panda/src/pipeline/conditionVarFullWin32Impl.cxx | 4 ++-- panda/src/pipeline/conditionVarFullWin32Impl.h | 4 ++-- panda/src/pipeline/conditionVarImpl.h | 2 +- panda/src/pipeline/conditionVarWin32Impl.cxx | 4 ++-- panda/src/pipeline/conditionVarWin32Impl.h | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dtool/src/dtoolbase/mutexImpl.h b/dtool/src/dtoolbase/mutexImpl.h index f309634ffa..2e741dfe81 100644 --- a/dtool/src/dtoolbase/mutexImpl.h +++ b/dtool/src/dtoolbase/mutexImpl.h @@ -49,7 +49,7 @@ typedef ReMutexPosixImpl ReMutexImpl; // Also define what a true OS-provided lock will be, even if we don't have // threading enabled in the build. Sometimes we need to interface with an // external program or something that wants real locks. -#if defined(WIN32_VC) +#if defined(WIN32_VC) || (defined(_WIN32) && !defined(HAVE_POSIX_THREADS)) #include "mutexWin32Impl.h" typedef MutexWin32Impl TrueMutexImpl; diff --git a/dtool/src/dtoolbase/mutexWin32Impl.cxx b/dtool/src/dtoolbase/mutexWin32Impl.cxx index 594f6c0962..ba25ec1552 100644 --- a/dtool/src/dtoolbase/mutexWin32Impl.cxx +++ b/dtool/src/dtoolbase/mutexWin32Impl.cxx @@ -13,7 +13,7 @@ #include "selectThreadImpl.h" -#ifdef WIN32_VC +#ifdef _WIN32 #include "mutexWin32Impl.h" @@ -25,4 +25,4 @@ MutexWin32Impl() { InitializeCriticalSectionAndSpinCount(&_lock, 4000); } -#endif // WIN32_VC +#endif // _WIN32 diff --git a/dtool/src/dtoolbase/mutexWin32Impl.h b/dtool/src/dtoolbase/mutexWin32Impl.h index 550d4944ab..c508b289e9 100644 --- a/dtool/src/dtoolbase/mutexWin32Impl.h +++ b/dtool/src/dtoolbase/mutexWin32Impl.h @@ -17,7 +17,7 @@ #include "dtoolbase.h" #include "selectThreadImpl.h" -#ifdef WIN32_VC +#ifdef _WIN32 #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN 1 #endif @@ -47,6 +47,6 @@ private: #include "mutexWin32Impl.I" -#endif // WIN32_VC +#endif // _WIN32 #endif diff --git a/dtool/src/dtoolbase/selectThreadImpl.h b/dtool/src/dtoolbase/selectThreadImpl.h index 743ea98af7..af5a5db44a 100644 --- a/dtool/src/dtoolbase/selectThreadImpl.h +++ b/dtool/src/dtoolbase/selectThreadImpl.h @@ -47,7 +47,7 @@ #undef TVOLATILE #define TVOLATILE -#elif defined(WIN32_VC) +#elif defined(WIN32_VC) || (defined(_WIN32) && !defined(HAVE_POSIX_THREADS)) // In Windows, use the native threading library. #define THREAD_WIN32_IMPL 1 diff --git a/panda/src/pipeline/conditionVarFullWin32Impl.cxx b/panda/src/pipeline/conditionVarFullWin32Impl.cxx index 6d664735d6..a6442e2b06 100644 --- a/panda/src/pipeline/conditionVarFullWin32Impl.cxx +++ b/panda/src/pipeline/conditionVarFullWin32Impl.cxx @@ -13,8 +13,8 @@ #include "selectThreadImpl.h" -#if defined(WIN32_VC) || defined(WIN64_VC) +#ifdef _WIN32 #include "conditionVarFullWin32Impl.h" -#endif // WIN32_VC +#endif // _WIN32 diff --git a/panda/src/pipeline/conditionVarFullWin32Impl.h b/panda/src/pipeline/conditionVarFullWin32Impl.h index a42d4d86a8..4ec0dac63c 100644 --- a/panda/src/pipeline/conditionVarFullWin32Impl.h +++ b/panda/src/pipeline/conditionVarFullWin32Impl.h @@ -17,7 +17,7 @@ #include "pandabase.h" #include "selectThreadImpl.h" -#if defined(WIN32_VC) +#ifdef _WIN32 #include "mutexWin32Impl.h" #include "pnotify.h" @@ -58,6 +58,6 @@ private: #include "conditionVarFullWin32Impl.I" -#endif // WIN32_VC +#endif // _WIN32 #endif diff --git a/panda/src/pipeline/conditionVarImpl.h b/panda/src/pipeline/conditionVarImpl.h index 7837622ba6..f0dcb12f3e 100644 --- a/panda/src/pipeline/conditionVarImpl.h +++ b/panda/src/pipeline/conditionVarImpl.h @@ -50,7 +50,7 @@ typedef ConditionVarPosixImpl ConditionVarFullImpl; #endif -#if defined(WIN32_VC) +#if defined(WIN32_VC) || (defined(_WIN32) && !defined(HAVE_POSIX_THREADS)) #include "conditionVarWin32Impl.h" typedef ConditionVarWin32Impl TrueConditionVarImpl; diff --git a/panda/src/pipeline/conditionVarWin32Impl.cxx b/panda/src/pipeline/conditionVarWin32Impl.cxx index 9d3a95e0b1..5ba4165a0c 100644 --- a/panda/src/pipeline/conditionVarWin32Impl.cxx +++ b/panda/src/pipeline/conditionVarWin32Impl.cxx @@ -13,8 +13,8 @@ #include "selectThreadImpl.h" -#if defined(WIN32_VC) || defined(WIN64_VC) +#ifdef _WIN32 #include "conditionVarWin32Impl.h" -#endif // WIN32_VC +#endif // _WIN32 diff --git a/panda/src/pipeline/conditionVarWin32Impl.h b/panda/src/pipeline/conditionVarWin32Impl.h index 7ed6513d6e..99bdc074dc 100644 --- a/panda/src/pipeline/conditionVarWin32Impl.h +++ b/panda/src/pipeline/conditionVarWin32Impl.h @@ -17,7 +17,7 @@ #include "pandabase.h" #include "selectThreadImpl.h" -#if defined(WIN32_VC) +#ifdef _WIN32 #include "mutexWin32Impl.h" #include "pnotify.h" @@ -50,6 +50,6 @@ private: #include "conditionVarWin32Impl.I" -#endif // WIN32_VC +#endif // _WIN32 #endif