mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-26 14:43:50 -04:00
dtoolbase: Fix missing __stdcall when compiling for 32-bit Windows
This commit is contained in:
parent
3a120c4d68
commit
370b635534
@ -26,12 +26,12 @@ static_assert(sizeof(uint32_t) == sizeof(int32_t),
|
||||
|
||||
// On Windows 7, we try to load the Windows 8 functions dynamically, and
|
||||
// fall back to a condition variable table if they aren't available.
|
||||
static BOOL initialize_wait(volatile VOID *addr, PVOID cmp, SIZE_T size, DWORD timeout);
|
||||
static void dummy_wake(PVOID addr) {}
|
||||
static BOOL __stdcall initialize_wait(volatile VOID *addr, PVOID cmp, SIZE_T size, DWORD timeout);
|
||||
static void __stdcall dummy_wake(PVOID addr) {}
|
||||
|
||||
BOOL (*_patomic_wait_func)(volatile VOID *, PVOID, SIZE_T, DWORD) = &initialize_wait;
|
||||
void (*_patomic_wake_one_func)(PVOID) = &dummy_wake;
|
||||
void (*_patomic_wake_all_func)(PVOID) = &dummy_wake;
|
||||
BOOL (__stdcall *_patomic_wait_func)(volatile VOID *, PVOID, SIZE_T, DWORD) = &initialize_wait;
|
||||
void (__stdcall *_patomic_wake_one_func)(PVOID) = &dummy_wake;
|
||||
void (__stdcall *_patomic_wake_all_func)(PVOID) = &dummy_wake;
|
||||
|
||||
// Randomly pick an entry into the wait table based on the hash of the address.
|
||||
// It's possible to get hash collision, but that's not so bad, it just means
|
||||
@ -47,7 +47,7 @@ static const size_t _wait_hash_mask = 63;
|
||||
/**
|
||||
* Emulates WakeByAddressSingle for Windows Vista and 7.
|
||||
*/
|
||||
static void
|
||||
static void __stdcall
|
||||
emulated_wake(PVOID addr) {
|
||||
size_t i = std::hash<volatile void *>{}(addr) & (sizeof(_wait_table) / sizeof(WaitTableEntry) - 1);
|
||||
WaitTableEntry &entry = _wait_table[i];
|
||||
@ -65,7 +65,7 @@ emulated_wake(PVOID addr) {
|
||||
* Emulates WaitOnAddress for Windows Vista and 7. Only supports aligned
|
||||
* 32-bit values.
|
||||
*/
|
||||
static BOOL
|
||||
static BOOL __stdcall
|
||||
emulated_wait(volatile VOID *addr, PVOID cmp, SIZE_T size, DWORD timeout) {
|
||||
assert(size == sizeof(LONG));
|
||||
|
||||
@ -95,7 +95,7 @@ emulated_wait(volatile VOID *addr, PVOID cmp, SIZE_T size, DWORD timeout) {
|
||||
* Initially assigned to the wait function slot to initialize the function
|
||||
* pointers.
|
||||
*/
|
||||
static BOOL
|
||||
static BOOL __stdcall
|
||||
initialize_wait(volatile VOID *addr, PVOID cmp, SIZE_T size, DWORD timeout) {
|
||||
// There's a chance of a race here, with two threads trying to initialize the
|
||||
// functions at the same time. That's OK, because they should all produce
|
||||
|
@ -18,6 +18,6 @@
|
||||
#include "conditionVarWin32Impl.h"
|
||||
|
||||
// This function gets replaced by PStats to measure the time spent waiting.
|
||||
BOOL (*ConditionVarWin32Impl::_wait_func)(PCONDITION_VARIABLE, PSRWLOCK, DWORD, ULONG) = &SleepConditionVariableSRW;
|
||||
BOOL (__stdcall *ConditionVarWin32Impl::_wait_func)(PCONDITION_VARIABLE, PSRWLOCK, DWORD, ULONG) = &SleepConditionVariableSRW;
|
||||
|
||||
#endif // _WIN32
|
||||
|
Loading…
x
Reference in New Issue
Block a user