8009729: Refix hotspot jni_<cpu>.h JNIEXPORT and JNIIMPORT definitions to match jdk version

Update JNIEXPORT and JNIIMPORT to work with other compilers that don't necessarily have the __attribute__ type qualifier

Reviewed-by: dholmes, dcubed, coleenp
This commit is contained in:
Eric McCorkle 2013-05-07 13:45:59 -04:00
parent edf88d3db7
commit 32fa61ad54
3 changed files with 20 additions and 3 deletions

View File

@ -23,7 +23,12 @@
* questions. * 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 JNIEXPORT __attribute__((visibility("default")))
#define JNIIMPORT __attribute__((visibility("default"))) #define JNIIMPORT __attribute__((visibility("default")))
#else #else

View File

@ -28,7 +28,13 @@
#if defined(SOLARIS) || defined(LINUX) || defined(_ALLBSD_SOURCE) #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 JNIEXPORT __attribute__((visibility("default")))
#define JNIIMPORT __attribute__((visibility("default"))) #define JNIIMPORT __attribute__((visibility("default")))
#else #else

View File

@ -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 JNIEXPORT __attribute__((visibility("default")))
#define JNIIMPORT __attribute__((visibility("default"))) #define JNIIMPORT __attribute__((visibility("default")))
#else #else