Commit 6dd4c3fd by Benjamin Kosnik Committed by Benjamin Kosnik

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
parent 82c3a53e
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> 2000-04-29 Phil Edwards <pme@sourceware.cygnus.com>
* docs/download.html: Add link to list of mirror sites. * docs/download.html: Add link to list of mirror sites.
......
...@@ -189,7 +189,7 @@ trait_name=numeric_limits ...@@ -189,7 +189,7 @@ trait_name=numeric_limits
cat <<EOF > $OUT_C cat <<EOF > $OUT_C
// Static data members of -*- C++ -*- numeric_limits classes // 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 // 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 // software; you can redistribute it and/or modify it under the
......
...@@ -342,7 +342,7 @@ template<typename T> ...@@ -342,7 +342,7 @@ template<typename T>
const int value<T>::digits = const int value<T>::digits =
bits_per_byte * sizeof(T) - int(predicate<T>::is_signed); 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. // integer types.
template<typename T> template<typename T>
const int value<T>::radix = 2; const int value<T>::radix = 2;
...@@ -366,16 +366,38 @@ SPECIALIZE_RADIX(long double, FLT_RADIX); ...@@ -366,16 +366,38 @@ SPECIALIZE_RADIX(long double, FLT_RADIX);
#undef SPECIALIZE_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> template<typename T>
const char value<T>::epsilon[] = "0"; const char value<T>::epsilon[] = "0";
#endif
template<typename T>
const char value<T>::round_error[] = "0";
#define SPECIALIZE_EPSILON(T, E) DO_SPECIALIZE_EPSILON(T, E) #define SPECIALIZE_EPSILON(T, E) DO_SPECIALIZE_EPSILON(T, E)
#define DO_SPECIALIZE_EPSILON(T, E) const char value< T >::epsilon[] = #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(float, FLT_EPSILON);
SPECIALIZE_EPSILON(double, DBL_EPSILON); SPECIALIZE_EPSILON(double, DBL_EPSILON);
SPECIALIZE_EPSILON(long double, LDBL_EPSILON); SPECIALIZE_EPSILON(long double, LDBL_EPSILON);
...@@ -384,7 +406,35 @@ SPECIALIZE_EPSILON(long double, LDBL_EPSILON); ...@@ -384,7 +406,35 @@ SPECIALIZE_EPSILON(long double, LDBL_EPSILON);
#undef SPECIALIZE_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 #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(float, 1.0f);
SPECIALIZE_ROUND_ERROR(double, 1.0); SPECIALIZE_ROUND_ERROR(double, 1.0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment