]>
Commit | Line | Data |
---|---|---|
daae7908 | 1 | // Specific definitions for HPUX -*- C++ -*- |
0c531dff | 2 | |
fbd26352 | 3 | // Copyright (C) 2000-2019 Free Software Foundation, Inc. |
0c531dff | 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 | |
6bc9506f | 8 | // Free Software Foundation; either version 3, or (at your option) |
0c531dff | 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 | ||
6bc9506f | 16 | // Under Section 7 of GPL version 3, you are granted additional |
17 | // permissions described in the GCC Runtime Library Exception, version | |
18 | // 3.1, as published by the Free Software Foundation. | |
19 | ||
20 | // You should have received a copy of the GNU General Public License and | |
21 | // a copy of the GCC Runtime Library Exception along with this program; | |
22 | // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
23 | // <http://www.gnu.org/licenses/>. | |
0c531dff | 24 | |
5846aeac | 25 | /** @file bits/os_defines.h |
944beac5 | 26 | * This is an internal header file, included by other library headers. |
5846aeac | 27 | * Do not attempt to use it directly. @headername{iosfwd} |
944beac5 | 28 | */ |
29 | ||
5a64d8cf | 30 | #ifndef _GLIBCXX_OS_DEFINES |
31 | #define _GLIBCXX_OS_DEFINES 1 | |
0c531dff | 32 | |
0f91ab4c | 33 | // System-specific #define, typedefs, corrections, etc, go here. This |
34 | // file will come before all others. | |
0c531dff | 35 | |
20f14ecb | 36 | // Use macro form of ctype functions to ensure __SB_masks is defined. |
37 | #define _SB_CTYPE_MACROS 1 | |
38 | ||
5506172a | 39 | /* HP-UX, for reasons unknown choose to use a different name for |
40 | the string to [unsigned] long long conversion routines. | |
41 | ||
42 | Furthermore, instead of having the prototypes in stdlib.h like | |
43 | everyone else, they put them into a non-standard header | |
44 | <inttypes.h>. Ugh. | |
45 | ||
33b7ef52 | 46 | <inttypes.h> defines a variety of things, some of which we |
049fd827 | 47 | probably do not want. So we don't want to include it here. |
5506172a | 48 | |
049fd827 | 49 | Luckily we can just declare strtoll and strtoull with the |
50 | __asm extension which effectively renames calls at the | |
51 | source level without namespace pollution. | |
52 | ||
53 | Also note that the compiler defines _INCLUDE_LONGLONG for C++ | |
54 | unconditionally, which makes intmax_t and uintmax_t long long | |
55 | types. | |
5506172a | 56 | |
5a64d8cf | 57 | We also force _GLIBCXX_USE_LONG_LONG here so that we don't have |
5506172a | 58 | to bastardize configure to deal with this sillyness. */ |
f84a9c5c | 59 | |
8163364f | 60 | #ifdef __cplusplus |
20f2a9d2 | 61 | namespace std |
2948dd21 | 62 | { |
33b7ef52 | 63 | extern "C" |
8163364f | 64 | { |
db887247 | 65 | #ifndef __LP64__ |
f84a9c5c | 66 | __extension__ long long strtoll (const char *, char **, int) |
64dd4b43 | 67 | __asm ("__strtoll"); |
f84a9c5c | 68 | __extension__ unsigned long long strtoull (const char *, char **, int) |
64dd4b43 | 69 | __asm ("__strtoull"); |
db887247 | 70 | #else |
f84a9c5c | 71 | __extension__ long long strtoll (const char *, char **, int) |
db887247 | 72 | __asm ("strtol"); |
f84a9c5c | 73 | __extension__ unsigned long long strtoull (const char *, char **, int) |
db887247 | 74 | __asm ("strtoul"); |
75 | #endif | |
8163364f | 76 | } |
20f2a9d2 | 77 | } // namespace std |
8163364f | 78 | #endif // __cplusplus |
daae7908 | 79 | |
5a64d8cf | 80 | #define _GLIBCXX_USE_LONG_LONG 1 |
daae7908 | 81 | |
82 | // HPUX on IA64 requires vtable to be 64 bit aligned even at 32 bit | |
33b7ef52 | 83 | // mode. We need to pad the vtable structure to achieve this. |
daae7908 | 84 | #if !defined(_LP64) && defined (__ia64__) |
5a64d8cf | 85 | #define _GLIBCXX_VTABLE_PADDING 8 |
daae7908 | 86 | typedef long int __padding_type; |
87 | #endif | |
88 | ||
1ed853da | 89 | // GCC on IA64 HP-UX uses the HP-UX system unwind library, |
90 | // it does not have the _Unwind_Resume_or_Rethrow entry point | |
91 | // because that is not part of the standard IA64 Unwind ABI. | |
92 | #if defined (__ia64__) | |
93 | #define _LIBUNWIND_STD_ABI 1 | |
94 | #endif | |
95 | ||
120a2fed | 96 | /* Don't use pragma weak in gthread headers. HP-UX rejects programs |
97 | with unsatisfied external references even if all of those references | |
98 | are weak; gthread relies on such unsatisfied references being resolved | |
99 | to null pointers when weak symbol support is on. */ | |
5a64d8cf | 100 | #define _GLIBCXX_GTHREAD_USE_WEAK 0 |
53974ec6 | 101 | |
f7e5bfa6 | 102 | // No support for referencing weak symbols without a definition. |
103 | #define _GLIBCXX_USE_WEAK_REF 0 | |
104 | ||
53974ec6 | 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", | |
33b7ef52 | 108 | // "infinity" and "nan". It is not thread safe. |
53974ec6 | 109 | #if defined (__hppa__) |
110 | #define _GLIBCXX_HAVE_BROKEN_STRTOLD 1 | |
111 | #endif | |
45fc02af | 112 | #endif |