aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/config/os
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/config/os')
-rw-r--r--libstdc++-v3/config/os/aix/atomicity.h4
-rw-r--r--libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h72
-rw-r--r--libstdc++-v3/config/os/bsd/freebsd/os_defines.h7
-rw-r--r--libstdc++-v3/config/os/generic/ctype_inline.h142
-rw-r--r--libstdc++-v3/config/os/hpux/ctype_inline.h30
-rw-r--r--libstdc++-v3/config/os/hpux/ctype_noninline.h2
-rw-r--r--libstdc++-v3/config/os/hpux/os_defines.h12
7 files changed, 163 insertions, 106 deletions
diff --git a/libstdc++-v3/config/os/aix/atomicity.h b/libstdc++-v3/config/os/aix/atomicity.h
index ecac7dac225..af4fa5a808c 100644
--- a/libstdc++-v3/config/os/aix/atomicity.h
+++ b/libstdc++-v3/config/os/aix/atomicity.h
@@ -43,14 +43,14 @@ typedef int _Atomic_word;
#include <sys/atomic_op.h>
static inline int
-__attribute__ ((unused))
+__attribute__ ((__unused__))
__exchange_and_add (atomic_p __mem, int __val)
{
return fetch_and_add (__mem, __val);
}
static inline void
-__attribute__ ((unused))
+__attribute__ ((__unused__))
__atomic_add (atomic_p __mem, int __val)
{
(void) fetch_and_add (__mem, __val);
diff --git a/libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h b/libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h
index b4ba03f30f5..d69324ad572 100644
--- a/libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h
+++ b/libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h
@@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -38,35 +38,42 @@
ctype<char>::
is(mask __m, char __c) const
{
- return __istype(__c, __m);
+ if (_M_table)
+ return _M_table[static_cast<unsigned char>(__c)] & __m;
+ else
+ return __istype(__c, __m);
}
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
- for (;__low < __high; ++__vec, ++__low)
- {
+ if (_M_table)
+ while (__low < __high)
+ *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
+ else
+ for (;__low < __high; ++__vec, ++__low)
+ {
#if defined (_CTYPE_S) || defined (__istype)
- *__vec = __maskrune (*__low, upper | lower | alpha | digit | xdigit
- | space | print | graph | cntrl | punct | alnum);
+ *__vec = __maskrune (*__low, upper | lower | alpha | digit | xdigit
+ | space | print | graph | cntrl | punct | alnum);
#else
- mask __m = 0;
- if (this->is(upper, *__low)) __m |= upper;
- if (this->is(lower, *__low)) __m |= lower;
- if (this->is(alpha, *__low)) __m |= alpha;
- if (this->is(digit, *__low)) __m |= digit;
- if (this->is(xdigit, *__low)) __m |= xdigit;
- if (this->is(space, *__low)) __m |= space;
- if (this->is(print, *__low)) __m |= print;
- if (this->is(graph, *__low)) __m |= graph;
- if (this->is(cntrl, *__low)) __m |= cntrl;
- if (this->is(punct, *__low)) __m |= punct;
- // Do not include explicit line for alnum mask since it is a
- // pure composite of masks on FreeBSD.
- *__vec = __m;
+ mask __m = 0;
+ if (this->is(upper, *__low)) __m |= upper;
+ if (this->is(lower, *__low)) __m |= lower;
+ if (this->is(alpha, *__low)) __m |= alpha;
+ if (this->is(digit, *__low)) __m |= digit;
+ if (this->is(xdigit, *__low)) __m |= xdigit;
+ if (this->is(space, *__low)) __m |= space;
+ if (this->is(print, *__low)) __m |= print;
+ if (this->is(graph, *__low)) __m |= graph;
+ if (this->is(cntrl, *__low)) __m |= cntrl;
+ if (this->is(punct, *__low)) __m |= punct;
+ // Do not include explicit line for alnum mask since it is a
+ // pure composite of masks on FreeBSD.
+ *__vec = __m;
#endif
- }
+ }
return __high;
}
@@ -74,8 +81,13 @@
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
- while (__low < __high && !this->is(__m, *__low))
- ++__low;
+ if (_M_table)
+ while (__low < __high
+ && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
+ ++__low;
+ else
+ while (__low < __high && !this->is(__m, *__low))
+ ++__low;
return __low;
}
@@ -83,12 +95,12 @@
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
- while (__low < __high && this->is(__m, *__low) != 0)
- ++__low;
+ if (_M_table)
+ while (__low < __high
+ && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
+ ++__low;
+ else
+ while (__low < __high && this->is(__m, *__low) != 0)
+ ++__low;
return __low;
}
-
-
-
-
-
diff --git a/libstdc++-v3/config/os/bsd/freebsd/os_defines.h b/libstdc++-v3/config/os/bsd/freebsd/os_defines.h
index b898c1ce252..55040a7ac4b 100644
--- a/libstdc++-v3/config/os/bsd/freebsd/os_defines.h
+++ b/libstdc++-v3/config/os/bsd/freebsd/os_defines.h
@@ -34,4 +34,11 @@
// System-specific #define, typedefs, corrections, etc, go here. This
// file will come before all others.
+#define _GLIBCPP_USE_C99_CHECK 1
+#define _GLIBCPP_USE_C99_DYNAMIC (!(__ISO_C_VISIBLE >= 1999))
+#define _GLIBCPP_USE_C99_LONG_LONG_CHECK 1
+#define _GLIBCPP_USE_C99_LONG_LONG_DYNAMIC (_GLIBCPP_USE_C99_DYNAMIC || !defined __LONG_LONG_SUPPORTED)
+#define _GLIBCPP_USE_C99_FLOAT_TRANSCENDENTALS_CHECK 1
+#define _GLIBCPP_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC defined _XOPEN_SOURCE
+
#endif
diff --git a/libstdc++-v3/config/os/generic/ctype_inline.h b/libstdc++-v3/config/os/generic/ctype_inline.h
index c10cb565b76..be43c47fd0a 100644
--- a/libstdc++-v3/config/os/generic/ctype_inline.h
+++ b/libstdc++-v3/config/os/generic/ctype_inline.h
@@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -39,69 +39,95 @@
// functionality should be added for the native os in question: see
// the config/os/bits/ctype_*.h files.
+// Constructing a synthetic "C" table should be seriously considered...
+
bool
ctype<char>::
is(mask __m, char __c) const
{
- bool __ret;
- switch (__m)
+ if (_M_table)
+ return _M_table[static_cast<unsigned char>(__c)] & __m;
+ else
{
- case space:
- __ret = isspace(__c);
- break;
- case print:
- __ret = isprint(__c);
- break;
- case cntrl:
- __ret = iscntrl(__c);
- break;
- case upper:
- __ret = isupper(__c);
- break;
- case lower:
- __ret = islower(__c);
- break;
- case alpha:
- __ret = isalpha(__c);
- break;
- case digit:
- __ret = isdigit(__c);
- break;
- case punct:
- __ret = ispunct(__c);
- break;
- case xdigit:
- __ret = isxdigit(__c);
- break;
- case alnum:
- __ret = isalnum(__c);
- break;
- case graph:
- __ret = isgraph(__c);
- break;
- default:
- __ret = false;
- break;
+ bool __ret = true;
+ const int __bitmasksize = 11;
+ int __bitcur = 0; // Lowest bitmask in ctype_base == 0
+ for (;__ret && __bitcur < __bitmasksize; ++__bitcur)
+ {
+ mask __bit = static_cast<mask>(1 << __bitcur);
+ if (__m & __bit)
+ {
+ bool __testis;
+ switch (__bit)
+ {
+ case space:
+ __testis = isspace(__c);
+ break;
+ case print:
+ __testis = isprint(__c);
+ break;
+ case cntrl:
+ __testis = iscntrl(__c);
+ break;
+ case upper:
+ __testis = isupper(__c);
+ break;
+ case lower:
+ __testis = islower(__c);
+ break;
+ case alpha:
+ __testis = isalpha(__c);
+ break;
+ case digit:
+ __testis = isdigit(__c);
+ break;
+ case punct:
+ __testis = ispunct(__c);
+ break;
+ case xdigit:
+ __testis = isxdigit(__c);
+ break;
+ case alnum:
+ __testis = isalnum(__c);
+ break;
+ case graph:
+ __testis = isgraph(__c);
+ break;
+ default:
+ __testis = false;
+ break;
+ }
+ __ret &= __testis;
+ }
+ }
+ return __ret;
}
- return __ret;
}
const char*
ctype<char>::
is(const char* __low, const char* __high, mask* __vec) const
{
- const int __bitmasksize = 11; // Highest bitmask in ctype_base == 10
- for (;__low < __high; ++__vec, ++__low)
+ if (_M_table)
+ while (__low < __high)
+ *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
+ else
{
- mask __m = 0;
- int __i = 0; // Lowest bitmask in ctype_base == 0
- for (;__i < __bitmasksize; ++__i)
+ // Highest bitmask in ctype_base == 10.
+ const int __bitmasksize = 11;
+ for (;__low < __high; ++__vec, ++__low)
{
- mask __bit = static_cast<mask>(1 << __i);
- if (this->is(__bit, *__low))
- __m |= __bit;
+ mask __m = 0;
+ // Lowest bitmask in ctype_base == 0
+ int __i = 0;
+ for (;__i < __bitmasksize; ++__i)
+ {
+ mask __bit = static_cast<mask>(1 << __i);
+ if (this->is(__bit, *__low))
+ __m |= __bit;
+ }
+ *__vec = __m;
}
- *__vec = __m;
}
return __high;
}
@@ -110,8 +136,13 @@
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
- while (__low < __high && !this->is(__m, *__low))
- ++__low;
+ if (_M_table)
+ while (__low < __high
+ && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
+ ++__low;
+ else
+ while (__low < __high && !this->is(__m, *__low))
+ ++__low;
return __low;
}
@@ -119,7 +150,12 @@
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
- while (__low < __high && this->is(__m, *__low) != 0)
- ++__low;
+ if (_M_table)
+ while (__low < __high
+ && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
+ ++__low;
+ else
+ while (__low < __high && this->is(__m, *__low) != 0)
+ ++__low;
return __low;
}
diff --git a/libstdc++-v3/config/os/hpux/ctype_inline.h b/libstdc++-v3/config/os/hpux/ctype_inline.h
index 35cc3063d4c..af409c87629 100644
--- a/libstdc++-v3/config/os/hpux/ctype_inline.h
+++ b/libstdc++-v3/config/os/hpux/ctype_inline.h
@@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -36,22 +36,15 @@
bool
ctype<char>::
- is(mask __m, char __c) const
- { return _M_table[(unsigned char)(__c)] & __m; }
+ is(mask __m, char __c) const
+ { return _M_table[static_cast<unsigned char>(__c)] & __m; }
const char*
ctype<char>::
- is(const char* __low, const char* __high, mask* __vec) const
+ is(const char* __low, const char* __high, mask* __vec) const
{
- const int __bitmasksize = 11; // Highest bitmask in ctype_base == 10
- for (;__low < __high; ++__vec, ++__low)
- {
- mask __m = _M_table[*__low];
- int __i = 0; // Lowest bitmask in ctype_base == 0
- while (__i < __bitmasksize && !(__m & static_cast<mask>(1 << __i)))
- ++__i;
- *__vec = static_cast<mask>(1 << __i);
- }
+ while (__low < __high)
+ *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
return __high;
}
@@ -59,7 +52,8 @@
ctype<char>::
scan_is(mask __m, const char* __low, const char* __high) const
{
- while (__low < __high && !this->is(__m, *__low))
+ while (__low < __high
+ && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
++__low;
return __low;
}
@@ -68,12 +62,8 @@
ctype<char>::
scan_not(mask __m, const char* __low, const char* __high) const
{
- while (__low < __high && this->is(__m, *__low) != 0)
+ while (__low < __high
+ && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
++__low;
return __low;
}
-
-
-
-
-
diff --git a/libstdc++-v3/config/os/hpux/ctype_noninline.h b/libstdc++-v3/config/os/hpux/ctype_noninline.h
index 7ec3b30ed9c..a85bc9cff82 100644
--- a/libstdc++-v3/config/os/hpux/ctype_noninline.h
+++ b/libstdc++-v3/config/os/hpux/ctype_noninline.h
@@ -36,7 +36,7 @@
const ctype_base::mask*
ctype<char>::classic_table() throw()
- { return 0; }
+ { return __SB_masks; }
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
diff --git a/libstdc++-v3/config/os/hpux/os_defines.h b/libstdc++-v3/config/os/hpux/os_defines.h
index 9dd4fb41af6..27951c199cb 100644
--- a/libstdc++-v3/config/os/hpux/os_defines.h
+++ b/libstdc++-v3/config/os/hpux/os_defines.h
@@ -84,9 +84,21 @@ namespace std
typedef long int __padding_type;
#endif
+// GCC on IA64 HP-UX uses the HP-UX system unwind library,
+// it does not have the _Unwind_Resume_or_Rethrow entry point
+// because that is not part of the standard IA64 Unwind ABI.
+#if defined (__ia64__)
+#define _LIBUNWIND_STD_ABI 1
+#endif
+
/* We need explicit instantiation of the atomicity lock on HPPA if
there is no weak support. */
#if !defined(_GLIBCPP_SUPPORTS_WEAK) && defined (__hppa__)
#define _GLIBCPP_INST_ATOMICITY_LOCK 1
#endif
+
+/* Don't use pragma weak in gthread headers. */
+#ifdef __hppa__
+#define _GLIBCPP_GTHREAD_USE_WEAK 0
+#endif
#endif