Skip to content

Commit

Permalink
Export android jni functions even when build with -fvisibility=hidden…
Browse files Browse the repository at this point in the history
… flag
  • Loading branch information
zenios committed May 5, 2014
1 parent fd2d26e commit 3672aeb
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions src/core/android/SDL_android.c
Expand Up @@ -86,7 +86,7 @@ static bool bHasNewData;
*******************************************************************************/

/* Library init */
jint JNI_OnLoad(JavaVM* vm, void* reserved)
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved)
{
JNIEnv *env;
mJavaVM = vm;
Expand All @@ -108,7 +108,7 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved)
}

/* Called before SDL_main() to initialize JNI bindings */
void SDL_Android_Init(JNIEnv* mEnv, jclass cls)
JNIEXPORT void JNICALL SDL_Android_Init(JNIEnv* mEnv, jclass cls)
{
__android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init()");

Expand Down Expand Up @@ -141,47 +141,47 @@ void SDL_Android_Init(JNIEnv* mEnv, jclass cls)
}

/* Resize */
void Java_org_libsdl_app_SDLActivity_onNativeResize(
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeResize(
JNIEnv* env, jclass jcls,
jint width, jint height, jint format)
{
Android_SetScreenResolution(width, height, format);
}

// Paddown
int Java_org_libsdl_app_SDLActivity_onNativePadDown(
JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_onNativePadDown(
JNIEnv* env, jclass jcls,
jint device_id, jint keycode)
{
return Android_OnPadDown(device_id, keycode);
}

// Padup
int Java_org_libsdl_app_SDLActivity_onNativePadUp(
JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_onNativePadUp(
JNIEnv* env, jclass jcls,
jint device_id, jint keycode)
{
return Android_OnPadUp(device_id, keycode);
}

/* Joy */
void Java_org_libsdl_app_SDLActivity_onNativeJoy(
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeJoy(
JNIEnv* env, jclass jcls,
jint device_id, jint axis, jfloat value)
{
Android_OnJoy(device_id, axis, value);
}

/* POV Hat */
void Java_org_libsdl_app_SDLActivity_onNativeHat(
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeHat(
JNIEnv* env, jclass jcls,
jint device_id, jint hat_id, jint x, jint y)
{
Android_OnHat(device_id, hat_id, x, y);
}


int Java_org_libsdl_app_SDLActivity_nativeAddJoystick(
JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_nativeAddJoystick(
JNIEnv* env, jclass jcls,
jint device_id, jstring device_name, jint is_accelerometer,
jint nbuttons, jint naxes, jint nhats, jint nballs)
Expand All @@ -196,15 +196,15 @@ int Java_org_libsdl_app_SDLActivity_nativeAddJoystick(
return retval;
}

int Java_org_libsdl_app_SDLActivity_nativeRemoveJoystick(
JNIEXPORT int JNICALL Java_org_libsdl_app_SDLActivity_nativeRemoveJoystick(
JNIEnv* env, jclass jcls, jint device_id)
{
return Android_RemoveJoystick(device_id);
}


/* Surface Created */
void Java_org_libsdl_app_SDLActivity_onNativeSurfaceChanged(JNIEnv* env, jclass jcls)
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeSurfaceChanged(JNIEnv* env, jclass jcls)
{
SDL_WindowData *data;
SDL_VideoDevice *_this;
Expand All @@ -230,7 +230,7 @@ void Java_org_libsdl_app_SDLActivity_onNativeSurfaceChanged(JNIEnv* env, jclass
}

/* Surface Destroyed */
void Java_org_libsdl_app_SDLActivity_onNativeSurfaceDestroyed(JNIEnv* env, jclass jcls)
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeSurfaceDestroyed(JNIEnv* env, jclass jcls)
{
/* We have to clear the current context and destroy the egl surface here
* Otherwise there's BAD_NATIVE_WINDOW errors coming from eglCreateWindowSurface on resume
Expand All @@ -256,27 +256,27 @@ void Java_org_libsdl_app_SDLActivity_onNativeSurfaceDestroyed(JNIEnv* env, jclas

}

void Java_org_libsdl_app_SDLActivity_nativeFlipBuffers(JNIEnv* env, jclass jcls)
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativeFlipBuffers(JNIEnv* env, jclass jcls)
{
SDL_GL_SwapWindow(Android_Window);
}

/* Keydown */
void Java_org_libsdl_app_SDLActivity_onNativeKeyDown(
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeKeyDown(
JNIEnv* env, jclass jcls, jint keycode)
{
Android_OnKeyDown(keycode);
}

/* Keyup */
void Java_org_libsdl_app_SDLActivity_onNativeKeyUp(
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeKeyUp(
JNIEnv* env, jclass jcls, jint keycode)
{
Android_OnKeyUp(keycode);
}

/* Keyboard Focus Lost */
void Java_org_libsdl_app_SDLActivity_onNativeKeyboardFocusLost(
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeKeyboardFocusLost(
JNIEnv* env, jclass jcls)
{
/* Calling SDL_StopTextInput will take care of hiding the keyboard and cleaning up the DummyText widget */
Expand All @@ -285,7 +285,7 @@ void Java_org_libsdl_app_SDLActivity_onNativeKeyboardFocusLost(


/* Touch */
void Java_org_libsdl_app_SDLActivity_onNativeTouch(
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeTouch(
JNIEnv* env, jclass jcls,
jint touch_device_id_in, jint pointer_finger_id_in,
jint action, jfloat x, jfloat y, jfloat p)
Expand All @@ -294,7 +294,7 @@ void Java_org_libsdl_app_SDLActivity_onNativeTouch(
}

/* Accelerometer */
void Java_org_libsdl_app_SDLActivity_onNativeAccel(
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_onNativeAccel(
JNIEnv* env, jclass jcls,
jfloat x, jfloat y, jfloat z)
{
Expand All @@ -305,14 +305,14 @@ void Java_org_libsdl_app_SDLActivity_onNativeAccel(
}

/* Low memory */
void Java_org_libsdl_app_SDLActivity_nativeLowMemory(
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativeLowMemory(
JNIEnv* env, jclass cls)
{
SDL_SendAppEvent(SDL_APP_LOWMEMORY);
}

/* Quit */
void Java_org_libsdl_app_SDLActivity_nativeQuit(
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativeQuit(
JNIEnv* env, jclass cls)
{
/* Discard previous events. The user should have handled state storage
Expand All @@ -328,7 +328,7 @@ void Java_org_libsdl_app_SDLActivity_nativeQuit(
}

/* Pause */
void Java_org_libsdl_app_SDLActivity_nativePause(
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativePause(
JNIEnv* env, jclass cls)
{
__android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativePause()");
Expand All @@ -345,7 +345,7 @@ void Java_org_libsdl_app_SDLActivity_nativePause(
}

/* Resume */
void Java_org_libsdl_app_SDLActivity_nativeResume(
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLActivity_nativeResume(
JNIEnv* env, jclass cls)
{
__android_log_print(ANDROID_LOG_VERBOSE, "SDL", "nativeResume()");
Expand All @@ -363,7 +363,7 @@ void Java_org_libsdl_app_SDLActivity_nativeResume(
}
}

void Java_org_libsdl_app_SDLInputConnection_nativeCommitText(
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLInputConnection_nativeCommitText(
JNIEnv* env, jclass cls,
jstring text, jint newCursorPosition)
{
Expand All @@ -374,7 +374,7 @@ void Java_org_libsdl_app_SDLInputConnection_nativeCommitText(
(*env)->ReleaseStringUTFChars(env, text, utftext);
}

void Java_org_libsdl_app_SDLInputConnection_nativeSetComposingText(
JNIEXPORT void JNICALL Java_org_libsdl_app_SDLInputConnection_nativeSetComposingText(
JNIEnv* env, jclass cls,
jstring text, jint newCursorPosition)
{
Expand Down

0 comments on commit 3672aeb

Please sign in to comment.