Browse Source

Fix errors when compiling headers with MinGW

rdb 3 years ago
parent
commit
42a19860d5

+ 1 - 1
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;
 

+ 2 - 2
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

+ 2 - 2
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

+ 1 - 1
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

+ 2 - 2
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

+ 2 - 2
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

+ 1 - 1
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;
 

+ 2 - 2
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

+ 2 - 2
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