309 #define FORMAT64_MODIFIER "l" 310 #else // !_LP64 311 #define FORMAT64_MODIFIER "ll" 312 #endif // _LP64 313 314 // HACK: gcc warns about applying offsetof() to non-POD object or calculating 315 // offset directly when base address is NULL. Use 16 to get around the 316 // warning. gcc-3.4 has an option -Wno-invalid-offsetof to suppress 317 // this warning. 318 #define offset_of(klass,field) (size_t)((intx)&(((klass*)16)->field) - 16) 319 320 #ifdef offsetof 321 # undef offsetof 322 #endif 323 #define offsetof(klass,field) offset_of(klass,field) 324 325 #if defined(_LP64) && defined(__APPLE__) 326 #define JLONG_FORMAT "%ld" 327 #endif // _LP64 && __APPLE__ 328 329 #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_GCC_HPP | 309 #define FORMAT64_MODIFIER "l" 310 #else // !_LP64 311 #define FORMAT64_MODIFIER "ll" 312 #endif // _LP64 313 314 // HACK: gcc warns about applying offsetof() to non-POD object or calculating 315 // offset directly when base address is NULL. Use 16 to get around the 316 // warning. gcc-3.4 has an option -Wno-invalid-offsetof to suppress 317 // this warning. 318 #define offset_of(klass,field) (size_t)((intx)&(((klass*)16)->field) - 16) 319 320 #ifdef offsetof 321 # undef offsetof 322 #endif 323 #define offsetof(klass,field) offset_of(klass,field) 324 325 #if defined(_LP64) && defined(__APPLE__) 326 #define JLONG_FORMAT "%ld" 327 #endif // _LP64 && __APPLE__ 328 329 #define THREAD_LOCAL_DECL __thread 330 331 #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_GCC_HPP |