[Gmp-commit] /var/hg/gmp: Declare members of numeric_limits so they are prope...

mercurial at gmplib.org mercurial at gmplib.org
Sat Jun 23 01:07:39 CEST 2012


details:   /var/hg/gmp/rev/48b1b840fc8f
changeset: 15056:48b1b840fc8f
user:      Marc Glisse <marc.glisse at inria.fr>
date:      Sat Jun 23 01:07:33 2012 +0200
description:
Declare members of numeric_limits so they are properly emitted when their use is not inlined.

diffstat:

 ChangeLog       |   3 +++
 Makefile.am     |   2 +-
 cxx/Makefile.am |   2 +-
 cxx/limits.cc   |  51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 56 insertions(+), 2 deletions(-)

diffs (90 lines):

diff -r 81826c10a262 -r 48b1b840fc8f ChangeLog
--- a/ChangeLog	Sat Jun 23 00:17:36 2012 +0200
+++ b/ChangeLog	Sat Jun 23 01:07:33 2012 +0200
@@ -1,6 +1,9 @@
 2012-06-23  Marc Glisse  <marc.glisse at inria.fr>
 
 	* gmpxx.h (numeric_limits): Make content public.
+	(cxx/limits.cc): New file, proper declarations.
+	(Makefile.am): List new file.
+	(cxx/Makefile.am): Likewise.
 
 2012-06-09  Marc Glisse  <marc.glisse at inria.fr>
 
diff -r 81826c10a262 -r 48b1b840fc8f Makefile.am
--- a/Makefile.am	Sat Jun 23 00:17:36 2012 +0200
+++ b/Makefile.am	Sat Jun 23 01:07:33 2012 +0200
@@ -232,7 +232,7 @@
 # no $U for C++ files
 CXX_OBJECTS =								\
   cxx/isfuns.lo cxx/ismpf.lo cxx/ismpq.lo cxx/ismpz.lo cxx/ismpznw.lo	\
-  cxx/osdoprnti.lo cxx/osfuns.lo					\
+  cxx/limits.lo cxx/osdoprnti.lo cxx/osfuns.lo				\
   cxx/osmpf.lo cxx/osmpq.lo cxx/osmpz.lo
 
 # In libtool 1.5 it doesn't work to build libgmp.la from the convenience
diff -r 81826c10a262 -r 48b1b840fc8f cxx/Makefile.am
--- a/cxx/Makefile.am	Sat Jun 23 00:17:36 2012 +0200
+++ b/cxx/Makefile.am	Sat Jun 23 01:07:33 2012 +0200
@@ -25,5 +25,5 @@
 endif
 
 libcxx_la_SOURCES = \
-  isfuns.cc ismpf.cc ismpq.cc ismpz.cc ismpznw.cc \
+  isfuns.cc ismpf.cc ismpq.cc ismpz.cc ismpznw.cc limits.cc \
   osdoprnti.cc osfuns.cc osmpf.cc osmpq.cc osmpz.cc
diff -r 81826c10a262 -r 48b1b840fc8f cxx/limits.cc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cxx/limits.cc	Sat Jun 23 01:07:33 2012 +0200
@@ -0,0 +1,51 @@
+/* instantiation of numeric_limits specializations.
+
+Copyright 2012 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.  */
+
+#include "gmpxx.h"
+
+namespace std {
+#define GMPXX_INSTANTIATE_LIMITS(T) \
+  const bool numeric_limits<T>::is_specialized; \
+  const int  numeric_limits<T>::digits; \
+  const int  numeric_limits<T>::digits10; \
+  const int  numeric_limits<T>::max_digits10; \
+  const bool numeric_limits<T>::is_signed; \
+  const bool numeric_limits<T>::is_integer; \
+  const bool numeric_limits<T>::is_exact; \
+  const int  numeric_limits<T>::radix; \
+  const int  numeric_limits<T>::min_exponent; \
+  const int  numeric_limits<T>::min_exponent10; \
+  const int  numeric_limits<T>::max_exponent; \
+  const int  numeric_limits<T>::max_exponent10; \
+  const bool numeric_limits<T>::has_infinity; \
+  const bool numeric_limits<T>::has_quiet_NaN; \
+  const bool numeric_limits<T>::has_signaling_NaN; \
+  const float_denorm_style numeric_limits<T>::has_denorm; \
+  const bool numeric_limits<T>::has_denorm_loss; \
+  const bool numeric_limits<T>::is_iec559; \
+  const bool numeric_limits<T>::is_bounded; \
+  const bool numeric_limits<T>::is_modulo; \
+  const bool numeric_limits<T>::traps; \
+  const bool numeric_limits<T>::tinyness_before; \
+  const float_round_style numeric_limits<T>::round_style
+
+  GMPXX_INSTANTIATE_LIMITS(mpz_class);
+  GMPXX_INSTANTIATE_LIMITS(mpq_class);
+  GMPXX_INSTANTIATE_LIMITS(mpf_class);
+}


More information about the gmp-commit mailing list