__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.
authorDimitris Zenios <dimitris.zenios@gmail.com>
Mon, 05 May 2014 22:21:26 +0300
changeset 8761 bce4122e6e87
parent 8760 27eedcca604d
child 8762 4b7d26162a2e
__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
include/SDL_rwops.h
src/audio/SDL_audio.c
src/file/SDL_rwops.c
test/testautomation_rwops.c
--- a/include/SDL_egl.h	Mon May 05 22:26:21 2014 +0300
+++ b/include/SDL_egl.h	Mon May 05 22:21:26 2014 +0300
@@ -420,7 +420,7 @@
 typedef struct gbm_bo      *EGLNativePixmapType;
 typedef void               *EGLNativeWindowType;
 
-#elif defined(ANDROID) /* Android */
+#elif defined(__ANDROID__) /* Android */
 
 struct ANativeWindow;
 struct egl_native_pixmap_t;
--- a/include/SDL_rwops.h	Mon May 05 22:26:21 2014 +0300
+++ b/include/SDL_rwops.h	Mon May 05 22:21:26 2014 +0300
@@ -93,7 +93,7 @@
     Uint32 type;
     union
     {
-#if defined(ANDROID)
+#if defined(__ANDROID__)
         struct
         {
             void *fileNameRef;
--- a/src/audio/SDL_audio.c	Mon May 05 22:26:21 2014 +0300
+++ b/src/audio/SDL_audio.c	Mon May 05 22:21:26 2014 +0300
@@ -305,7 +305,7 @@
 }
 #endif
 
-#if defined(ANDROID)
+#if defined(__ANDROID__)
 #include <android/log.h>
 #endif
 
--- a/src/file/SDL_rwops.c	Mon May 05 22:26:21 2014 +0300
+++ b/src/file/SDL_rwops.c	Mon May 05 22:21:26 2014 +0300
@@ -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_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 == '/') {
--- a/test/testautomation_rwops.c	Mon May 05 22:26:21 2014 +0300
+++ b/test/testautomation_rwops.c	Mon May 05 22:21:26 2014 +0300
@@ -309,7 +309,7 @@
    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 @@
    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);