19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
26 #define SHARE_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
27
28 #include "jni.h"
29
30 // This file holds compiler-dependent includes,
31 // globally used constants & types, class (forward)
32 // declarations and a few frequently used utility functions.
33
34 #include <ctype.h>
35 #include <string.h>
36 #include <stdarg.h>
37 #include <stddef.h>
38 #include <stdio.h>
39 #include <stdlib.h>
40 #include <wchar.h>
41
42 #include <math.h>
43 #include <time.h>
44 #include <fcntl.h>
45 #include <dlfcn.h>
46 #include <pthread.h>
47
48 #include <limits.h>
49 #include <errno.h>
50
51 #if defined(LINUX) || defined(_ALLBSD_SOURCE)
52 #include <inttypes.h>
53 #include <signal.h>
54 #ifndef __OpenBSD__
55 #include <ucontext.h>
56 #endif
57 #ifdef __APPLE__
58 #include <AvailabilityMacros.h>
146 // gcc warns about applying offsetof() to non-POD object or calculating
147 // offset directly when base address is NULL. Use 16 to get around the
148 // warning. The -Wno-invalid-offsetof option could be used to suppress
149 // this warning, but we instead just avoid the use of offsetof().
150 #define offset_of(klass,field) (size_t)((intx)&(((klass*)16)->field) - 16)
151
152 #if defined(_LP64) && defined(__APPLE__)
153 #define JLONG_FORMAT "%ld"
154 #define JLONG_FORMAT_W(width) "%" #width "ld"
155 #endif // _LP64 && __APPLE__
156
157 #define THREAD_LOCAL __thread
158
159 // Inlining support
160 #define NOINLINE __attribute__ ((noinline))
161 #define ALWAYSINLINE inline __attribute__ ((always_inline))
162
163 // Alignment
164 //
165 #define ATTRIBUTE_ALIGNED(x) __attribute__((aligned(x)))
166
167 #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
26 #define SHARE_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
27
28 #include "jni.h"
29
30 // This file holds compiler-dependent includes,
31 // globally used constants & types, class (forward)
32 // declarations and a few frequently used utility functions.
33
34 #include <ctype.h>
35 #include <string.h>
36 #include <stdarg.h>
37 #include <stddef.h>
38 #include <stdio.h>
39 #include <stdint.h>
40 #include <stdlib.h>
41 #include <wchar.h>
42
43 #include <math.h>
44 #include <time.h>
45 #include <fcntl.h>
46 #include <dlfcn.h>
47 #include <pthread.h>
48
49 #include <limits.h>
50 #include <errno.h>
51
52 #if defined(LINUX) || defined(_ALLBSD_SOURCE)
53 #include <inttypes.h>
54 #include <signal.h>
55 #ifndef __OpenBSD__
56 #include <ucontext.h>
57 #endif
58 #ifdef __APPLE__
59 #include <AvailabilityMacros.h>
147 // gcc warns about applying offsetof() to non-POD object or calculating
148 // offset directly when base address is NULL. Use 16 to get around the
149 // warning. The -Wno-invalid-offsetof option could be used to suppress
150 // this warning, but we instead just avoid the use of offsetof().
151 #define offset_of(klass,field) (size_t)((intx)&(((klass*)16)->field) - 16)
152
153 #if defined(_LP64) && defined(__APPLE__)
154 #define JLONG_FORMAT "%ld"
155 #define JLONG_FORMAT_W(width) "%" #width "ld"
156 #endif // _LP64 && __APPLE__
157
158 #define THREAD_LOCAL __thread
159
160 // Inlining support
161 #define NOINLINE __attribute__ ((noinline))
162 #define ALWAYSINLINE inline __attribute__ ((always_inline))
163
164 // Alignment
165 //
166 #define ATTRIBUTE_ALIGNED(x) __attribute__((aligned(x)))
167
168 // Depreciation
169 #define DEPRECATED __attribute__ ((deprecated))
170
171 #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
|