diff --git a/classpath/jni-util.h b/classpath/jni-util.h index 00778c85cd..4cd0363c8a 100644 --- a/classpath/jni-util.h +++ b/classpath/jni-util.h @@ -5,8 +5,12 @@ #ifdef __MINGW32__ # define JNIEXPORT __declspec(dllexport) #else +#ifdef __APPLE__ +# define JNIEXPORT __attribute__ ((used)) +#else # define JNIEXPORT __attribute__ ((visibility("default"))) #endif +#endif namespace { diff --git a/src/common.h b/src/common.h index b2fc8d6181..92ec87084b 100644 --- a/src/common.h +++ b/src/common.h @@ -15,7 +15,7 @@ # define JNIEXPORT __declspec(dllexport) #else #ifdef __APPLE__ -# define JNIEXPORT __attribute__ ((visibility("used"))) +# define JNIEXPORT __attribute__ ((used)) #else # define JNIEXPORT __attribute__ ((visibility("default"))) #endif