]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/config/os/hpux/os_defines.h
PR libstdc++/36104 part four
[thirdparty/gcc.git] / libstdc++-v3 / config / os / hpux / os_defines.h
1 // Specific definitions for HPUX -*- C++ -*-
2
3 // Copyright (C) 2000, 2002, 2004, 2005, 2008, 2009, 2010
4 // Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
10 // any later version.
11
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16
17 // Under Section 7 of GPL version 3, you are granted additional
18 // permissions described in the GCC Runtime Library Exception, version
19 // 3.1, as published by the Free Software Foundation.
20
21 // You should have received a copy of the GNU General Public License and
22 // a copy of the GCC Runtime Library Exception along with this program;
23 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 // <http://www.gnu.org/licenses/>.
25
26 /** @file bits/os_defines.h
27 * This is an internal header file, included by other library headers.
28 * Do not attempt to use it directly. @headername{iosfwd}
29 */
30
31 #ifndef _GLIBCXX_OS_DEFINES
32 #define _GLIBCXX_OS_DEFINES 1
33
34 // System-specific #define, typedefs, corrections, etc, go here. This
35 // file will come before all others.
36
37 // Use macro form of ctype functions to ensure __SB_masks is defined.
38 #define _SB_CTYPE_MACROS 1
39
40 // This would be defaulted in the main c++config header if we didn't
41 // define it here, but it has to be defined before we can use the
42 // namespace macros, so we have to define it to nothing here instead.
43 #define _GLIBCXX_PSEUDO_VISIBILITY(V)
44
45 /* HP-UX, for reasons unknown choose to use a different name for
46 the string to [unsigned] long long conversion routines.
47
48 Furthermore, instead of having the prototypes in stdlib.h like
49 everyone else, they put them into a non-standard header
50 <inttypes.h>. Ugh.
51
52 <inttypes.h> defines a variety of things, some of which we
53 probably do not want. So we don't want to include it here.
54
55 Luckily we can just declare strtoll and strtoull with the
56 __asm extension which effectively renames calls at the
57 source level without namespace pollution.
58
59 Also note that the compiler defines _INCLUDE_LONGLONG for C++
60 unconditionally, which makes intmax_t and uintmax_t long long
61 types.
62
63 We also force _GLIBCXX_USE_LONG_LONG here so that we don't have
64 to bastardize configure to deal with this sillyness. */
65
66 namespace std _GLIBCXX_VISIBILITY(default)
67 {
68 _GLIBCXX_BEGIN_NAMESPACE_VERSION
69 _GLIBCXX_BEGIN_EXTERN_C
70
71 #ifndef __LP64__
72 __extension__ long long strtoll (const char *, char **, int)
73 __asm ("__strtoll");
74 __extension__ unsigned long long strtoull (const char *, char **, int)
75 __asm ("__strtoull");
76 #else
77 __extension__ long long strtoll (const char *, char **, int)
78 __asm ("strtol");
79 __extension__ unsigned long long strtoull (const char *, char **, int)
80 __asm ("strtoul");
81 #endif
82
83 _GLIBCXX_END_EXTERN_C
84 _GLIBCXX_END_NAMESPACE_VERSION
85 } // namespace
86
87 #define _GLIBCXX_USE_LONG_LONG 1
88
89 // HPUX on IA64 requires vtable to be 64 bit aligned even at 32 bit
90 // mode. We need to pad the vtable structure to achieve this.
91 #if !defined(_LP64) && defined (__ia64__)
92 #define _GLIBCXX_VTABLE_PADDING 8
93 typedef long int __padding_type;
94 #endif
95
96 // GCC on IA64 HP-UX uses the HP-UX system unwind library,
97 // it does not have the _Unwind_Resume_or_Rethrow entry point
98 // because that is not part of the standard IA64 Unwind ABI.
99 #if defined (__ia64__)
100 #define _LIBUNWIND_STD_ABI 1
101 #endif
102
103 /* Don't use pragma weak in gthread headers. HP-UX rejects programs
104 with unsatisfied external references even if all of those references
105 are weak; gthread relies on such unsatisfied references being resolved
106 to null pointers when weak symbol support is on. */
107 #define _GLIBCXX_GTHREAD_USE_WEAK 0
108
109 // The strtold function is obsolete and not C99 conformant on PA HP-UX.
110 // It returns plus or minus _LDBL_MAX instead of plus or minus HUGE_VALL
111 // if the correct value would cause overflow. It doesn't handle "inf",
112 // "infinity" and "nan". It is not thread safe.
113 #if defined (__hppa__)
114 #define _GLIBCXX_HAVE_BROKEN_STRTOLD 1
115 #endif
116 #endif