mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-28 11:51:03 +01:00
Fix -Wundef warnings due to use of unguarded __WINRT__
This commit is contained in:
@@ -572,7 +572,7 @@ SDL_RWFromFile(const char *file, const char *mode)
|
||||
{
|
||||
#if defined(__APPLE__) && !SDL_FILE_DISABLED // TODO: add dummy?
|
||||
FILE *fp = SDL_OpenFPFromBundleOrFallback(file, mode);
|
||||
#elif __WINRT__
|
||||
#elif defined(__WINRT__)
|
||||
FILE *fp = NULL;
|
||||
fopen_s(&fp, file, mode);
|
||||
#elif defined(__3DS__)
|
||||
|
||||
@@ -2135,7 +2135,7 @@ static SDL_Renderer *GLES2_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||
goto error;
|
||||
}
|
||||
|
||||
#if __WINRT__
|
||||
#ifdef __WINRT__
|
||||
/* 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
|
||||
* of the first drawn frame.
|
||||
|
||||
@@ -56,7 +56,7 @@ typedef struct CONDITION_VARIABLE
|
||||
} CONDITION_VARIABLE, *PCONDITION_VARIABLE;
|
||||
#endif
|
||||
|
||||
#if __WINRT__
|
||||
#ifdef __WINRT__
|
||||
#define pWakeConditionVariable WakeConditionVariable
|
||||
#define pWakeAllConditionVariable WakeAllConditionVariable
|
||||
#define pSleepConditionVariableSRW SleepConditionVariableSRW
|
||||
@@ -224,7 +224,7 @@ SDL_CreateCond(void)
|
||||
SDL_assert(SDL_mutex_impl_active.Type != SDL_MUTEX_INVALID);
|
||||
}
|
||||
|
||||
#if __WINRT__
|
||||
#ifdef __WINRT__
|
||||
/* Link statically on this platform */
|
||||
impl = &SDL_cond_impl_cv;
|
||||
#else
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#if __WINRT__
|
||||
#ifdef __WINRT__
|
||||
/* Functions are guaranteed to be available */
|
||||
#define pReleaseSRWLockExclusive ReleaseSRWLockExclusive
|
||||
#define pAcquireSRWLockExclusive AcquireSRWLockExclusive
|
||||
@@ -153,7 +153,7 @@ static SDL_mutex *SDL_CreateMutex_cs(void)
|
||||
if (mutex != NULL) {
|
||||
/* Initialize */
|
||||
/* On SMP systems, a non-zero spin count generally helps performance */
|
||||
#if __WINRT__
|
||||
#ifdef __WINRT__
|
||||
InitializeCriticalSectionEx(&mutex->cs, 2000, 0);
|
||||
#else
|
||||
InitializeCriticalSectionAndSpinCount(&mutex->cs, 2000);
|
||||
@@ -224,7 +224,7 @@ SDL_CreateMutex(void)
|
||||
const SDL_mutex_impl_t *impl = &SDL_mutex_impl_cs;
|
||||
|
||||
if (!SDL_GetHintBoolean(SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS, SDL_FALSE)) {
|
||||
#if __WINRT__
|
||||
#ifdef __WINRT__
|
||||
/* Link statically on this platform */
|
||||
impl = &SDL_mutex_impl_srw;
|
||||
#else
|
||||
|
||||
@@ -67,7 +67,7 @@ static SDL_sem_impl_t SDL_sem_impl_active = { 0 };
|
||||
#endif
|
||||
|
||||
#if !SDL_WINAPI_FAMILY_PHONE
|
||||
#if __WINRT__
|
||||
#ifdef __WINRT__
|
||||
/* Functions are guaranteed to be available */
|
||||
#define pWaitOnAddress WaitOnAddress
|
||||
#define pWakeByAddressSingle WakeByAddressSingle
|
||||
@@ -232,7 +232,7 @@ static SDL_sem *SDL_CreateSemaphore_kern(Uint32 initial_value)
|
||||
sem = (SDL_sem_kern *)SDL_malloc(sizeof(*sem));
|
||||
if (sem != NULL) {
|
||||
/* Create the semaphore, with max value 32K */
|
||||
#if __WINRT__
|
||||
#ifdef __WINRT__
|
||||
sem->id = CreateSemaphoreEx(NULL, initial_value, 32 * 1024, NULL, 0, SEMAPHORE_ALL_ACCESS);
|
||||
#else
|
||||
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_GetHintBoolean(SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL, SDL_FALSE)) {
|
||||
#if __WINRT__
|
||||
#ifdef __WINRT__
|
||||
/* Link statically on this platform */
|
||||
impl = &SDL_sem_impl_atom;
|
||||
#else
|
||||
|
||||
@@ -1371,7 +1371,7 @@ static void SDL_CheckWindowDisplayChanged(SDL_Window *window)
|
||||
}
|
||||
}
|
||||
|
||||
#if __WINRT__
|
||||
#ifdef __WINRT__
|
||||
extern Uint32 WINRT_DetectWindowFlags(SDL_Window *window);
|
||||
#endif
|
||||
|
||||
@@ -1467,7 +1467,7 @@ static int SDL_UpdateFullscreenMode(SDL_Window *window, SDL_bool fullscreen)
|
||||
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
|
||||
or not. The user can choose this, via OS-provided UI, but this can't
|
||||
be set programmatically.
|
||||
@@ -1907,7 +1907,7 @@ SDL_Window *SDL_CreateWindowInternal(const char *title, int x, int y, int w, int
|
||||
}
|
||||
#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
|
||||
or not. The user can choose this, via OS-provided UI, but this can't
|
||||
be set programmatically.
|
||||
|
||||
Reference in New Issue
Block a user