hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
changeset 10565 dc90c239f4ec
parent 9124 f60dee480d49
child 11881 9642744ae9a5
equal deleted inserted replaced
10564:db5bf5438c0a 10565:dc90c239f4ec
    74 
    74 
    75 # ifdef SOLARIS_MUTATOR_LIBTHREAD
    75 # ifdef SOLARIS_MUTATOR_LIBTHREAD
    76 # include <sys/procfs.h>
    76 # include <sys/procfs.h>
    77 # endif
    77 # endif
    78 
    78 
    79 #ifdef LINUX
    79 #if defined(LINUX) || defined(_ALLBSD_SOURCE)
    80 #ifndef __STDC_LIMIT_MACROS
    80 #ifndef __STDC_LIMIT_MACROS
    81 #define __STDC_LIMIT_MACROS
    81 #define __STDC_LIMIT_MACROS
    82 #endif // __STDC_LIMIT_MACROS
    82 #endif // __STDC_LIMIT_MACROS
    83 #include <inttypes.h>
    83 #include <inttypes.h>
    84 #include <signal.h>
    84 #include <signal.h>
       
    85 #ifndef __OpenBSD__
    85 #include <ucontext.h>
    86 #include <ucontext.h>
       
    87 #endif
       
    88 #ifdef __APPLE__
       
    89   #include <AvailabilityMacros.h>
       
    90   #if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4)
       
    91     // Mac OS X 10.4 defines EFL_AC and EFL_ID,
       
    92     // which conflict with hotspot variable names.
       
    93     //
       
    94     // This has been fixed in Mac OS X 10.5.
       
    95     #undef EFL_AC
       
    96     #undef EFL_ID
       
    97   #endif
       
    98 #endif
    86 #include <sys/time.h>
    99 #include <sys/time.h>
    87 #endif // LINUX
   100 #endif // LINUX || _ALLBSD_SOURCE
    88 
   101 
    89 // 4810578: varargs unsafe on 32-bit integer/64-bit pointer architectures
   102 // 4810578: varargs unsafe on 32-bit integer/64-bit pointer architectures
    90 // When __cplusplus is defined, NULL is defined as 0 (32-bit constant) in
   103 // When __cplusplus is defined, NULL is defined as 0 (32-bit constant) in
    91 // system header files.  On 32-bit architectures, there is no problem.
   104 // system header files.  On 32-bit architectures, there is no problem.
    92 // On 64-bit architectures, defining NULL as a 32-bit constant can cause
   105 // On 64-bit architectures, defining NULL as a 32-bit constant can cause
   118 // On Linux NULL is defined as a special type '__null'. Assigning __null to
   131 // On Linux NULL is defined as a special type '__null'. Assigning __null to
   119 // integer variable will cause gcc warning. Use NULL_WORD in places where a
   132 // integer variable will cause gcc warning. Use NULL_WORD in places where a
   120 // pointer is stored as integer value.  On some platforms, sizeof(intptr_t) >
   133 // pointer is stored as integer value.  On some platforms, sizeof(intptr_t) >
   121 // sizeof(void*), so here we want something which is integer type, but has the
   134 // sizeof(void*), so here we want something which is integer type, but has the
   122 // same size as a pointer.
   135 // same size as a pointer.
   123 #ifdef LINUX
   136 #ifdef __GNUC__
   124   #ifdef _LP64
   137   #ifdef _LP64
   125     #define NULL_WORD  0L
   138     #define NULL_WORD  0L
   126   #else
   139   #else
   127     // Cast 0 to intptr_t rather than int32_t since they are not the same type
   140     // Cast 0 to intptr_t rather than int32_t since they are not the same type
   128     // on platforms such as Mac OS X.
   141     // on platforms such as Mac OS X.
   130   #endif
   143   #endif
   131 #else
   144 #else
   132   #define NULL_WORD  NULL
   145   #define NULL_WORD  NULL
   133 #endif
   146 #endif
   134 
   147 
   135 #ifndef LINUX
   148 #if !defined(LINUX) && !defined(_ALLBSD_SOURCE)
   136 // Compiler-specific primitive types
   149 // Compiler-specific primitive types
   137 typedef unsigned short     uint16_t;
   150 typedef unsigned short     uint16_t;
   138 #ifndef _UINT32_T
   151 #ifndef _UINT32_T
   139 #define _UINT32_T
   152 #define _UINT32_T
   140 typedef unsigned int       uint32_t;
   153 typedef unsigned int       uint32_t;
   150 typedef unsigned int            uintptr_t;
   163 typedef unsigned int            uintptr_t;
   151 // If this gets an error, figure out a symbol XXX that implies the
   164 // If this gets an error, figure out a symbol XXX that implies the
   152 // prior definition of intptr_t, and add "&& !defined(XXX)" above.
   165 // prior definition of intptr_t, and add "&& !defined(XXX)" above.
   153 #endif // _SYS_INT_TYPES_H
   166 #endif // _SYS_INT_TYPES_H
   154 
   167 
   155 #endif // !LINUX
   168 #endif // !LINUX && !_ALLBSD_SOURCE
   156 
   169 
   157 // Additional Java basic types
   170 // Additional Java basic types
   158 
   171 
   159 typedef uint8_t  jubyte;
   172 typedef uint8_t  jubyte;
   160 typedef uint16_t jushort;
   173 typedef uint16_t jushort;
   242 #else
   255 #else
   243 // isnanf() broken on Intel Solaris use isnand()
   256 // isnanf() broken on Intel Solaris use isnand()
   244 inline int g_isnan(float  f) { return isnand(f); }
   257 inline int g_isnan(float  f) { return isnand(f); }
   245 #endif
   258 #endif
   246 inline int g_isnan(double f) { return isnand(f); }
   259 inline int g_isnan(double f) { return isnand(f); }
   247 #elif LINUX
   260 #elif defined(__APPLE__)
       
   261 inline int g_isnan(double f) { return isnan(f); }
       
   262 #elif defined(LINUX) || defined(_ALLBSD_SOURCE)
   248 inline int g_isnan(float  f) { return isnanf(f); }
   263 inline int g_isnan(float  f) { return isnanf(f); }
   249 inline int g_isnan(double f) { return isnan(f); }
   264 inline int g_isnan(double f) { return isnan(f); }
   250 #else
   265 #else
   251 #error "missing platform-specific definition here"
   266 #error "missing platform-specific definition here"
   252 #endif
   267 #endif