Fix -Wundef warnings due to use of unguarded __WINRT__

This commit is contained in:
Anonymous Maarten committed 2023-03-28 19:29:43 +02:00
1 parent 5bbff323c7
commit 992a9537d9
6 files changed
+13 -13

No files matched your search

+1 -1
View File
@@ -572,7 +572,7 @@ SDL_RWFromFile(const char *file, const char *mode)
{ {
#if defined(__APPLE__) && !SDL_FILE_DISABLED // TODO: add dummy? #if defined(__APPLE__) && !SDL_FILE_DISABLED // TODO: add dummy?
FILE *fp = SDL_OpenFPFromBundleOrFallback(file, mode); FILE *fp = SDL_OpenFPFromBundleOrFallback(file, mode);
#elif __WINRT__ #elif defined(__WINRT__)
FILE *fp = NULL; FILE *fp = NULL;
fopen_s(&fp, file, mode); fopen_s(&fp, file, mode);
#elif defined(__3DS__) #elif defined(__3DS__)
+1 -1
View File
@@ -2135,7 +2135,7 @@ static SDL_Renderer *GLES2_CreateRenderer(SDL_Window *window, Uint32 flags)
goto error; goto error;
} }
#if __WINRT__ #ifdef __WINRT__
/* DLudwig, 2013-11-29: ANGLE for WinRT doesn't seem to work unless VSync /* DLudwig, 2013-11-29: ANGLE for WinRT doesn't seem to work unless VSync
* is turned on. Not doing so will freeze the screen's contents to that * is turned on. Not doing so will freeze the screen's contents to that
* of the first drawn frame. * of the first drawn frame.
+2 -2
View File
@@ -56,7 +56,7 @@ typedef struct CONDITION_VARIABLE
} CONDITION_VARIABLE, *PCONDITION_VARIABLE; } CONDITION_VARIABLE, *PCONDITION_VARIABLE;
#endif #endif
#if __WINRT__ #ifdef __WINRT__
#define pWakeConditionVariable WakeConditionVariable #define pWakeConditionVariable WakeConditionVariable
#define pWakeAllConditionVariable WakeAllConditionVariable #define pWakeAllConditionVariable WakeAllConditionVariable
#define pSleepConditionVariableSRW SleepConditionVariableSRW #define pSleepConditionVariableSRW SleepConditionVariableSRW
@@ -224,7 +224,7 @@ SDL_CreateCond(void)
SDL_assert(SDL_mutex_impl_active.Type != SDL_MUTEX_INVALID); SDL_assert(SDL_mutex_impl_active.Type != SDL_MUTEX_INVALID);
} }
#if __WINRT__ #ifdef __WINRT__
/* Link statically on this platform */ /* Link statically on this platform */
impl = &SDL_cond_impl_cv; impl = &SDL_cond_impl_cv;
#else #else
+3 -3
View File
@@ -39,7 +39,7 @@ SDL_mutex_impl_t SDL_mutex_impl_active = { 0 };
* Implementation based on Slim Reader/Writer (SRW) Locks for Win 7 and newer. * Implementation based on Slim Reader/Writer (SRW) Locks for Win 7 and newer.
*/ */
#if __WINRT__ #ifdef __WINRT__
/* Functions are guaranteed to be available */ /* Functions are guaranteed to be available */
#define pReleaseSRWLockExclusive ReleaseSRWLockExclusive #define pReleaseSRWLockExclusive ReleaseSRWLockExclusive
#define pAcquireSRWLockExclusive AcquireSRWLockExclusive #define pAcquireSRWLockExclusive AcquireSRWLockExclusive
@@ -153,7 +153,7 @@ static SDL_mutex *SDL_CreateMutex_cs(void)
if (mutex != NULL) { if (mutex != NULL) {
/* Initialize */ /* Initialize */
/* On SMP systems, a non-zero spin count generally helps performance */ /* On SMP systems, a non-zero spin count generally helps performance */
#if __WINRT__ #ifdef __WINRT__
InitializeCriticalSectionEx(&mutex->cs, 2000, 0); InitializeCriticalSectionEx(&mutex->cs, 2000, 0);
#else #else
InitializeCriticalSectionAndSpinCount(&mutex->cs, 2000); InitializeCriticalSectionAndSpinCount(&mutex->cs, 2000);
@@ -224,7 +224,7 @@ SDL_CreateMutex(void)
const SDL_mutex_impl_t *impl = &SDL_mutex_impl_cs; const SDL_mutex_impl_t *impl = &SDL_mutex_impl_cs;
if (!SDL_GetHintBoolean(SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS, SDL_FALSE)) { if (!SDL_GetHintBoolean(SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS, SDL_FALSE)) {
#if __WINRT__ #ifdef __WINRT__
/* Link statically on this platform */ /* Link statically on this platform */
impl = &SDL_mutex_impl_srw; impl = &SDL_mutex_impl_srw;
#else #else
+3 -3
View File
@@ -67,7 +67,7 @@ static SDL_sem_impl_t SDL_sem_impl_active = { 0 };
#endif #endif
#if !SDL_WINAPI_FAMILY_PHONE #if !SDL_WINAPI_FAMILY_PHONE
#if __WINRT__ #ifdef __WINRT__
/* Functions are guaranteed to be available */ /* Functions are guaranteed to be available */
#define pWaitOnAddress WaitOnAddress #define pWaitOnAddress WaitOnAddress
#define pWakeByAddressSingle WakeByAddressSingle #define pWakeByAddressSingle WakeByAddressSingle
@@ -232,7 +232,7 @@ static SDL_sem *SDL_CreateSemaphore_kern(Uint32 initial_value)
sem = (SDL_sem_kern *)SDL_malloc(sizeof(*sem)); sem = (SDL_sem_kern *)SDL_malloc(sizeof(*sem));
if (sem != NULL) { if (sem != NULL) {
/* Create the semaphore, with max value 32K */ /* Create the semaphore, with max value 32K */
#if __WINRT__ #ifdef __WINRT__
sem->id = CreateSemaphoreEx(NULL, initial_value, 32 * 1024, NULL, 0, SEMAPHORE_ALL_ACCESS); sem->id = CreateSemaphoreEx(NULL, initial_value, 32 * 1024, NULL, 0, SEMAPHORE_ALL_ACCESS);
#else #else
sem->id = CreateSemaphore(NULL, initial_value, 32 * 1024, NULL); sem->id = CreateSemaphore(NULL, initial_value, 32 * 1024, NULL);
@@ -343,7 +343,7 @@ SDL_CreateSemaphore(Uint32 initial_value)
#if !SDL_WINAPI_FAMILY_PHONE #if !SDL_WINAPI_FAMILY_PHONE
if (!SDL_GetHintBoolean(SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL, SDL_FALSE)) { if (!SDL_GetHintBoolean(SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL, SDL_FALSE)) {
#if __WINRT__ #ifdef __WINRT__
/* Link statically on this platform */ /* Link statically on this platform */
impl = &SDL_sem_impl_atom; impl = &SDL_sem_impl_atom;
#else #else
+3 -3
View File
@@ -1371,7 +1371,7 @@ static void SDL_CheckWindowDisplayChanged(SDL_Window *window)
} }
} }
#if __WINRT__ #ifdef __WINRT__
extern Uint32 WINRT_DetectWindowFlags(SDL_Window *window); extern Uint32 WINRT_DetectWindowFlags(SDL_Window *window);
#endif #endif
@@ -1467,7 +1467,7 @@ static int SDL_UpdateFullscreenMode(SDL_Window *window, SDL_bool fullscreen)
goto done; goto done;
} }
} }
#elif __WINRT__ && (NTDDI_VERSION < NTDDI_WIN10) #elif defined(__WINRT__) && (NTDDI_VERSION < NTDDI_WIN10)
/* HACK: WinRT 8.x apps can't choose whether or not they are fullscreen /* HACK: WinRT 8.x apps can't choose whether or not they are fullscreen
or not. The user can choose this, via OS-provided UI, but this can't or not. The user can choose this, via OS-provided UI, but this can't
be set programmatically. be set programmatically.
@@ -1907,7 +1907,7 @@ SDL_Window *SDL_CreateWindowInternal(const char *title, int x, int y, int w, int
} }
#endif #endif
#if __WINRT__ && (NTDDI_VERSION < NTDDI_WIN10) #if defined(__WINRT__) && (NTDDI_VERSION < NTDDI_WIN10)
/* HACK: WinRT 8.x apps can't choose whether or not they are fullscreen /* HACK: WinRT 8.x apps can't choose whether or not they are fullscreen
or not. The user can choose this, via OS-provided UI, but this can't or not. The user can choose this, via OS-provided UI, but this can't
be set programmatically. be set programmatically.