From 803d3801c96e1ba49049d67a9413cdcf7919c35b Mon Sep 17 00:00:00 2001 From: Spoike Date: Thu, 4 Nov 2021 17:54:24 +0000 Subject: [PATCH] Fix some mingw compile-time issues. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6107 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/quakedef.h | 6 ------ engine/client/snd_al.c | 2 ++ engine/common/gl_q2bsp.c | 1 + engine/common/sys.h | 9 +++++++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/engine/client/quakedef.h b/engine/client/quakedef.h index 36428fff2..5a77d7b1f 100644 --- a/engine/client/quakedef.h +++ b/engine/client/quakedef.h @@ -364,12 +364,6 @@ extern cvar_t worker_flush; qboolean COM_DoWork(int thread, qboolean leavelocked); #define COM_MainThreadWork() while (COM_DoWork(0, false) && worker_flush.ival) /*called each frame to do any gl uploads or whatever*/ #define COM_MainThreadFlush() while (COM_DoWork(0, false)) /*make sure the main thread has done ALL work pending*/ -typedef enum wgroup_e -{ - WG_MAIN = 0, - WG_LOADER = 1, - WG_COUNT = 2 //main and loaders -} wgroup_t; void COM_AddWork(wgroup_t thread, void(*func)(void *ctx, void *data, size_t a, size_t b), void *ctx, void *data, size_t a, size_t b); //low priority void COM_InsertWork(wgroup_t tg, void(*func)(void *ctx, void *data, size_t a, size_t b), void *ctx, void *data, size_t a, size_t b); //high priority qboolean COM_HasWork(void); diff --git a/engine/client/snd_al.c b/engine/client/snd_al.c index 8355423e0..91d59d0d3 100644 --- a/engine/client/snd_al.c +++ b/engine/client/snd_al.c @@ -1780,6 +1780,7 @@ static qboolean QDECL OpenAL_InitCard2(soundcardinfo_t *sc, const char *devname, sc->inactive_sound = true; sc->Shutdown = OpenAL_Shutdown; +#ifdef HAVE_MIXER if (qmix) { sc->Lock = OAQM_LockBuffer; @@ -1819,6 +1820,7 @@ static qboolean QDECL OpenAL_InitCard2(soundcardinfo_t *sc, const char *devname, //palSourcePlay(oali->qmix.handle); } else +#endif { #ifdef USEEFX sc->SetEnvironmentReverb = OpenAL_SetReverb; diff --git a/engine/common/gl_q2bsp.c b/engine/common/gl_q2bsp.c index ce11d0bfc..6c9f1579b 100644 --- a/engine/common/gl_q2bsp.c +++ b/engine/common/gl_q2bsp.c @@ -7150,6 +7150,7 @@ static void CM_SetAreaPortalState (model_t *mod, unsigned int portalnum, unsigne prv->q2portalopen[portalnum] = open; break; #endif + default: break; } FloodAreaConnections (prv); } diff --git a/engine/common/sys.h b/engine/common/sys.h index e2965de54..a7ed12921 100644 --- a/engine/common/sys.h +++ b/engine/common/sys.h @@ -149,7 +149,12 @@ qboolean Sys_ConditionSignal(void *condv); //lock first qboolean Sys_ConditionBroadcast(void *condv); //lock first void Sys_DestroyConditional(void *condv); -enum wgroup_e; +typedef enum wgroup_e +{ + WG_MAIN = 0, + WG_LOADER = 1, + WG_COUNT = 2 //main and loaders +} wgroup_t; typedef struct { void *(QDECL *CreateMutex)(void); @@ -157,7 +162,7 @@ typedef struct qboolean (QDECL *UnlockMutex)(void *mutex); void (QDECL *DestroyMutex)(void *mutex); - void (*AddWork)(enum wgroup_e thread, void(*func)(void *ctx, void *data, size_t a, size_t b), void *ctx, void *data, size_t a, size_t b); //low priority + void (*AddWork)(wgroup_t thread, void(*func)(void *ctx, void *data, size_t a, size_t b), void *ctx, void *data, size_t a, size_t b); //low priority void (*WaitForCompletion)(void *priorityctx, int *address, int sleepwhilevalue); #define plugthreadfuncs_name "Threading" } plugthreadfuncs_t;