1 /*
2 * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
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 // This file holds compiler-dependent includes,
26 // globally used constants & types, class (forward)
27 // declarations and a few frequently used utility functions.
28
29 #include <ctype.h>
30 #include <string.h>
31 #include <stdarg.h>
32 #include <stddef.h>
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include <wchar.h>
36
37 #ifdef SOLARIS
38 #include <ieeefp.h>
39 #endif // SOLARIS
40
41 #include <math.h>
42 #ifndef FP_PZERO
43 // Linux doesn't have positive/negative zero
44 #define FP_PZERO FP_ZERO
272 #define CONST_SDM_BUG
273 #endif
274
275 // Formatting.
276 #ifdef _LP64
277 #define FORMAT64_MODIFIER "l"
278 #else // !_LP64
279 #define FORMAT64_MODIFIER "ll"
280 #endif // _LP64
281
282 // HACK: gcc warns about applying offsetof() to non-POD object or calculating
283 // offset directly when base address is NULL. Use 16 to get around the
284 // warning. gcc-3.4 has an option -Wno-invalid-offsetof to suppress
285 // this warning.
286 #define offset_of(klass,field) (size_t)((intx)&(((klass*)16)->field) - 16)
287
288 #ifdef offsetof
289 # undef offsetof
290 #endif
291 #define offsetof(klass,field) offset_of(klass,field)
|
1 /*
2 * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
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_VM_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
26 #define SHARE_VM_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
27
28 #include "prims/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 #ifdef SOLARIS
43 #include <ieeefp.h>
44 #endif // SOLARIS
45
46 #include <math.h>
47 #ifndef FP_PZERO
48 // Linux doesn't have positive/negative zero
49 #define FP_PZERO FP_ZERO
277 #define CONST_SDM_BUG
278 #endif
279
280 // Formatting.
281 #ifdef _LP64
282 #define FORMAT64_MODIFIER "l"
283 #else // !_LP64
284 #define FORMAT64_MODIFIER "ll"
285 #endif // _LP64
286
287 // HACK: gcc warns about applying offsetof() to non-POD object or calculating
288 // offset directly when base address is NULL. Use 16 to get around the
289 // warning. gcc-3.4 has an option -Wno-invalid-offsetof to suppress
290 // this warning.
291 #define offset_of(klass,field) (size_t)((intx)&(((klass*)16)->field) - 16)
292
293 #ifdef offsetof
294 # undef offsetof
295 #endif
296 #define offsetof(klass,field) offset_of(klass,field)
297
298 #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_GCC_HPP
|