diff options
author | Benjamin Kosnik <bkoz@gnu.org> | 2000-05-01 00:14:10 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2000-05-01 00:14:10 +0000 |
commit | 6dd4c3fd8f38e69b0ca3cb3f692ea85c8535224a (patch) | |
tree | 040d96945a8132668b68d16390e8e799bcbf3df0 | |
parent | 82c3a53ec9b06b9bce83135f6afc27c1e54d0e7d (diff) | |
download | gcc-6dd4c3fd8f38e69b0ca3cb3f692ea85c8535224a.zip gcc-6dd4c3fd8f38e69b0ca3cb3f692ea85c8535224a.tar.gz gcc-6dd4c3fd8f38e69b0ca3cb3f692ea85c8535224a.tar.bz2 |
mknumeric_limits (trait_name): Fix copyright notice.
2000-04-30 Benjamin Kosnik <bkoz@gnu.org>
* mknumeric_limits (trait_name): Fix copyright notice.
* src/gen-num-limits.cc: Explicitly instantiate epsilon and
round_error data members of struct value. This works around
weak-linking issues on AIX, HPUX.
From-SVN: r33558
-rw-r--r-- | libstdc++-v3/ChangeLog | 7 | ||||
-rwxr-xr-x | libstdc++-v3/mknumeric_limits | 2 | ||||
-rw-r--r-- | libstdc++-v3/src/gen-num-limits.cc | 58 |
3 files changed, 62 insertions, 5 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7c903fa..226e2ef 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2000-04-30 Benjamin Kosnik <bkoz@gnu.org> + + * mknumeric_limits (trait_name): Fix copyright notice. + * src/gen-num-limits.cc: Explicitly instantiate epsilon and + round_error data members of struct value. This works around + weak-linking issues on AIX, HPUX. + 2000-04-29 Phil Edwards <pme@sourceware.cygnus.com> * docs/download.html: Add link to list of mirror sites. diff --git a/libstdc++-v3/mknumeric_limits b/libstdc++-v3/mknumeric_limits index 89e7a61..3f52211 100755 --- a/libstdc++-v3/mknumeric_limits +++ b/libstdc++-v3/mknumeric_limits @@ -189,7 +189,7 @@ trait_name=numeric_limits cat <<EOF > $OUT_C // Static data members of -*- C++ -*- numeric_limits classes -// Copyright (C) 1999 Cygnus Solutions +// Copyright (C) 1999, 2000 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 diff --git a/libstdc++-v3/src/gen-num-limits.cc b/libstdc++-v3/src/gen-num-limits.cc index 8dd3a16..f9ecbac 100644 --- a/libstdc++-v3/src/gen-num-limits.cc +++ b/libstdc++-v3/src/gen-num-limits.cc @@ -342,7 +342,7 @@ template<typename T> const int value<T>::digits = bits_per_byte * sizeof(T) - int(predicate<T>::is_signed); -// Non integer types should specialize this. Alwyas two for +// Non integer types should specialize this. Always two for // integer types. template<typename T> const int value<T>::radix = 2; @@ -366,16 +366,38 @@ SPECIALIZE_RADIX(long double, FLT_RADIX); #undef SPECIALIZE_RADIX +// Non integer types should specialize this. +// Unfortunately, systems that don't deal with weak linking correctly +// (Ie, hpux and aix), cannot use this sophisticated yet sane method. So, +// explicitly instantiate all the data members here so that they will +// be happy. +// sophisticated, sane method +#if 0 template<typename T> const char value<T>::epsilon[] = "0"; - -template<typename T> -const char value<T>::round_error[] = "0"; +#endif #define SPECIALIZE_EPSILON(T, E) DO_SPECIALIZE_EPSILON(T, E) #define DO_SPECIALIZE_EPSILON(T, E) const char value< T >::epsilon[] = #E +// unsophisticated, gross method +#if 1 +SPECIALIZE_EPSILON(bool, 0); +SPECIALIZE_EPSILON(char, 0); +SPECIALIZE_EPSILON(unsigned char, 0); +SPECIALIZE_EPSILON(signed char, 0); +SPECIALIZE_EPSILON(wchar_t, 0); +SPECIALIZE_EPSILON(short, 0); +SPECIALIZE_EPSILON(unsigned short, 0); +SPECIALIZE_EPSILON(int, 0); +SPECIALIZE_EPSILON(unsigned int, 0); +SPECIALIZE_EPSILON(long, 0); +SPECIALIZE_EPSILON(unsigned long, 0); +SPECIALIZE_EPSILON(long long, 0); +SPECIALIZE_EPSILON(unsigned long long, 0); +#endif + SPECIALIZE_EPSILON(float, FLT_EPSILON); SPECIALIZE_EPSILON(double, DBL_EPSILON); SPECIALIZE_EPSILON(long double, LDBL_EPSILON); @@ -384,7 +406,35 @@ SPECIALIZE_EPSILON(long double, LDBL_EPSILON); #undef SPECIALIZE_EPSILON +// Non integer types should specialize this. +// Unfortunately, systems that don't deal with weak linking correctly +// (Ie, hpux and aix), cannot use this sophisticated yet sane method. So, +// explicitly instantiate all the data members here so that they will +// be happy. + +// sophisticated, sane method +#if 0 +template<typename T> +const char value<T>::round_error[] = "0"; +#endif + #define SPECIALIZE_ROUND_ERROR(T, R) const char value< T >::round_error[] = #R +// unsophisticated, gross method +#if 1 +SPECIALIZE_ROUND_ERROR(bool, 0); +SPECIALIZE_ROUND_ERROR(char, 0); +SPECIALIZE_ROUND_ERROR(unsigned char, 0); +SPECIALIZE_ROUND_ERROR(signed char, 0); +SPECIALIZE_ROUND_ERROR(wchar_t, 0); +SPECIALIZE_ROUND_ERROR(short, 0); +SPECIALIZE_ROUND_ERROR(unsigned short, 0); +SPECIALIZE_ROUND_ERROR(int, 0); +SPECIALIZE_ROUND_ERROR(unsigned int, 0); +SPECIALIZE_ROUND_ERROR(long, 0); +SPECIALIZE_ROUND_ERROR(unsigned long, 0); +SPECIALIZE_ROUND_ERROR(long long, 0); +SPECIALIZE_ROUND_ERROR(unsigned long long, 0); +#endif SPECIALIZE_ROUND_ERROR(float, 1.0f); SPECIALIZE_ROUND_ERROR(double, 1.0); |