224
225 // Wide characters
226
227 inline int wcslen(const jchar* x) { return wcslen((const wchar_t*)x); }
228
229
230 // Portability macros
231 #define PRAGMA_INTERFACE #pragma interface
232 #define PRAGMA_IMPLEMENTATION #pragma implementation
233 #define VALUE_OBJ_CLASS_SPEC
234
235 #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 95)
236 #define TEMPLATE_TABLE_BUG
237 #endif
238 #if (__GNUC__ == 2) && (__GNUC_MINOR__ >= 96)
239 #define CONST_SDM_BUG
240 #endif
241
242 // Formatting.
243 #ifdef _LP64
244 #define FORMAT64_MODIFIER "l"
245 #else // !_LP64
246 #define FORMAT64_MODIFIER "ll"
247 #endif // _LP64
248
249 // HACK: gcc warns about applying offsetof() to non-POD object or calculating
250 // offset directly when base address is NULL. Use 16 to get around the
251 // warning. gcc-3.4 has an option -Wno-invalid-offsetof to suppress
252 // this warning.
253 #define offset_of(klass,field) (size_t)((intx)&(((klass*)16)->field) - 16)
254
255 #ifdef offsetof
256 # undef offsetof
257 #endif
258 #define offsetof(klass,field) offset_of(klass,field)
259
260 #if defined(_LP64) && defined(__APPLE__)
261 #define JLONG_FORMAT "%ld"
262 #endif // _LP64 && __APPLE__
263
264 #ifndef USE_LIBRARY_BASED_TLS_ONLY
|
224
225 // Wide characters
226
227 inline int wcslen(const jchar* x) { return wcslen((const wchar_t*)x); }
228
229
230 // Portability macros
231 #define PRAGMA_INTERFACE #pragma interface
232 #define PRAGMA_IMPLEMENTATION #pragma implementation
233 #define VALUE_OBJ_CLASS_SPEC
234
235 #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 95)
236 #define TEMPLATE_TABLE_BUG
237 #endif
238 #if (__GNUC__ == 2) && (__GNUC_MINOR__ >= 96)
239 #define CONST_SDM_BUG
240 #endif
241
242 // Formatting.
243 #ifdef _LP64
244 # ifdef __APPLE__
245 # define FORMAT64_MODIFIER "ll"
246 # else
247 # define FORMAT64_MODIFIER "l"
248 # endif
249 #else // !_LP64
250 #define FORMAT64_MODIFIER "ll"
251 #endif // _LP64
252
253 // HACK: gcc warns about applying offsetof() to non-POD object or calculating
254 // offset directly when base address is NULL. Use 16 to get around the
255 // warning. gcc-3.4 has an option -Wno-invalid-offsetof to suppress
256 // this warning.
257 #define offset_of(klass,field) (size_t)((intx)&(((klass*)16)->field) - 16)
258
259 #ifdef offsetof
260 # undef offsetof
261 #endif
262 #define offsetof(klass,field) offset_of(klass,field)
263
264 #if defined(_LP64) && defined(__APPLE__)
265 #define JLONG_FORMAT "%ld"
266 #endif // _LP64 && __APPLE__
267
268 #ifndef USE_LIBRARY_BASED_TLS_ONLY
|