Browse Source

pipeline: Fix issues with calling convention on 32-bit Windows

rdb 3 years ago
parent
commit
583c9f1857

+ 3 - 3
dtool/src/dtoolbase/patomic.h

@@ -161,9 +161,9 @@ ALWAYS_INLINE void patomic_notify_one(volatile uint32_t *value);
 ALWAYS_INLINE void patomic_notify_all(volatile uint32_t *value);
 
 #ifdef _WIN32
-EXPCL_DTOOL_DTOOLBASE extern BOOL (*_patomic_wait_func)(volatile VOID *, PVOID, SIZE_T, DWORD);
-EXPCL_DTOOL_DTOOLBASE extern void (*_patomic_wake_one_func)(PVOID);
-EXPCL_DTOOL_DTOOLBASE extern void (*_patomic_wake_all_func)(PVOID);
+EXPCL_DTOOL_DTOOLBASE extern BOOL (__stdcall *_patomic_wait_func)(volatile VOID *, PVOID, SIZE_T, DWORD);
+EXPCL_DTOOL_DTOOLBASE extern void (__stdcall *_patomic_wake_one_func)(PVOID);
+EXPCL_DTOOL_DTOOLBASE extern void (__stdcall *_patomic_wake_all_func)(PVOID);
 #elif !defined(__linux__) && defined(HAVE_POSIX_THREADS)
 EXPCL_DTOOL_DTOOLBASE void _patomic_wait(const volatile uint32_t *value, uint32_t old);
 EXPCL_DTOOL_DTOOLBASE void _patomic_notify_all(volatile uint32_t *value);

+ 1 - 1
panda/src/pipeline/conditionVarWin32Impl.h

@@ -41,7 +41,7 @@ private:
   MutexWin32Impl &_mutex;
   CONDITION_VARIABLE _cvar = CONDITION_VARIABLE_INIT;
 
-  static BOOL (*_wait_func)(PCONDITION_VARIABLE, PSRWLOCK, DWORD, ULONG);
+  static BOOL (__stdcall *_wait_func)(PCONDITION_VARIABLE, PSRWLOCK, DWORD, ULONG);
   friend class PStatClientImpl;
 };
 

+ 3 - 3
panda/src/pipeline/threadWin32Impl.cxx

@@ -27,9 +27,9 @@ static patomic_flag _main_thread_known = ATOMIC_FLAG_INIT;
 
 #if _WIN32_WINNT < 0x0601
 // Requires Windows 7.
-static DWORD (*EnableThreadProfiling)(HANDLE, DWORD, DWORD64, HANDLE *) = nullptr;
-static DWORD (*DisableThreadProfiling)(HANDLE) = nullptr;
-static DWORD (*ReadThreadProfilingData)(HANDLE, DWORD, PPERFORMANCE_DATA data) = nullptr;
+static DWORD (__stdcall *EnableThreadProfiling)(HANDLE, DWORD, DWORD64, HANDLE *) = nullptr;
+static DWORD (__stdcall *DisableThreadProfiling)(HANDLE) = nullptr;
+static DWORD (__stdcall *ReadThreadProfilingData)(HANDLE, DWORD, PPERFORMANCE_DATA data) = nullptr;
 
 static bool init_thread_profiling() {
   static bool inited = false;