src/core/android/SDL_android.c
changeset 8760 27eedcca604d
parent 8149 681eb46b8ac4
child 8776 29aac8b813d9
     1.1 --- a/src/core/android/SDL_android.c	Mon May 05 22:36:47 2014 +0300
     1.2 +++ b/src/core/android/SDL_android.c	Mon May 05 22:26:21 2014 +0300
     1.3 @@ -86,7 +86,7 @@
     1.4  *******************************************************************************/
     1.5  
     1.6  /* Library init */
     1.7 -jint JNI_OnLoad(JavaVM* vm, void* reserved)
     1.8 +JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved)
     1.9  {
    1.10      JNIEnv *env;
    1.11      mJavaVM = vm;
    1.12 @@ -108,7 +108,7 @@
    1.13  }
    1.14  
    1.15  /* Called before SDL_main() to initialize JNI bindings */
    1.16 -void SDL_Android_Init(JNIEnv* mEnv, jclass cls)
    1.17 +JNIEXPORT void JNICALL SDL_Android_Init(JNIEnv* mEnv, jclass cls)
    1.18  {
    1.19      __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init()");
    1.20  
    1.21 @@ -141,7 +141,7 @@
    1.22  }
    1.23  
    1.24  /* Resize */
    1.25 -void Java_org_libsdl_app_SDLActivity_onNativeResize(
    1.26 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeResize(
    1.27                                      JNIEnv* env, jclass jcls,
    1.28                                      jint width, jint height, jint format)
    1.29  {
    1.30 @@ -149,7 +149,7 @@
    1.31  }
    1.32  
    1.33  // Paddown
    1.34 -int Java_org_libsdl_app_SDLActivity_onNativePadDown(
    1.35 +JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_onNativePadDown(
    1.36                                      JNIEnv* env, jclass jcls,
    1.37                                      jint device_id, jint keycode)
    1.38  {
    1.39 @@ -157,7 +157,7 @@
    1.40  }
    1.41  
    1.42  // Padup
    1.43 -int Java_org_libsdl_app_SDLActivity_onNativePadUp(
    1.44 +JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_onNativePadUp(
    1.45                                     JNIEnv* env, jclass jcls,
    1.46                                     jint device_id, jint keycode)
    1.47  {
    1.48 @@ -165,7 +165,7 @@
    1.49  }
    1.50  
    1.51  /* Joy */
    1.52 -void Java_org_libsdl_app_SDLActivity_onNativeJoy(
    1.53 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeJoy(
    1.54                                      JNIEnv* env, jclass jcls,
    1.55                                      jint device_id, jint axis, jfloat value)
    1.56  {
    1.57 @@ -173,7 +173,7 @@
    1.58  }
    1.59  
    1.60  /* POV Hat */
    1.61 -void Java_org_libsdl_app_SDLActivity_onNativeHat(
    1.62 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeHat(
    1.63                                      JNIEnv* env, jclass jcls,
    1.64                                      jint device_id, jint hat_id, jint x, jint y)
    1.65  {
    1.66 @@ -181,7 +181,7 @@
    1.67  }
    1.68  
    1.69  
    1.70 -int Java_org_libsdl_app_SDLActivity_nativeAddJoystick(
    1.71 +JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_nativeAddJoystick(
    1.72      JNIEnv* env, jclass jcls,
    1.73      jint device_id, jstring device_name, jint is_accelerometer, 
    1.74      jint nbuttons, jint naxes, jint nhats, jint nballs)
    1.75 @@ -196,7 +196,7 @@
    1.76      return retval;
    1.77  }
    1.78  
    1.79 -int Java_org_libsdl_app_SDLActivity_nativeRemoveJoystick(
    1.80 +JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_nativeRemoveJoystick(
    1.81      JNIEnv* env, jclass jcls, jint device_id)
    1.82  {
    1.83      return Android_RemoveJoystick(device_id);
    1.84 @@ -204,7 +204,7 @@
    1.85  
    1.86  
    1.87  /* Surface Created */
    1.88 -void Java_org_libsdl_app_SDLActivity_onNativeSurfaceChanged(JNIEnv* env, jclass jcls)
    1.89 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeSurfaceChanged(JNIEnv* env, jclass jcls)
    1.90  {
    1.91      SDL_WindowData *data;
    1.92      SDL_VideoDevice *_this;
    1.93 @@ -230,7 +230,7 @@
    1.94  }
    1.95  
    1.96  /* Surface Destroyed */
    1.97 -void Java_org_libsdl_app_SDLActivity_onNativeSurfaceDestroyed(JNIEnv* env, jclass jcls)
    1.98 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeSurfaceDestroyed(JNIEnv* env, jclass jcls)
    1.99  {
   1.100      /* We have to clear the current context and destroy the egl surface here
   1.101       * Otherwise there's BAD_NATIVE_WINDOW errors coming from eglCreateWindowSurface on resume
   1.102 @@ -256,27 +256,27 @@
   1.103  
   1.104  }
   1.105  
   1.106 -void Java_org_libsdl_app_SDLActivity_nativeFlipBuffers(JNIEnv* env, jclass jcls)
   1.107 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativeFlipBuffers(JNIEnv* env, jclass jcls)
   1.108  {
   1.109      SDL_GL_SwapWindow(Android_Window);
   1.110  }
   1.111  
   1.112  /* Keydown */
   1.113 -void Java_org_libsdl_app_SDLActivity_onNativeKeyDown(
   1.114 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeKeyDown(
   1.115                                      JNIEnv* env, jclass jcls, jint keycode)
   1.116  {
   1.117      Android_OnKeyDown(keycode);
   1.118  }
   1.119  
   1.120  /* Keyup */
   1.121 -void Java_org_libsdl_app_SDLActivity_onNativeKeyUp(
   1.122 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeKeyUp(
   1.123                                      JNIEnv* env, jclass jcls, jint keycode)
   1.124  {
   1.125      Android_OnKeyUp(keycode);
   1.126  }
   1.127  
   1.128  /* Keyboard Focus Lost */
   1.129 -void Java_org_libsdl_app_SDLActivity_onNativeKeyboardFocusLost(
   1.130 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeKeyboardFocusLost(
   1.131                                      JNIEnv* env, jclass jcls)
   1.132  {
   1.133      /* Calling SDL_StopTextInput will take care of hiding the keyboard and cleaning up the DummyText widget */
   1.134 @@ -285,7 +285,7 @@
   1.135  
   1.136  
   1.137  /* Touch */
   1.138 -void Java_org_libsdl_app_SDLActivity_onNativeTouch(
   1.139 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeTouch(
   1.140                                      JNIEnv* env, jclass jcls,
   1.141                                      jint touch_device_id_in, jint pointer_finger_id_in,
   1.142                                      jint action, jfloat x, jfloat y, jfloat p)
   1.143 @@ -294,7 +294,7 @@
   1.144  }
   1.145  
   1.146  /* Accelerometer */
   1.147 -void Java_org_libsdl_app_SDLActivity_onNativeAccel(
   1.148 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeAccel(
   1.149                                      JNIEnv* env, jclass jcls,
   1.150                                      jfloat x, jfloat y, jfloat z)
   1.151  {
   1.152 @@ -305,14 +305,14 @@
   1.153  }
   1.154  
   1.155  /* Low memory */
   1.156 -void Java_org_libsdl_app_SDLActivity_nativeLowMemory(
   1.157 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativeLowMemory(
   1.158                                      JNIEnv* env, jclass cls)
   1.159  {
   1.160      SDL_SendAppEvent(SDL_APP_LOWMEMORY);
   1.161  }
   1.162  
   1.163  /* Quit */
   1.164 -void Java_org_libsdl_app_SDLActivity_nativeQuit(
   1.165 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativeQuit(
   1.166                                      JNIEnv* env, jclass cls)
   1.167  {
   1.168      /* Discard previous events. The user should have handled state storage
   1.169 @@ -328,7 +328,7 @@
   1.170  }
   1.171  
   1.172  /* Pause */
   1.173 -void Java_org_libsdl_app_SDLActivity_nativePause(
   1.174 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativePause(
   1.175                                      JNIEnv* env, jclass cls)
   1.176  {
   1.177      __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativePause()");
   1.178 @@ -345,7 +345,7 @@
   1.179  }
   1.180  
   1.181  /* Resume */
   1.182 -void Java_org_libsdl_app_SDLActivity_nativeResume(
   1.183 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativeResume(
   1.184                                      JNIEnv* env, jclass cls)
   1.185  {
   1.186      __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativeResume()");
   1.187 @@ -363,7 +363,7 @@
   1.188      }
   1.189  }
   1.190  
   1.191 -void Java_org_libsdl_app_SDLInputConnection_nativeCommitText(
   1.192 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLInputConnection_nativeCommitText(
   1.193                                      JNIEnv* env, jclass cls,
   1.194                                      jstring text, jint newCursorPosition)
   1.195  {
   1.196 @@ -374,7 +374,7 @@
   1.197      (*env)->ReleaseStringUTFChars(env, text, utftext);
   1.198  }
   1.199  
   1.200 -void Java_org_libsdl_app_SDLInputConnection_nativeSetComposingText(
   1.201 +JNIEXPORT void JNICALL Java_org_libsdl_app_SDLInputConnection_nativeSetComposingText(
   1.202                                      JNIEnv* env, jclass cls,
   1.203                                      jstring text, jint newCursorPosition)
   1.204  {