1117397Skan// Specific definitions for HPUX -*- C++ -*- 2117397Skan 3169691Skan// Copyright (C) 2000, 2002, 2004, 2005 Free Software Foundation, Inc. 4117397Skan// 5117397Skan// This file is part of the GNU ISO C++ Library. This library is free 6117397Skan// software; you can redistribute it and/or modify it under the 7117397Skan// terms of the GNU General Public License as published by the 8117397Skan// Free Software Foundation; either version 2, or (at your option) 9117397Skan// any later version. 10117397Skan 11117397Skan// This library is distributed in the hope that it will be useful, 12117397Skan// but WITHOUT ANY WARRANTY; without even the implied warranty of 13117397Skan// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14117397Skan// GNU General Public License for more details. 15117397Skan 16117397Skan// You should have received a copy of the GNU General Public License along 17117397Skan// with this library; see the file COPYING. If not, write to the Free 18169691Skan// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 19117397Skan// USA. 20117397Skan 21117397Skan// As a special exception, you may use this file as part of a free software 22117397Skan// library without restriction. Specifically, if other files instantiate 23117397Skan// templates or use macros or inline functions from this file, or you compile 24117397Skan// this file and link it with other files to produce an executable, this 25117397Skan// file does not by itself cause the resulting executable to be covered by 26117397Skan// the GNU General Public License. This exception does not however 27117397Skan// invalidate any other reasons why the executable file might be covered by 28117397Skan// the GNU General Public License. 29117397Skan 30169691Skan/** @file os_defines.h 31169691Skan * This is an internal header file, included by other library headers. 32169691Skan * You should not attempt to use it directly. 33169691Skan */ 34169691Skan 35132720Skan#ifndef _GLIBCXX_OS_DEFINES 36132720Skan#define _GLIBCXX_OS_DEFINES 1 37117397Skan 38117397Skan// System-specific #define, typedefs, corrections, etc, go here. This 39117397Skan// file will come before all others. 40117397Skan 41117397Skan// Use macro form of ctype functions to ensure __SB_masks is defined. 42117397Skan#define _SB_CTYPE_MACROS 1 43117397Skan 44117397Skan/* HP-UX, for reasons unknown choose to use a different name for 45117397Skan the string to [unsigned] long long conversion routines. 46117397Skan 47117397Skan Furthermore, instead of having the prototypes in stdlib.h like 48117397Skan everyone else, they put them into a non-standard header 49117397Skan <inttypes.h>. Ugh. 50117397Skan 51117397Skan <inttypes.h> defines a variety of things, some of which we 52117397Skan probably do not want. So we don't want to include it here. 53117397Skan 54117397Skan Luckily we can just declare strtoll and strtoull with the 55117397Skan __asm extension which effectively renames calls at the 56117397Skan source level without namespace pollution. 57117397Skan 58117397Skan Also note that the compiler defines _INCLUDE_LONGLONG for C++ 59117397Skan unconditionally, which makes intmax_t and uintmax_t long long 60117397Skan types. 61117397Skan 62132720Skan We also force _GLIBCXX_USE_LONG_LONG here so that we don't have 63117397Skan to bastardize configure to deal with this sillyness. */ 64117397Skannamespace std 65117397Skan{ 66117397Skan#ifndef __LP64__ 67117397Skan __extension__ extern "C" long long strtoll (const char *, char **, int) 68117397Skan __asm ("__strtoll"); 69117397Skan __extension__ extern "C" unsigned long long strtoull (const char *, char **, int) 70117397Skan __asm ("__strtoull"); 71117397Skan#else 72117397Skan __extension__ extern "C" long long strtoll (const char *, char **, int) 73117397Skan __asm ("strtol"); 74117397Skan __extension__ extern "C" unsigned long long strtoull (const char *, char **, int) 75117397Skan __asm ("strtoul"); 76117397Skan#endif 77117397Skan} 78117397Skan 79132720Skan#define _GLIBCXX_USE_LONG_LONG 1 80117397Skan 81117397Skan// HPUX on IA64 requires vtable to be 64 bit aligned even at 32 bit 82117397Skan// mode. We need to pad the vtable structure to achieve this. 83117397Skan#if !defined(_LP64) && defined (__ia64__) 84132720Skan#define _GLIBCXX_VTABLE_PADDING 8 85117397Skantypedef long int __padding_type; 86117397Skan#endif 87117397Skan 88117397Skan// GCC on IA64 HP-UX uses the HP-UX system unwind library, 89117397Skan// it does not have the _Unwind_Resume_or_Rethrow entry point 90117397Skan// because that is not part of the standard IA64 Unwind ABI. 91117397Skan#if defined (__ia64__) 92117397Skan#define _LIBUNWIND_STD_ABI 1 93117397Skan#endif 94117397Skan 95122182Skan/* Don't use pragma weak in gthread headers. HP-UX rejects programs 96122182Skan with unsatisfied external references even if all of those references 97122182Skan are weak; gthread relies on such unsatisfied references being resolved 98122182Skan to null pointers when weak symbol support is on. */ 99132720Skan#define _GLIBCXX_GTHREAD_USE_WEAK 0 100117397Skan#endif 101