Fix Windows build

This commit is contained in:
Hanicef 2023-12-31 17:28:59 +01:00
parent 28f196ad3e
commit f2a9a81786
2 changed files with 8 additions and 6 deletions

View file

@ -213,7 +213,9 @@ UINT8 graphics_started = 0;
UINT8 keyboard_started = 0; UINT8 keyboard_started = 0;
static boolean consolevent = false; static boolean consolevent = false;
#if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON)
static boolean framebuffer = false; static boolean framebuffer = false;
#endif
static size_t num_exit_funcs; static size_t num_exit_funcs;
static void (*exit_funcs[MAX_EXIT_FUNCS])(void); static void (*exit_funcs[MAX_EXIT_FUNCS])(void);

View file

@ -292,10 +292,10 @@ void I_hold_cond(I_cond *cond_anchor, I_mutex mutex_id)
void I_wake_one_cond(I_cond *anchor) void I_wake_one_cond(I_cond *anchor)
{ {
EnterCriticalSection(&thread_lock); EnterCriticalSection(&thread_lock);
if (*cond_anchor == NULL) if (*anchor == NULL)
{ {
*cond_anchor = malloc(sizeof(CONDITION_VARIABLE)); *anchor = malloc(sizeof(CONDITION_VARIABLE));
InitializeConditionVariable(*cond_anchor); InitializeConditionVariable(*anchor);
} }
LeaveCriticalSection(&thread_lock); LeaveCriticalSection(&thread_lock);
WakeConditionVariable(*anchor); WakeConditionVariable(*anchor);
@ -304,10 +304,10 @@ void I_wake_one_cond(I_cond *anchor)
void I_wake_all_cond(I_cond *anchor) void I_wake_all_cond(I_cond *anchor)
{ {
EnterCriticalSection(&thread_lock); EnterCriticalSection(&thread_lock);
if (*cond_anchor == NULL) if (*anchor == NULL)
{ {
*cond_anchor = malloc(sizeof(CONDITION_VARIABLE)); *anchor = malloc(sizeof(CONDITION_VARIABLE));
InitializeConditionVariable(*cond_anchor); InitializeConditionVariable(*anchor);
} }
LeaveCriticalSection(&thread_lock); LeaveCriticalSection(&thread_lock);
WakeAllConditionVariable(*anchor); WakeAllConditionVariable(*anchor);