# HG changeset patch # User emc # Date 1367948759 14400 # Node ID 58bb870a0cbd4cf6bd3b22d64c8cd74a956ea5a9 # Parent f6a055fcf47da36523b98b555b41e59d305f9ca7 8009729: Refix hotspot jni_.h JNIEXPORT and JNIIMPORT definitions to match jdk version Summary: Update JNIEXPORT and JNIIMPORT to work with other compilers that don't necessarily have the __attribute__ type qualifier Reviewed-by: dholmes, dcubed, coleenp diff -r f6a055fcf47d -r 58bb870a0cbd src/cpu/sparc/vm/jni_sparc.h --- a/src/cpu/sparc/vm/jni_sparc.h Tue May 07 14:33:09 2013 +0200 +++ b/src/cpu/sparc/vm/jni_sparc.h Tue May 07 13:45:59 2013 -0400 @@ -23,7 +23,12 @@ * questions. */ -#if defined(__GNUC__) && (__GNUC__ >= 4) +// Note: please do not change these without also changing jni_md.h in the JDK +// repository +#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 diff -r f6a055fcf47d -r 58bb870a0cbd src/cpu/x86/vm/jni_x86.h --- a/src/cpu/x86/vm/jni_x86.h Tue May 07 14:33:09 2013 +0200 +++ b/src/cpu/x86/vm/jni_x86.h Tue May 07 13:45:59 2013 -0400 @@ -28,7 +28,13 @@ #if defined(SOLARIS) || defined(LINUX) || defined(_ALLBSD_SOURCE) -#if defined(__GNUC__) && (__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2) + +// Note: please do not change these without also changing jni_md.h in the JDK +// repository +#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 diff -r f6a055fcf47d -r 58bb870a0cbd src/cpu/zero/vm/jni_zero.h --- a/src/cpu/zero/vm/jni_zero.h Tue May 07 14:33:09 2013 +0200 +++ b/src/cpu/zero/vm/jni_zero.h Tue May 07 13:45:59 2013 -0400 @@ -25,7 +25,13 @@ */ -#if defined(__GNUC__) && (__GNUC__ >= 4) + +// Note: please do not change these without also changing jni_md.h in the JDK +// repository +#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