From 548a0ee7b82d308519d56cbccb2f394ffac66a50 Mon Sep 17 00:00:00 2001 From: Dimitris Zenios Date: Mon, 5 May 2014 22:21:26 +0300 Subject: [PATCH] __ANDROID__ is the correct macro to check for an android system.ANDROID is only defined in NDK build system (.mk) and not in the standalone NDK. --- include/SDL_egl.h | 2 +- include/SDL_rwops.h | 2 +- src/audio/SDL_audio.c | 2 +- src/file/SDL_rwops.c | 4 ++-- test/testautomation_rwops.c | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/SDL_egl.h b/include/SDL_egl.h index a345818aed04d..036e73a9f2c17 100644 --- a/include/SDL_egl.h +++ b/include/SDL_egl.h @@ -420,7 +420,7 @@ typedef struct gbm_device *EGLNativeDisplayType; typedef struct gbm_bo *EGLNativePixmapType; typedef void *EGLNativeWindowType; -#elif defined(ANDROID) /* Android */ +#elif defined(__ANDROID__) /* Android */ struct ANativeWindow; struct egl_native_pixmap_t; diff --git a/include/SDL_rwops.h b/include/SDL_rwops.h index 4bdd7876a3dbe..e404bae3cdfee 100644 --- a/include/SDL_rwops.h +++ b/include/SDL_rwops.h @@ -93,7 +93,7 @@ typedef struct SDL_RWops Uint32 type; union { -#if defined(ANDROID) +#if defined(__ANDROID__) struct { void *fileNameRef; diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index c26b86550e293..6023182eb6aa0 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -305,7 +305,7 @@ SDL_StreamDeinit(SDL_AudioStreamer * stream) } #endif -#if defined(ANDROID) +#if defined(__ANDROID__) #include #endif diff --git a/src/file/SDL_rwops.c b/src/file/SDL_rwops.c index afa35d062f599..70f8b24d28260 100644 --- a/src/file/SDL_rwops.c +++ b/src/file/SDL_rwops.c @@ -38,7 +38,7 @@ #include "cocoa/SDL_rwopsbundlesupport.h" #endif /* __APPLE__ */ -#ifdef ANDROID +#ifdef __ANDROID__ #include "../core/android/SDL_android.h" #include "SDL_system.h" #endif @@ -466,7 +466,7 @@ SDL_RWFromFile(const char *file, const char *mode) SDL_SetError("SDL_RWFromFile(): No file or no mode specified"); return NULL; } -#if defined(ANDROID) +#if defined(__ANDROID__) #ifdef HAVE_STDIO_H /* Try to open the file on the filesystem first */ if (*file == '/') { diff --git a/test/testautomation_rwops.c b/test/testautomation_rwops.c index c8e1c593baa68..32aa7f60c04e0 100644 --- a/test/testautomation_rwops.c +++ b/test/testautomation_rwops.c @@ -309,7 +309,7 @@ rwops_testFileRead(void) if (rw == NULL) return TEST_ABORTED; /* Check type */ -#if defined(ANDROID) +#if defined(__ANDROID__) SDLTest_AssertCheck( rw->type == SDL_RWOPS_STDFILE || rw->type == SDL_RWOPS_JNIFILE, "Verify RWops type is SDL_RWOPS_STDFILE or SDL_RWOPS_JNIFILE; expected: %d|%d, got: %d", SDL_RWOPS_STDFILE, SDL_RWOPS_JNIFILE, rw->type); @@ -356,7 +356,7 @@ rwops_testFileWrite(void) if (rw == NULL) return TEST_ABORTED; /* Check type */ -#if defined(ANDROID) +#if defined(__ANDROID__) SDLTest_AssertCheck( rw->type == SDL_RWOPS_STDFILE || rw->type == SDL_RWOPS_JNIFILE, "Verify RWops type is SDL_RWOPS_STDFILE or SDL_RWOPS_JNIFILE; expected: %d|%d, got: %d", SDL_RWOPS_STDFILE, SDL_RWOPS_JNIFILE, rw->type);