From 583c9f1857a9a253aca676fc347f53f989149fdf Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 1 Mar 2022 12:19:13 +0100 Subject: [PATCH] pipeline: Fix issues with calling convention on 32-bit Windows --- dtool/src/dtoolbase/patomic.h | 6 +++--- panda/src/pipeline/conditionVarWin32Impl.h | 2 +- panda/src/pipeline/threadWin32Impl.cxx | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dtool/src/dtoolbase/patomic.h b/dtool/src/dtoolbase/patomic.h index f7f99dfc55..604d028392 100644 --- a/dtool/src/dtoolbase/patomic.h +++ b/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); diff --git a/panda/src/pipeline/conditionVarWin32Impl.h b/panda/src/pipeline/conditionVarWin32Impl.h index 12cbe053f7..5ec0ab0c08 100644 --- a/panda/src/pipeline/conditionVarWin32Impl.h +++ b/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; }; diff --git a/panda/src/pipeline/threadWin32Impl.cxx b/panda/src/pipeline/threadWin32Impl.cxx index 552c8b0453..22bf5cab79 100644 --- a/panda/src/pipeline/threadWin32Impl.cxx +++ b/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;