Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Allow C++ code to include SDL_android.h
Browse files Browse the repository at this point in the history
Alexey Petruchik

Although SDL_android.h is not intended to be included by client code sometimes it needed. For example you need JNIEnv pointer to make JNI calls to modified SDLActivity.java (video playback, facebook integration, in-apps). It seems a bit weird to write:

extern "C" {
#include "SDL_android.h"
}

in my AndroidJNI.cpp file.
  • Loading branch information
slouken committed Aug 4, 2013
1 parent 68b56c1 commit 0024ee9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/core/android/SDL_android.h
Expand Up @@ -20,6 +20,13 @@
*/
#include "SDL_config.h"

/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern "C" {
/* *INDENT-ON* */
#endif

#include "SDL_rect.h"

/* Interface from the SDL library into the Android Java activity */
Expand Down Expand Up @@ -61,4 +68,11 @@ int Android_JNI_SetupThread(void);
/* Generic messages */
int Android_JNI_SendMessage(int command, int param);

/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif

/* vi: set ts=4 sw=4 expandtab: */

0 comments on commit 0024ee9

Please sign in to comment.