diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-28 19:35:25 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-28 19:35:25 +0000 |
commit | 9367bf92771e3648b7517449f24a044bda45acef (patch) | |
tree | cd2487f380163aa8e77de5603d31de41e737e555 /libjava/include | |
parent | aa331421fc0b383c1c031dfc3bb7cf5c4e993cd7 (diff) | |
download | gcc-9367bf92771e3648b7517449f24a044bda45acef.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126090 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/include')
-rw-r--r-- | libjava/include/jni_md.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/libjava/include/jni_md.h b/libjava/include/jni_md.h index 6ea90ab4c36..f806bac5179 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__ */ |