diff --git a/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h b/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h index 5085028c223..6391354a3c4 100644 --- a/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h +++ b/jdk/src/share/native/sun/java2d/loops/GraphicsPrimitiveMgr.h @@ -143,9 +143,9 @@ typedef struct _SurfaceType { * structure from the information present in a given Java Composite * object. */ -typedef JNIEXPORT void (JNICALL CompInfoFunc)(JNIEnv *env, - CompositeInfo *pCompInfo, - jobject Composite); +typedef void (JNICALL CompInfoFunc)(JNIEnv *env, + CompositeInfo *pCompInfo, + jobject Composite); /* * The additional information needed to implement a primitive that diff --git a/jdk/src/share/npt/npt.h b/jdk/src/share/npt/npt.h index c9cd9a3d209..4f2a5620da5 100644 --- a/jdk/src/share/npt/npt.h +++ b/jdk/src/share/npt/npt.h @@ -94,13 +94,13 @@ typedef struct { JNIEXPORT void JNICALL nptInitialize (NptEnv **pnpt, char *nptVersion, char *options); -typedef JNIEXPORT void (JNICALL *NptInitialize) - (NptEnv **pnpt, char *nptVersion, char *options); +typedef void (JNICALL *NptInitialize) + (NptEnv **pnpt, char *nptVersion, char *options); JNIEXPORT void JNICALL nptTerminate (NptEnv* npt, char *options); -typedef JNIEXPORT void (JNICALL *NptTerminate) - (NptEnv* npt, char *options); +typedef void (JNICALL *NptTerminate) + (NptEnv* npt, char *options); #ifdef __cplusplus } /* extern "C" */ diff --git a/jdk/src/solaris/javavm/export/jni_md.h b/jdk/src/solaris/javavm/export/jni_md.h index baab364c916..0f3d1ed8b0c 100644 --- a/jdk/src/solaris/javavm/export/jni_md.h +++ b/jdk/src/solaris/javavm/export/jni_md.h @@ -26,8 +26,17 @@ #ifndef _JAVASOFT_JNI_MD_H_ #define _JAVASOFT_JNI_MD_H_ -#define JNIEXPORT -#define JNIIMPORT +#ifndef __has_attribute + #define __has_attribute(x) 0 +#endif +#if (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2))) || __has_attribute(visibility) + #define JNIEXPORT __attribute__((visibility("default"))) + #define JNIIMPORT __attribute__((visibility("default"))) +#else + #define JNIEXPORT + #define JNIIMPORT +#endif + #define JNICALL typedef int jint; diff --git a/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c b/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c index cdb0e8f9d08..378db5850ab 100644 --- a/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c +++ b/jdk/src/solaris/native/sun/awt/awt_LoadLibrary.c @@ -43,7 +43,7 @@ static void *awtHandle = NULL; -typedef JNIEXPORT jint JNICALL JNI_OnLoad_type(JavaVM *vm, void *reserved); +typedef jint JNICALL JNI_OnLoad_type(JavaVM *vm, void *reserved); /* Initialize the Java VM instance variable when the library is first loaded */ @@ -206,7 +206,7 @@ Java_sun_awt_motif_XsessionWMcommand(JNIEnv *env, jobject this, jobject frame, jstring jcommand) { /* type of the old backdoor function */ - typedef JNIEXPORT void JNICALL + typedef void JNICALL XsessionWMcommand_type(JNIEnv *env, jobject this, jobject frame, jstring jcommand); @@ -234,7 +234,7 @@ Java_sun_awt_motif_XsessionWMcommand(JNIEnv *env, jobject this, JNIEXPORT void JNICALL Java_sun_awt_motif_XsessionWMcommand_New(JNIEnv *env, jobjectArray jargv) { - typedef JNIEXPORT void JNICALL + typedef void JNICALL XsessionWMcommand_New_type(JNIEnv *env, jobjectArray jargv); static XsessionWMcommand_New_type *XsessionWMcommand = NULL;