diff --git a/src/file/SDL_rwops.c b/src/file/SDL_rwops.c index c1e0e380b1..c0dc45d687 100644 --- a/src/file/SDL_rwops.c +++ b/src/file/SDL_rwops.c @@ -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__) diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index 26bb5aa630..6a01582a02 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -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. diff --git a/src/thread/windows/SDL_syscond_cv.c b/src/thread/windows/SDL_syscond_cv.c index 80b00b9ff1..3cdd59b30d 100644 --- a/src/thread/windows/SDL_syscond_cv.c +++ b/src/thread/windows/SDL_syscond_cv.c @@ -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 diff --git a/src/thread/windows/SDL_sysmutex.c b/src/thread/windows/SDL_sysmutex.c index 3da1d173e0..0d424acb08 100644 --- a/src/thread/windows/SDL_sysmutex.c +++ b/src/thread/windows/SDL_sysmutex.c @@ -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 diff --git a/src/thread/windows/SDL_syssem.c b/src/thread/windows/SDL_syssem.c index 9bf291c4f2..cf0a0d6686 100644 --- a/src/thread/windows/SDL_syssem.c +++ b/src/thread/windows/SDL_syssem.c @@ -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 diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 215198637e..e75c9a9386 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -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.