]>
Commit | Line | Data |
---|---|---|
0e20c0b5 | 1 | // Specific definitions for HPUX -*- C++ -*- |
598730fe | 2 | |
cb457156 | 3 | // Copyright (C) 2000, 2002, 2004, 2005, 2008 Free Software Foundation, Inc. |
598730fe JL |
4 | // |
5 | // This file is part of the GNU ISO C++ Library. This library is free | |
6 | // software; you can redistribute it and/or modify it under the | |
7 | // terms of the GNU General Public License as published by the | |
8 | // Free Software Foundation; either version 2, or (at your option) | |
9 | // any later version. | |
10 | ||
11 | // This library is distributed in the hope that it will be useful, | |
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | // GNU General Public License for more details. | |
15 | ||
16 | // You should have received a copy of the GNU General Public License along | |
17 | // with this library; see the file COPYING. If not, write to the Free | |
83f51799 | 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
598730fe JL |
19 | // USA. |
20 | ||
21 | // As a special exception, you may use this file as part of a free software | |
22 | // library without restriction. Specifically, if other files instantiate | |
23 | // templates or use macros or inline functions from this file, or you compile | |
24 | // this file and link it with other files to produce an executable, this | |
25 | // file does not by itself cause the resulting executable to be covered by | |
26 | // the GNU General Public License. This exception does not however | |
27 | // invalidate any other reasons why the executable file might be covered by | |
28 | // the GNU General Public License. | |
29 | ||
143c27b0 BK |
30 | /** @file os_defines.h |
31 | * This is an internal header file, included by other library headers. | |
32 | * You should not attempt to use it directly. | |
33 | */ | |
34 | ||
3d7c150e BK |
35 | #ifndef _GLIBCXX_OS_DEFINES |
36 | #define _GLIBCXX_OS_DEFINES 1 | |
598730fe | 37 | |
f295ecef BK |
38 | // System-specific #define, typedefs, corrections, etc, go here. This |
39 | // file will come before all others. | |
598730fe | 40 | |
888d5eaa JDA |
41 | // Use macro form of ctype functions to ensure __SB_masks is defined. |
42 | #define _SB_CTYPE_MACROS 1 | |
43 | ||
4585ae3d JL |
44 | /* HP-UX, for reasons unknown choose to use a different name for |
45 | the string to [unsigned] long long conversion routines. | |
46 | ||
47 | Furthermore, instead of having the prototypes in stdlib.h like | |
48 | everyone else, they put them into a non-standard header | |
49 | <inttypes.h>. Ugh. | |
50 | ||
51 | <inttypes.h> defines a variety of things, some of which we | |
b6e22016 | 52 | probably do not want. So we don't want to include it here. |
4585ae3d | 53 | |
b6e22016 JL |
54 | Luckily we can just declare strtoll and strtoull with the |
55 | __asm extension which effectively renames calls at the | |
56 | source level without namespace pollution. | |
57 | ||
58 | Also note that the compiler defines _INCLUDE_LONGLONG for C++ | |
59 | unconditionally, which makes intmax_t and uintmax_t long long | |
60 | types. | |
4585ae3d | 61 | |
3d7c150e | 62 | We also force _GLIBCXX_USE_LONG_LONG here so that we don't have |
4585ae3d | 63 | to bastardize configure to deal with this sillyness. */ |
cb457156 BK |
64 | |
65 | _GLIBCXX_BEGIN_NAMESPACE(std) | |
66 | _GLIBCXX_BEGIN_EXTERN_C | |
67 | ||
ef290537 | 68 | #ifndef __LP64__ |
cb457156 | 69 | __extension__ long long strtoll (const char *, char **, int) |
d599b3fc | 70 | __asm ("__strtoll"); |
cb457156 | 71 | __extension__ unsigned long long strtoull (const char *, char **, int) |
d599b3fc | 72 | __asm ("__strtoull"); |
ef290537 | 73 | #else |
cb457156 | 74 | __extension__ long long strtoll (const char *, char **, int) |
ef290537 | 75 | __asm ("strtol"); |
cb457156 | 76 | __extension__ unsigned long long strtoull (const char *, char **, int) |
ef290537 SE |
77 | __asm ("strtoul"); |
78 | #endif | |
cb457156 BK |
79 | |
80 | _GLIBCXX_END_EXTERN_C | |
81 | _GLIBCXX_END_NAMESPACE | |
0e20c0b5 | 82 | |
3d7c150e | 83 | #define _GLIBCXX_USE_LONG_LONG 1 |
0e20c0b5 JH |
84 | |
85 | // HPUX on IA64 requires vtable to be 64 bit aligned even at 32 bit | |
86 | // mode. We need to pad the vtable structure to achieve this. | |
87 | #if !defined(_LP64) && defined (__ia64__) | |
3d7c150e | 88 | #define _GLIBCXX_VTABLE_PADDING 8 |
0e20c0b5 JH |
89 | typedef long int __padding_type; |
90 | #endif | |
91 | ||
ed0d100f SE |
92 | // GCC on IA64 HP-UX uses the HP-UX system unwind library, |
93 | // it does not have the _Unwind_Resume_or_Rethrow entry point | |
94 | // because that is not part of the standard IA64 Unwind ABI. | |
95 | #if defined (__ia64__) | |
96 | #define _LIBUNWIND_STD_ABI 1 | |
97 | #endif | |
98 | ||
7e2055ec ZW |
99 | /* Don't use pragma weak in gthread headers. HP-UX rejects programs |
100 | with unsatisfied external references even if all of those references | |
101 | are weak; gthread relies on such unsatisfied references being resolved | |
102 | to null pointers when weak symbol support is on. */ | |
3d7c150e | 103 | #define _GLIBCXX_GTHREAD_USE_WEAK 0 |
18efbe51 JDA |
104 | |
105 | // The strtold function is obsolete and not C99 conformant on PA HP-UX. | |
106 | // It returns plus or minus _LDBL_MAX instead of plus or minus HUGE_VALL | |
107 | // if the correct value would cause overflow. It doesn't handle "inf", | |
108 | // "infinity" and "nan". It is not thread safe. | |
109 | #if defined (__hppa__) | |
110 | #define _GLIBCXX_HAVE_BROKEN_STRTOLD 1 | |
111 | #endif | |
4af6a063 | 112 | #endif |