]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/config/os/hpux/os_defines.h
re PR target/47534 (avr libgcc.S fails to build)
[thirdparty/gcc.git] / libstdc++-v3 / config / os / hpux / os_defines.h
CommitLineData
0e20c0b5 1// Specific definitions for HPUX -*- C++ -*-
598730fe 2
04f08935 3// Copyright (C) 2000, 2002, 2004, 2005, 2008, 2009, 2010, 2011
d652f226 4// Free Software Foundation, Inc.
598730fe
JL
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
748086b7 9// Free Software Foundation; either version 3, or (at your option)
598730fe
JL
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
748086b7
JJ
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/>.
598730fe 25
f910786b 26/** @file bits/os_defines.h
143c27b0 27 * This is an internal header file, included by other library headers.
f910786b 28 * Do not attempt to use it directly. @headername{iosfwd}
143c27b0
BK
29 */
30
3d7c150e
BK
31#ifndef _GLIBCXX_OS_DEFINES
32#define _GLIBCXX_OS_DEFINES 1
598730fe 33
f295ecef
BK
34// System-specific #define, typedefs, corrections, etc, go here. This
35// file will come before all others.
598730fe 36
888d5eaa
JDA
37// Use macro form of ctype functions to ensure __SB_masks is defined.
38#define _SB_CTYPE_MACROS 1
39
4585ae3d
JL
40/* HP-UX, for reasons unknown choose to use a different name for
41 the string to [unsigned] long long conversion routines.
42
43 Furthermore, instead of having the prototypes in stdlib.h like
44 everyone else, they put them into a non-standard header
45 <inttypes.h>. Ugh.
46
47 <inttypes.h> defines a variety of things, some of which we
b6e22016 48 probably do not want. So we don't want to include it here.
4585ae3d 49
b6e22016
JL
50 Luckily we can just declare strtoll and strtoull with the
51 __asm extension which effectively renames calls at the
52 source level without namespace pollution.
53
54 Also note that the compiler defines _INCLUDE_LONGLONG for C++
55 unconditionally, which makes intmax_t and uintmax_t long long
56 types.
4585ae3d 57
3d7c150e 58 We also force _GLIBCXX_USE_LONG_LONG here so that we don't have
4585ae3d 59 to bastardize configure to deal with this sillyness. */
cb457156 60
04f08935 61namespace std
12ffa228 62{
cb457156
BK
63_GLIBCXX_BEGIN_EXTERN_C
64
ef290537 65#ifndef __LP64__
cb457156 66 __extension__ long long strtoll (const char *, char **, int)
d599b3fc 67 __asm ("__strtoll");
cb457156 68 __extension__ unsigned long long strtoull (const char *, char **, int)
d599b3fc 69 __asm ("__strtoull");
ef290537 70#else
cb457156 71 __extension__ long long strtoll (const char *, char **, int)
ef290537 72 __asm ("strtol");
cb457156 73 __extension__ unsigned long long strtoull (const char *, char **, int)
ef290537
SE
74 __asm ("strtoul");
75#endif
cb457156
BK
76
77_GLIBCXX_END_EXTERN_C
04f08935 78} // namespace std
0e20c0b5 79
3d7c150e 80#define _GLIBCXX_USE_LONG_LONG 1
0e20c0b5
JH
81
82// HPUX on IA64 requires vtable to be 64 bit aligned even at 32 bit
83// mode. We need to pad the vtable structure to achieve this.
84#if !defined(_LP64) && defined (__ia64__)
3d7c150e 85#define _GLIBCXX_VTABLE_PADDING 8
0e20c0b5
JH
86typedef long int __padding_type;
87#endif
88
ed0d100f
SE
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
7e2055ec
ZW
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. */
3d7c150e 100#define _GLIBCXX_GTHREAD_USE_WEAK 0
18efbe51
JDA
101
102// The strtold function is obsolete and not C99 conformant on PA HP-UX.
103// It returns plus or minus _LDBL_MAX instead of plus or minus HUGE_VALL
104// if the correct value would cause overflow. It doesn't handle "inf",
105// "infinity" and "nan". It is not thread safe.
106#if defined (__hppa__)
107#define _GLIBCXX_HAVE_BROKEN_STRTOLD 1
108#endif
4af6a063 109#endif