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
This commit is contained in:
Benjamin Kosnik 2000-05-01 00:14:10 +00:00 committed by Benjamin Kosnik
parent 82c3a53ec9
commit 6dd4c3fd8f
3 changed files with 62 additions and 5 deletions

View File

@ -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.

View File

@ -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

View File

@ -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);