Fixed missing prototypes on Android, patch from Sylvain
authorSam Lantinga <slouken@libsdl.org>
Fri, 02 Dec 2016 02:25:12 -0800
changeset 1067210fb0ebc4fbf
parent 10671 5ecf0b24da52
child 10673 4f02752f8d85
Fixed missing prototypes on Android, patch from Sylvain
include/SDL_system.h
src/audio/android/SDL_androidaudio.c
src/audio/android/SDL_androidaudio.h
src/core/android/SDL_android.c
src/core/android/SDL_android.h
src/joystick/android/SDL_sysjoystick.c
src/power/android/SDL_syspower.c
src/video/android/SDL_androidclipboard.c
src/video/android/SDL_androidevents.c
src/video/android/SDL_androidgl.c
src/video/android/SDL_androidgl.h
src/video/android/SDL_androidmessagebox.c
src/video/android/SDL_androidvideo.c
     1.1 --- a/include/SDL_system.h	Fri Dec 02 02:21:35 2016 -0800
     1.2 +++ b/include/SDL_system.h	Fri Dec 02 02:25:12 2016 -0800
     1.3 @@ -96,7 +96,7 @@
     1.4  
     1.5     This returns JNIEnv*, but the prototype is void* so we don't need jni.h
     1.6   */
     1.7 -extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv();
     1.8 +extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
     1.9  
    1.10  /**
    1.11     \brief Get the SDL Activity object for the application
    1.12 @@ -106,7 +106,7 @@
    1.13     It is the caller's responsibility to properly release it
    1.14     (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef)
    1.15   */
    1.16 -extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity();
    1.17 +extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
    1.18  
    1.19  /**
    1.20     See the official Android developer guide for more information:
    1.21 @@ -121,7 +121,7 @@
    1.22     This path is unique to your application and cannot be written to
    1.23     by other applications.
    1.24   */
    1.25 -extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath();
    1.26 +extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
    1.27  
    1.28  /**
    1.29     \brief Get the current state of external storage, a bitmask of these values:
    1.30 @@ -130,7 +130,7 @@
    1.31  
    1.32     If external storage is currently unavailable, this will return 0.
    1.33  */
    1.34 -extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState();
    1.35 +extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(void);
    1.36  
    1.37  /**
    1.38     \brief Get the path used for external storage for this application.
    1.39 @@ -138,7 +138,7 @@
    1.40     This path is unique to your application, but is public and can be
    1.41     written to by other applications.
    1.42   */
    1.43 -extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath();
    1.44 +extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
    1.45  
    1.46  #endif /* __ANDROID__ */
    1.47  
     2.1 --- a/src/audio/android/SDL_androidaudio.c	Fri Dec 02 02:21:35 2016 -0800
     2.2 +++ b/src/audio/android/SDL_androidaudio.c	Fri Dec 02 02:25:12 2016 -0800
     2.3 @@ -215,6 +215,10 @@
     2.4      }
     2.5  }
     2.6  
     2.7 +#else 
     2.8 +
     2.9 +void ANDROIDAUDIO_ResumeDevices(void) {}
    2.10 +void ANDROIDAUDIO_PauseDevices(void) {}
    2.11  
    2.12  #endif /* SDL_AUDIO_DRIVER_ANDROID */
    2.13  
     3.1 --- a/src/audio/android/SDL_androidaudio.h	Fri Dec 02 02:21:35 2016 -0800
     3.2 +++ b/src/audio/android/SDL_androidaudio.h	Fri Dec 02 02:25:12 2016 -0800
     3.3 @@ -34,6 +34,9 @@
     3.4      int resume;
     3.5  };
     3.6  
     3.7 +void ANDROIDAUDIO_ResumeDevices(void);
     3.8 +void ANDROIDAUDIO_PauseDevices(void);
     3.9 +
    3.10  #endif /* _SDL_androidaudio_h */
    3.11  
    3.12  /* vi: set ts=4 sw=4 expandtab: */
     4.1 --- a/src/core/android/SDL_android.c	Fri Dec 02 02:21:35 2016 -0800
     4.2 +++ b/src/core/android/SDL_android.c	Fri Dec 02 02:25:12 2016 -0800
     4.3 @@ -42,12 +42,110 @@
     4.4  #include <pthread.h>
     4.5  #include <sys/types.h>
     4.6  #include <unistd.h>
     4.7 -#define LOG_TAG "SDL_android"
     4.8 +/* #define LOG_TAG "SDL_android" */
     4.9  /* #define LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) */
    4.10  /* #define LOGE(...)  __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) */
    4.11  #define LOGI(...) do {} while (0)
    4.12  #define LOGE(...) do {} while (0)
    4.13  
    4.14 +
    4.15 +#define SDL_JAVA_PREFIX                                 org_libsdl_app
    4.16 +#define CONCAT1(prefix, class, function)                CONCAT2(prefix, class, function)
    4.17 +#define CONCAT2(prefix, class, function)                Java_ ## prefix ## _ ## class ## _ ## function
    4.18 +#define SDL_JAVA_INTERFACE(function)                    CONCAT1(SDL_JAVA_PREFIX, SDLActivity, function)
    4.19 +#define SDL_JAVA_INTERFACE_INPUT_CONNECTION(function)   CONCAT1(SDL_JAVA_PREFIX, SDLInputConnection, function)
    4.20 +
    4.21 +
    4.22 +/* Java class SDLActivity */
    4.23 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeDropFile)(
    4.24 +        JNIEnv* env, jclass jcls,
    4.25 +        jstring filename);
    4.26 +
    4.27 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeResize)(
    4.28 +        JNIEnv* env, jclass jcls,
    4.29 +        jint width, jint height, jint format, jfloat rate);
    4.30 +
    4.31 +JNIEXPORT jint JNICALL SDL_JAVA_INTERFACE(onNativePadDown)(
    4.32 +        JNIEnv* env, jclass jcls,
    4.33 +        jint device_id, jint keycode);
    4.34 +
    4.35 +JNIEXPORT jint JNICALL SDL_JAVA_INTERFACE(onNativePadUp)(
    4.36 +        JNIEnv* env, jclass jcls,
    4.37 +        jint device_id, jint keycode);
    4.38 +
    4.39 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeJoy)(
    4.40 +        JNIEnv* env, jclass jcls,
    4.41 +        jint device_id, jint axis, jfloat value);
    4.42 +
    4.43 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeHat)(
    4.44 +        JNIEnv* env, jclass jcls,
    4.45 +        jint device_id, jint hat_id, jint x, jint y);
    4.46 +
    4.47 +JNIEXPORT jint JNICALL SDL_JAVA_INTERFACE(nativeAddJoystick)(
    4.48 +        JNIEnv* env, jclass jcls,
    4.49 +        jint device_id, jstring device_name, jint is_accelerometer, 
    4.50 +        jint nbuttons, jint naxes, jint nhats, jint nballs);
    4.51 +
    4.52 +JNIEXPORT jint JNICALL SDL_JAVA_INTERFACE(nativeRemoveJoystick)(
    4.53 +        JNIEnv* env, jclass jcls,
    4.54 +        jint device_id);
    4.55 +
    4.56 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceChanged)(
    4.57 +        JNIEnv* env, jclass jcls);
    4.58 +
    4.59 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceDestroyed)(
    4.60 +        JNIEnv* env, jclass jcls);
    4.61 +
    4.62 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeKeyDown)(
    4.63 +        JNIEnv* env, jclass jcls,
    4.64 +        jint keycode);
    4.65 +
    4.66 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeKeyUp)(
    4.67 +        JNIEnv* env, jclass jcls,
    4.68 +        jint keycode);
    4.69 +
    4.70 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeKeyboardFocusLost)(
    4.71 +        JNIEnv* env, jclass jcls);
    4.72 +
    4.73 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeTouch)(
    4.74 +        JNIEnv* env, jclass jcls,
    4.75 +        jint touch_device_id_in, jint pointer_finger_id_in,
    4.76 +        jint action, jfloat x, jfloat y, jfloat p);
    4.77 +
    4.78 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeMouse)(
    4.79 +        JNIEnv* env, jclass jcls,
    4.80 +        jint button, jint action, jfloat x, jfloat y);
    4.81 +
    4.82 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeAccel)(
    4.83 +        JNIEnv* env, jclass jcls,
    4.84 +        jfloat x, jfloat y, jfloat z);
    4.85 +
    4.86 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeLowMemory)(
    4.87 +        JNIEnv* env, jclass cls);
    4.88 +
    4.89 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeQuit)(
    4.90 +        JNIEnv* env, jclass cls);
    4.91 +
    4.92 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativePause)(
    4.93 +        JNIEnv* env, jclass cls);
    4.94 +
    4.95 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeResume)(
    4.96 +        JNIEnv* env, jclass cls);
    4.97 +
    4.98 +JNIEXPORT jstring JNICALL SDL_JAVA_INTERFACE(nativeGetHint)(
    4.99 +        JNIEnv* env, jclass cls,
   4.100 +        jstring name);
   4.101 +
   4.102 +/* Java class SDLInputConnection */
   4.103 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeCommitText)(
   4.104 +        JNIEnv* env, jclass cls,
   4.105 +        jstring text, jint newCursorPosition);
   4.106 +
   4.107 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeSetComposingText)(
   4.108 +        JNIEnv* env, jclass cls,
   4.109 +        jstring text, jint newCursorPosition);
   4.110 +
   4.111 +
   4.112  /* Uncomment this to log messages entering and exiting methods in this file */
   4.113  /* #define DEBUG_JNI */
   4.114  
   4.115 @@ -153,7 +251,7 @@
   4.116  }
   4.117  
   4.118  /* Drop file */
   4.119 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeDropFile(
   4.120 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeDropFile)(
   4.121                                      JNIEnv* env, jclass jcls,
   4.122                                      jstring filename)
   4.123  {
   4.124 @@ -164,7 +262,7 @@
   4.125  }
   4.126  
   4.127  /* Resize */
   4.128 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeResize(
   4.129 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeResize)(
   4.130                                      JNIEnv* env, jclass jcls,
   4.131                                      jint width, jint height, jint format, jfloat rate)
   4.132  {
   4.133 @@ -172,7 +270,7 @@
   4.134  }
   4.135  
   4.136  /* Paddown */
   4.137 -JNIEXPORT jint JNICALL Java_org_libsdl_app_SDLActivity_onNativePadDown(
   4.138 +JNIEXPORT jint JNICALL SDL_JAVA_INTERFACE(onNativePadDown)(
   4.139                                      JNIEnv* env, jclass jcls,
   4.140                                      jint device_id, jint keycode)
   4.141  {
   4.142 @@ -180,15 +278,15 @@
   4.143  }
   4.144  
   4.145  /* Padup */
   4.146 -JNIEXPORT jint JNICALL Java_org_libsdl_app_SDLActivity_onNativePadUp(
   4.147 -                                   JNIEnv* env, jclass jcls,
   4.148 -                                   jint device_id, jint keycode)
   4.149 +JNIEXPORT jint JNICALL SDL_JAVA_INTERFACE(onNativePadUp)(
   4.150 +                                    JNIEnv* env, jclass jcls,
   4.151 +                                    jint device_id, jint keycode)
   4.152  {
   4.153      return Android_OnPadUp(device_id, keycode);
   4.154  }
   4.155  
   4.156  /* Joy */
   4.157 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeJoy(
   4.158 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeJoy)(
   4.159                                      JNIEnv* env, jclass jcls,
   4.160                                      jint device_id, jint axis, jfloat value)
   4.161  {
   4.162 @@ -196,7 +294,7 @@
   4.163  }
   4.164  
   4.165  /* POV Hat */
   4.166 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeHat(
   4.167 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeHat)(
   4.168                                      JNIEnv* env, jclass jcls,
   4.169                                      jint device_id, jint hat_id, jint x, jint y)
   4.170  {
   4.171 @@ -204,10 +302,10 @@
   4.172  }
   4.173  
   4.174  
   4.175 -JNIEXPORT jint JNICALL Java_org_libsdl_app_SDLActivity_nativeAddJoystick(
   4.176 -    JNIEnv* env, jclass jcls,
   4.177 -    jint device_id, jstring device_name, jint is_accelerometer, 
   4.178 -    jint nbuttons, jint naxes, jint nhats, jint nballs)
   4.179 +JNIEXPORT jint JNICALL SDL_JAVA_INTERFACE(nativeAddJoystick)(
   4.180 +                                    JNIEnv* env, jclass jcls,
   4.181 +                                    jint device_id, jstring device_name, jint is_accelerometer, 
   4.182 +                                    jint nbuttons, jint naxes, jint nhats, jint nballs)
   4.183  {
   4.184      int retval;
   4.185      const char *name = (*env)->GetStringUTFChars(env, device_name, NULL);
   4.186 @@ -219,15 +317,16 @@
   4.187      return retval;
   4.188  }
   4.189  
   4.190 -JNIEXPORT jint JNICALL Java_org_libsdl_app_SDLActivity_nativeRemoveJoystick(
   4.191 -    JNIEnv* env, jclass jcls, jint device_id)
   4.192 +JNIEXPORT jint JNICALL SDL_JAVA_INTERFACE(nativeRemoveJoystick)(
   4.193 +                                    JNIEnv* env, jclass jcls,
   4.194 +                                    jint device_id)
   4.195  {
   4.196      return Android_RemoveJoystick(device_id);
   4.197  }
   4.198  
   4.199  
   4.200  /* Surface Created */
   4.201 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeSurfaceChanged(JNIEnv* env, jclass jcls)
   4.202 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceChanged)(JNIEnv* env, jclass jcls)
   4.203  {
   4.204      SDL_WindowData *data;
   4.205      SDL_VideoDevice *_this;
   4.206 @@ -253,7 +352,7 @@
   4.207  }
   4.208  
   4.209  /* Surface Destroyed */
   4.210 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeSurfaceDestroyed(JNIEnv* env, jclass jcls)
   4.211 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceDestroyed)(JNIEnv* env, jclass jcls)
   4.212  {
   4.213      /* We have to clear the current context and destroy the egl surface here
   4.214       * Otherwise there's BAD_NATIVE_WINDOW errors coming from eglCreateWindowSurface on resume
   4.215 @@ -280,21 +379,23 @@
   4.216  }
   4.217  
   4.218  /* Keydown */
   4.219 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeKeyDown(
   4.220 -                                    JNIEnv* env, jclass jcls, jint keycode)
   4.221 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeKeyDown)(
   4.222 +                                    JNIEnv* env, jclass jcls,
   4.223 +                                    jint keycode)
   4.224  {
   4.225      Android_OnKeyDown(keycode);
   4.226  }
   4.227  
   4.228  /* Keyup */
   4.229 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeKeyUp(
   4.230 -                                    JNIEnv* env, jclass jcls, jint keycode)
   4.231 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeKeyUp)(
   4.232 +                                    JNIEnv* env, jclass jcls,
   4.233 +                                    jint keycode)
   4.234  {
   4.235      Android_OnKeyUp(keycode);
   4.236  }
   4.237  
   4.238  /* Keyboard Focus Lost */
   4.239 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeKeyboardFocusLost(
   4.240 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeKeyboardFocusLost)(
   4.241                                      JNIEnv* env, jclass jcls)
   4.242  {
   4.243      /* Calling SDL_StopTextInput will take care of hiding the keyboard and cleaning up the DummyText widget */
   4.244 @@ -303,7 +404,7 @@
   4.245  
   4.246  
   4.247  /* Touch */
   4.248 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeTouch(
   4.249 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeTouch)(
   4.250                                      JNIEnv* env, jclass jcls,
   4.251                                      jint touch_device_id_in, jint pointer_finger_id_in,
   4.252                                      jint action, jfloat x, jfloat y, jfloat p)
   4.253 @@ -312,7 +413,7 @@
   4.254  }
   4.255  
   4.256  /* Mouse */
   4.257 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeMouse(
   4.258 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeMouse)(
   4.259                                      JNIEnv* env, jclass jcls,
   4.260                                      jint button, jint action, jfloat x, jfloat y)
   4.261  {
   4.262 @@ -320,7 +421,7 @@
   4.263  }
   4.264  
   4.265  /* Accelerometer */
   4.266 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeAccel(
   4.267 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeAccel)(
   4.268                                      JNIEnv* env, jclass jcls,
   4.269                                      jfloat x, jfloat y, jfloat z)
   4.270  {
   4.271 @@ -331,14 +432,14 @@
   4.272  }
   4.273  
   4.274  /* Low memory */
   4.275 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativeLowMemory(
   4.276 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeLowMemory)(
   4.277                                      JNIEnv* env, jclass cls)
   4.278  {
   4.279      SDL_SendAppEvent(SDL_APP_LOWMEMORY);
   4.280  }
   4.281  
   4.282  /* Quit */
   4.283 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativeQuit(
   4.284 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeQuit)(
   4.285                                      JNIEnv* env, jclass cls)
   4.286  {
   4.287      /* Discard previous events. The user should have handled state storage
   4.288 @@ -354,7 +455,7 @@
   4.289  }
   4.290  
   4.291  /* Pause */
   4.292 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativePause(
   4.293 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativePause)(
   4.294                                      JNIEnv* env, jclass cls)
   4.295  {
   4.296      __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativePause()");
   4.297 @@ -371,7 +472,7 @@
   4.298  }
   4.299  
   4.300  /* Resume */
   4.301 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativeResume(
   4.302 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeResume)(
   4.303                                      JNIEnv* env, jclass cls)
   4.304  {
   4.305      __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativeResume()");
   4.306 @@ -389,7 +490,7 @@
   4.307      }
   4.308  }
   4.309  
   4.310 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLInputConnection_nativeCommitText(
   4.311 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeCommitText)(
   4.312                                      JNIEnv* env, jclass cls,
   4.313                                      jstring text, jint newCursorPosition)
   4.314  {
   4.315 @@ -400,7 +501,7 @@
   4.316      (*env)->ReleaseStringUTFChars(env, text, utftext);
   4.317  }
   4.318  
   4.319 -JNIEXPORT void JNICALL Java_org_libsdl_app_SDLInputConnection_nativeSetComposingText(
   4.320 +JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeSetComposingText)(
   4.321                                      JNIEnv* env, jclass cls,
   4.322                                      jstring text, jint newCursorPosition)
   4.323  {
   4.324 @@ -411,7 +512,10 @@
   4.325      (*env)->ReleaseStringUTFChars(env, text, utftext);
   4.326  }
   4.327  
   4.328 -JNIEXPORT jstring JNICALL Java_org_libsdl_app_SDLActivity_nativeGetHint(JNIEnv* env, jclass cls, jstring name) {
   4.329 +JNIEXPORT jstring JNICALL SDL_JAVA_INTERFACE(nativeGetHint)(
   4.330 +                                    JNIEnv* env, jclass cls,
   4.331 +                                    jstring name)
   4.332 +{
   4.333      const char *utfname = (*env)->GetStringUTFChars(env, name, NULL);
   4.334      const char *hint = SDL_GetHint(utfname);
   4.335  
     5.1 --- a/src/core/android/SDL_android.h	Fri Dec 02 02:21:35 2016 -0800
     5.2 +++ b/src/core/android/SDL_android.h	Fri Dec 02 02:25:12 2016 -0800
     5.3 @@ -82,6 +82,13 @@
     5.4  /* Generic messages */
     5.5  int Android_JNI_SendMessage(int command, int param);
     5.6  
     5.7 +/* Init */
     5.8 +JNIEXPORT void JNICALL SDL_Android_Init(JNIEnv* mEnv, jclass cls);
     5.9 +
    5.10 +/* MessageBox */
    5.11 +#include "SDL_messagebox.h"
    5.12 +int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
    5.13 +
    5.14  /* Ends C function definitions when using C++ */
    5.15  #ifdef __cplusplus
    5.16  /* *INDENT-OFF* */
     6.1 --- a/src/joystick/android/SDL_sysjoystick.c	Fri Dec 02 02:21:35 2016 -0800
     6.2 +++ b/src/joystick/android/SDL_sysjoystick.c	Fri Dec 02 02:25:12 2016 -0800
     6.3 @@ -167,7 +167,7 @@
     6.4              
     6.5          default:
     6.6              return -1;
     6.7 -            break;
     6.8 +            /* break; -Wunreachable-code-break */
     6.9      }
    6.10      
    6.11      /* This is here in case future generations, probably with six fingers per hand, 
     7.1 --- a/src/power/android/SDL_syspower.c	Fri Dec 02 02:21:35 2016 -0800
     7.2 +++ b/src/power/android/SDL_syspower.c	Fri Dec 02 02:25:12 2016 -0800
     7.3 @@ -24,6 +24,7 @@
     7.4  #if SDL_POWER_ANDROID
     7.5  
     7.6  #include "SDL_power.h"
     7.7 +#include "../SDL_syspower.h"
     7.8  
     7.9  #include "../../core/android/SDL_android.h"
    7.10  
     8.1 --- a/src/video/android/SDL_androidclipboard.c	Fri Dec 02 02:21:35 2016 -0800
     8.2 +++ b/src/video/android/SDL_androidclipboard.c	Fri Dec 02 02:25:12 2016 -0800
     8.3 @@ -23,7 +23,7 @@
     8.4  #if SDL_VIDEO_DRIVER_ANDROID
     8.5  
     8.6  #include "SDL_androidvideo.h"
     8.7 -
     8.8 +#include "SDL_androidclipboard.h"
     8.9  #include "../../core/android/SDL_android.h"
    8.10  
    8.11  int
     9.1 --- a/src/video/android/SDL_androidevents.c	Fri Dec 02 02:21:35 2016 -0800
     9.2 +++ b/src/video/android/SDL_androidevents.c	Fri Dec 02 02:25:12 2016 -0800
     9.3 @@ -29,19 +29,12 @@
     9.4  #include "SDL_events.h"
     9.5  #include "SDL_androidwindow.h"
     9.6  
     9.7 +/* Can't include sysaudio "../../audio/android/SDL_androidaudio.h"
     9.8 + * because of THIS redefinition */
     9.9 +extern void ANDROIDAUDIO_ResumeDevices(void);
    9.10 +extern void ANDROIDAUDIO_PauseDevices(void);
    9.11  
    9.12 -void android_egl_context_backup();
    9.13 -void android_egl_context_restore();
    9.14 -
    9.15 -#if SDL_AUDIO_DRIVER_ANDROID
    9.16 -void ANDROIDAUDIO_ResumeDevices(void);
    9.17 -void ANDROIDAUDIO_PauseDevices(void);
    9.18 -#else
    9.19 -static void ANDROIDAUDIO_ResumeDevices(void) {}
    9.20 -static void ANDROIDAUDIO_PauseDevices(void) {}
    9.21 -#endif
    9.22 -
    9.23 -void 
    9.24 +static void 
    9.25  android_egl_context_restore() 
    9.26  {
    9.27      SDL_Event event;
    9.28 @@ -55,7 +48,7 @@
    9.29      }
    9.30  }
    9.31  
    9.32 -void 
    9.33 +static void 
    9.34  android_egl_context_backup() 
    9.35  {
    9.36      /* Keep a copy of the EGL Context so we can try to restore it when we resume */
    10.1 --- a/src/video/android/SDL_androidgl.c	Fri Dec 02 02:21:35 2016 -0800
    10.2 +++ b/src/video/android/SDL_androidgl.c	Fri Dec 02 02:25:12 2016 -0800
    10.3 @@ -29,6 +29,7 @@
    10.4  #include "SDL_androidwindow.h"
    10.5  
    10.6  #include "SDL_androidvideo.h"
    10.7 +#include "SDL_androidgl.h"
    10.8  #include "../../core/android/SDL_android.h"
    10.9  
   10.10  #include <android/log.h>
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/src/video/android/SDL_androidgl.h	Fri Dec 02 02:25:12 2016 -0800
    11.3 @@ -0,0 +1,34 @@
    11.4 +/*
    11.5 +  Simple DirectMedia Layer
    11.6 +  Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
    11.7 +
    11.8 +  This software is provided 'as-is', without any express or implied
    11.9 +  warranty.  In no event will the authors be held liable for any damages
   11.10 +  arising from the use of this software.
   11.11 +
   11.12 +  Permission is granted to anyone to use this software for any purpose,
   11.13 +  including commercial applications, and to alter it and redistribute it
   11.14 +  freely, subject to the following restrictions:
   11.15 +
   11.16 +  1. The origin of this software must not be misrepresented; you must not
   11.17 +     claim that you wrote the original software. If you use this software
   11.18 +     in a product, an acknowledgment in the product documentation would be
   11.19 +     appreciated but is not required.
   11.20 +  2. Altered source versions must be plainly marked as such, and must not be
   11.21 +     misrepresented as being the original software.
   11.22 +  3. This notice may not be removed or altered from any source distribution.
   11.23 +*/
   11.24 +#include "../../SDL_internal.h"
   11.25 +
   11.26 +#ifndef _SDL_androidgl_h
   11.27 +#define _SDL_androidgl_h
   11.28 +
   11.29 +SDL_GLContext Android_GLES_CreateContext(_THIS, SDL_Window * window);
   11.30 +int Android_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
   11.31 +void Android_GLES_SwapWindow(_THIS, SDL_Window * window);
   11.32 +int Android_GLES_LoadLibrary(_THIS, const char *path);
   11.33 +
   11.34 +
   11.35 +#endif /* _SDL_androidgl_h */
   11.36 +
   11.37 +/* vi: set ts=4 sw=4 expandtab: */
    12.1 --- a/src/video/android/SDL_androidmessagebox.c	Fri Dec 02 02:21:35 2016 -0800
    12.2 +++ b/src/video/android/SDL_androidmessagebox.c	Fri Dec 02 02:25:12 2016 -0800
    12.3 @@ -23,12 +23,12 @@
    12.4  #if SDL_VIDEO_DRIVER_ANDROID
    12.5  
    12.6  #include "SDL_messagebox.h"
    12.7 +#include "SDL_androidmessagebox.h"
    12.8 +#include "../../core/android/SDL_android.h"
    12.9  
   12.10  int
   12.11  Android_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
   12.12  {
   12.13 -    int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
   12.14 -
   12.15      return Android_JNI_ShowMessageBox(messageboxdata, buttonid);
   12.16  }
   12.17  
    13.1 --- a/src/video/android/SDL_androidvideo.c	Fri Dec 02 02:21:35 2016 -0800
    13.2 +++ b/src/video/android/SDL_androidvideo.c	Fri Dec 02 02:25:12 2016 -0800
    13.3 @@ -33,6 +33,7 @@
    13.4  #include "../../events/SDL_windowevents_c.h"
    13.5  
    13.6  #include "SDL_androidvideo.h"
    13.7 +#include "SDL_androidgl.h"
    13.8  #include "SDL_androidclipboard.h"
    13.9  #include "SDL_androidevents.h"
   13.10  #include "SDL_androidkeyboard.h"
   13.11 @@ -47,11 +48,6 @@
   13.12  static void Android_VideoQuit(_THIS);
   13.13  
   13.14  #include "../SDL_egl_c.h"
   13.15 -/* GL functions (SDL_androidgl.c) */
   13.16 -extern SDL_GLContext Android_GLES_CreateContext(_THIS, SDL_Window * window);
   13.17 -extern int Android_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
   13.18 -extern void Android_GLES_SwapWindow(_THIS, SDL_Window * window);
   13.19 -extern int Android_GLES_LoadLibrary(_THIS, const char *path);
   13.20  #define Android_GLES_GetProcAddress SDL_EGL_GetProcAddress
   13.21  #define Android_GLES_UnloadLibrary SDL_EGL_UnloadLibrary
   13.22  #define Android_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
   13.23 @@ -65,7 +61,7 @@
   13.24  int Android_ScreenWidth = 0;
   13.25  int Android_ScreenHeight = 0;
   13.26  Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_UNKNOWN;
   13.27 -int Android_ScreenRate = 0;
   13.28 +static int Android_ScreenRate = 0;
   13.29  
   13.30  SDL_sem *Android_PauseSem = NULL, *Android_ResumeSem = NULL;
   13.31