diff options
author | Jan Nijtmans <nijtmans@users.sourceforge.net> | 2007-06-28 19:35:25 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2007-06-28 19:35:25 +0000 |
commit | c9640b919d6b96fc42820f7876292c3af260f030 (patch) | |
tree | cd2487f380163aa8e77de5603d31de41e737e555 | |
parent | 83f4c19f6781c69d5dd8069118e86d4cd2653f4d (diff) | |
download | gcc-c9640b919d6b96fc42820f7876292c3af260f030.zip gcc-c9640b919d6b96fc42820f7876292c3af260f030.tar.gz gcc-c9640b919d6b96fc42820f7876292c3af260f030.tar.bz2 |
re PR libgcj/30999 (support for GCC4.0's fvisibility option in JNIEXPORT macro)
2007-06-28 Jan Nijtmans <nijtmans@users.sourceforge.net>
PR libgcj/30999:
* jni_md.h: Add the possibility to compile jni code with.
-fvisibility=hidden. This causes all symbols to be hidden
except the JNI functions which need to be exported.
From-SVN: r126090
-rw-r--r-- | libjava/ChangeLog | 7 | ||||
-rw-r--r-- | libjava/include/jni_md.h | 23 |
2 files changed, 20 insertions, 10 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 5189d15..c6db9fb 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,10 @@ +2007-06-28 Jan Nijtmans <nijtmans@users.sourceforge.net> + + PR libgcj/30999: + * jni_md.h: Add the possibility to compile jni code with. + -fvisibility=hidden. This causes all symbols to be hidden + except the JNI functions which need to be exported. + 2007-06-28 Andreas Tobler <a.tobler@schweiz.org> * testsuite/libjava.jvmti/jvmti-interp.exp (gij_jvmti_test_one): Pass diff --git a/libjava/include/jni_md.h b/libjava/include/jni_md.h index 6ea90ab..f806bac 100644 --- a/libjava/include/jni_md.h +++ b/libjava/include/jni_md.h @@ -124,6 +124,19 @@ typedef uint16_t jchar; #define JNICALL __stdcall +#else /* !( _WIN32 || __WIN32__ || WIN32) */ + +#define JNIIMPORT +#if defined(__GNUC__) && __GNUC__ > 3 +#define JNIEXPORT __attribute__ ((visibility("default"))) +#else +#define JNIEXPORT +#endif + +#define JNICALL + +#endif /* !( _WIN32 || __WIN32__ || WIN32) */ + /* These defines apply to symbols in libgcj */ #ifdef __GCJ_DLL__ # ifdef __GCJ_JNI_IMPL__ @@ -135,14 +148,4 @@ typedef uint16_t jchar; # define _CLASSPATH_JNIIMPEXP #endif /* __GCJ_DLL__ */ -#else /* !( _WIN32 || __WIN32__ || WIN32) */ - -#define JNIIMPORT -#define JNIEXPORT -#define JNICALL -#define _CLASSPATH_JNIIMPEXP - -#endif /* !( _WIN32 || __WIN32__ || WIN32) */ - - #endif /* __GCJ_JNI_MD_H__ */ |