From 9f3c078ea9fa32e0e1819225c89a1c97b89d5b5f Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Mon, 13 Aug 2001 22:26:11 +0000 Subject: [PATCH] configure.in (LIMITS_INC_SRCDIR): New variable. * configure.in (LIMITS_INC_SRCDIR): New variable. * configure.target (LIMITSH): New variable. * porting.texi: Discuss numeric limits. * config/cpu/generic/bits/limits.h: New file. * config/cpu/i386/bits/limits.h: New file. * include/Makefile.am: Install bits/limits.h. * include/bits/c++config: Include bits/limits.h. From-SVN: r44877 --- libstdc++-v3/ChangeLog | 10 +++++ libstdc++-v3/Makefile.in | 1 + libstdc++-v3/config/cpu/generic/bits/limits.h | 40 +++++++++++++++++++ libstdc++-v3/config/cpu/i386/bits/limits.h | 33 +++++++++++++++ libstdc++-v3/configure | 11 +++-- libstdc++-v3/configure.in | 2 + libstdc++-v3/configure.target | 13 ++++++ libstdc++-v3/include/Makefile.am | 5 ++- libstdc++-v3/include/Makefile.in | 3 +- libstdc++-v3/include/bits/c++config | 2 + libstdc++-v3/intl/Makefile.in | 1 + libstdc++-v3/libio/Makefile.in | 1 + libstdc++-v3/libmath/Makefile.in | 1 + libstdc++-v3/libsupc++/Makefile.in | 1 + libstdc++-v3/po/Makefile.in | 1 + libstdc++-v3/porting.texi | 26 ++++++++++++ libstdc++-v3/src/Makefile.in | 1 + libstdc++-v3/testsuite/Makefile.in | 1 + 18 files changed, 146 insertions(+), 7 deletions(-) create mode 100644 libstdc++-v3/config/cpu/generic/bits/limits.h create mode 100644 libstdc++-v3/config/cpu/i386/bits/limits.h diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 437ecf686f2d..e6b532cbe756 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,13 @@ +2001-08-13 Mark Mitchell + + * configure.in (LIMITS_INC_SRCDIR): New variable. + * configure.target (LIMITSH): New variable. + * porting.texi: Discuss numeric limits. + * config/cpu/generic/bits/limits.h: New file. + * config/cpu/i386/bits/limits.h: New file. + * include/Makefile.am: Install bits/limits.h. + * include/bits/c++config: Include bits/limits.h. + 2001-08-13 H.J. Lu (hjl@gnu.org) * testsuite/lib/libstdc++-v3-dg.exp (libstdc++-v3-copy-files): diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in index 152173de00f6..4525bd43d71a 100644 --- a/libstdc++-v3/Makefile.in +++ b/libstdc++-v3/Makefile.in @@ -105,6 +105,7 @@ LIBMATH_INCLUDES = @LIBMATH_INCLUDES@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@ LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@ LIBTOOL = @LIBTOOL@ +LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ diff --git a/libstdc++-v3/config/cpu/generic/bits/limits.h b/libstdc++-v3/config/cpu/generic/bits/limits.h new file mode 100644 index 000000000000..8fa5a82145f6 --- /dev/null +++ b/libstdc++-v3/config/cpu/generic/bits/limits.h @@ -0,0 +1,40 @@ +// Copyright (C) 2001 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 +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This 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 General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +#ifndef _GLIBCPP_CPU_LIMITS +#define _GLIBCPP_CPU_LIMITS 1 + +// Nothing is defined in the generic file. In that way, we fall back +// on the defaults in std_limits.h. + +// If you need to override these defaults, you can either use a +// CPU-specific version (in which case you must modify +// configure.target) or you must add the overrides to your +// os_defines.h. In general, if all systems for your CPU use the +// same values, it is best to use a cpu-specific configuration file. + +#endif diff --git a/libstdc++-v3/config/cpu/i386/bits/limits.h b/libstdc++-v3/config/cpu/i386/bits/limits.h new file mode 100644 index 000000000000..be304e2d8055 --- /dev/null +++ b/libstdc++-v3/config/cpu/i386/bits/limits.h @@ -0,0 +1,33 @@ +// Copyright (C) 2001 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 +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This 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 General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +#ifndef _GLIBCPP_CPU_LIMITS +#define _GLIBCPP_CPU_LIMITS 1 + +#define __glibcpp_long_double_bits 80 + +#endif diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 0d5aa0632675..d3196168b1b5 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -19156,6 +19156,8 @@ fi # Propagate the target-specific source directories through the build chain. OS_INC_SRCDIR=$os_include_dir/bits ATOMICITY_INC_SRCDIR=$ATOMICITYH/bits +LIMITS_INC_SRCDIR=$LIMITSH/bits + @@ -19237,13 +19239,13 @@ glibcpp_toolexeclibdir=no glibcpp_prefixdir=${prefix} echo $ac_n "checking for interface version number""... $ac_c" 1>&6 -echo "configure:19241: checking for interface version number" >&5 +echo "configure:19243: checking for interface version number" >&5 libstdcxx_interface=$INTERFACE echo "$ac_t""$libstdcxx_interface" 1>&6 # Process the option --with-gxx-include-dir= echo $ac_n "checking for --with-gxx-include-dir""... $ac_c" 1>&6 -echo "configure:19247: checking for --with-gxx-include-dir" >&5 +echo "configure:19249: checking for --with-gxx-include-dir" >&5 # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given. if test "${with_gxx_include_dir+set}" = set; then withval="$with_gxx_include_dir" @@ -19267,7 +19269,7 @@ echo "$ac_t""$gxx_include_dir" 1>&6 # Process the option "--enable-version-specific-runtime-libs" echo $ac_n "checking for --enable-version-specific-runtime-libs""... $ac_c" 1>&6 -echo "configure:19271: checking for --enable-version-specific-runtime-libs" >&5 +echo "configure:19273: checking for --enable-version-specific-runtime-libs" >&5 # Check whether --enable-version-specific-runtime-libs or --disable-version-specific-runtime-libs was given. if test "${enable_version_specific_runtime_libs+set}" = set; then enableval="$enable_version_specific_runtime_libs" @@ -19308,7 +19310,7 @@ if test x"$glibcpp_toolexecdir" = x"no"; then fi echo $ac_n "checking for install location""... $ac_c" 1>&6 -echo "configure:19312: checking for install location" >&5 +echo "configure:19314: checking for install location" >&5 echo "$ac_t""$gxx_include_dir" 1>&6 @@ -19603,6 +19605,7 @@ s%@USE_COMPLEX_LONG_DOUBLE@%$USE_COMPLEX_LONG_DOUBLE%g s%@WERROR@%$WERROR%g s%@OS_INC_SRCDIR@%$OS_INC_SRCDIR%g s%@ATOMICITY_INC_SRCDIR@%$ATOMICITY_INC_SRCDIR%g +s%@LIMITS_INC_SRCDIR@%$LIMITS_INC_SRCDIR%g s%@GLIBCPP_IS_CROSS_COMPILING@%$GLIBCPP_IS_CROSS_COMPILING%g s%@CANADIAN_TRUE@%$CANADIAN_TRUE%g s%@CANADIAN_FALSE@%$CANADIAN_FALSE%g diff --git a/libstdc++-v3/configure.in b/libstdc++-v3/configure.in index 8a2b5364d1fd..99d013ab8a26 100644 --- a/libstdc++-v3/configure.in +++ b/libstdc++-v3/configure.in @@ -204,8 +204,10 @@ fi # Propagate the target-specific source directories through the build chain. OS_INC_SRCDIR=$os_include_dir/bits ATOMICITY_INC_SRCDIR=$ATOMICITYH/bits +LIMITS_INC_SRCDIR=$LIMITSH/bits AC_SUBST(OS_INC_SRCDIR) AC_SUBST(ATOMICITY_INC_SRCDIR) +AC_SUBST(LIMITS_INC_SRCDIR) # Set up cross-compile flags AC_SUBST(GLIBCPP_IS_CROSS_COMPILING) diff --git a/libstdc++-v3/configure.target b/libstdc++-v3/configure.target index 5e619d039f5d..4cacb4f26d1d 100644 --- a/libstdc++-v3/configure.target +++ b/libstdc++-v3/configure.target @@ -122,3 +122,16 @@ case "${target}" in ATOMICITYH=$cpu_include_dir ;; esac + +# Set LIMITSH to the directory where the configuration-dependent +# limits.h can be found. +# THIS TABLE IS SORTED. KEEP IT THAT WAY. + +case "${target}" in + i?86-*-*) + LIMITSH=config/cpu/i386 + ;; + *) + LIMITSH=config/cpu/generic + ;; +esac diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index f5ceb08190e6..baf3b0a61c3b 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -21,7 +21,7 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA. -## $Id: Makefile.am,v 1.3 2001/08/10 15:47:21 gdr Exp $ +## $Id: Makefile.am,v 1.4 2001/08/10 20:44:53 ljrittle Exp $ AUTOMAKE_OPTIONS = 1.3 gnits MAINT_CHARSET = latin1 @@ -285,7 +285,8 @@ target_headers = \ ${target_srcdir}/ctype_inline.h \ ${target_srcdir}/ctype_noninline.h \ ${target_srcdir}/os_defines.h \ - ${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h + ${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h \ + ${glibcpp_srcdir}/@LIMITS_INC_SRCDIR@/limits.h thread_builddir = ./${target_alias}/bits thread_headers = \ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index b010d072199e..3a374cf5fa47 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -104,6 +104,7 @@ LIBMATH_INCLUDES = @LIBMATH_INCLUDES@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@ LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@ LIBTOOL = @LIBTOOL@ +LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ @@ -180,7 +181,7 @@ std_headers = ${std_srcdir}/algorithm ${std_srcdir}/bitset ${std_srcdir}/com target_srcdir = ${glibcpp_srcdir}/@OS_INC_SRCDIR@ target_builddir = ./${target_alias}/bits -target_headers = ${target_srcdir}/ctype_base.h ${target_srcdir}/ctype_inline.h ${target_srcdir}/ctype_noninline.h ${target_srcdir}/os_defines.h ${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h +target_headers = ${target_srcdir}/ctype_base.h ${target_srcdir}/ctype_inline.h ${target_srcdir}/ctype_noninline.h ${target_srcdir}/os_defines.h ${glibcpp_srcdir}/@ATOMICITY_INC_SRCDIR@/atomicity.h ${glibcpp_srcdir}/@LIMITS_INC_SRCDIR@/limits.h thread_builddir = ./${target_alias}/bits diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 3fa61fe66377..42ce59705aad 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -32,6 +32,8 @@ // Pick up any OS-specific definitions. #include +// And any CPU-specific definitions. +#include // The current version of the C++ library in compressed ISO date format. #define __GLIBCPP__ 20010813 diff --git a/libstdc++-v3/intl/Makefile.in b/libstdc++-v3/intl/Makefile.in index fcdf38b72bfb..1724a3d033a4 100644 --- a/libstdc++-v3/intl/Makefile.in +++ b/libstdc++-v3/intl/Makefile.in @@ -105,6 +105,7 @@ LIBMATH_INCLUDES = @LIBMATH_INCLUDES@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@ LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@ LIBTOOL = @LIBTOOL@ +LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ diff --git a/libstdc++-v3/libio/Makefile.in b/libstdc++-v3/libio/Makefile.in index 2f1f6ac68a0c..4965a7b31acc 100644 --- a/libstdc++-v3/libio/Makefile.in +++ b/libstdc++-v3/libio/Makefile.in @@ -103,6 +103,7 @@ LIBMATH_INCLUDES = @LIBMATH_INCLUDES@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@ LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@ LIBTOOL = @LIBTOOL@ +LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ diff --git a/libstdc++-v3/libmath/Makefile.in b/libstdc++-v3/libmath/Makefile.in index e360eb8b3b67..b1466b8cb16d 100644 --- a/libstdc++-v3/libmath/Makefile.in +++ b/libstdc++-v3/libmath/Makefile.in @@ -105,6 +105,7 @@ LIBMATH_INCLUDES = @LIBMATH_INCLUDES@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@ LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@ LIBTOOL = @LIBTOOL@ +LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in index 313f179c67f7..d8cf667788a3 100644 --- a/libstdc++-v3/libsupc++/Makefile.in +++ b/libstdc++-v3/libsupc++/Makefile.in @@ -102,6 +102,7 @@ LIBMATHOBJS = @LIBMATHOBJS@ LIBMATH_INCLUDES = @LIBMATH_INCLUDES@ LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@ LIBTOOL = @LIBTOOL@ +LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in index 3a606fdb40db..9bb90b228e8a 100644 --- a/libstdc++-v3/po/Makefile.in +++ b/libstdc++-v3/po/Makefile.in @@ -105,6 +105,7 @@ LIBMATH_INCLUDES = @LIBMATH_INCLUDES@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@ LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@ LIBTOOL = @LIBTOOL@ +LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ diff --git a/libstdc++-v3/porting.texi b/libstdc++-v3/porting.texi index 87111e709b8e..9114806b63f5 100644 --- a/libstdc++-v3/porting.texi +++ b/libstdc++-v3/porting.texi @@ -74,6 +74,7 @@ Here are the primary steps required to port the library: * Operating system:: Configuring for your operating system. * Character types:: Implementing character classification. * Thread safety:: Implementing atomic operations. +* Numeric limits:: Implementing numeric limits. * Libtool:: Using libtool. * GNU Free Documentation License:: How you can copy and share this manual. @end menu @@ -436,6 +437,31 @@ __atomic_add (_Atomic_word* __mem, int __val) @} @end example +@c --------------------------------------------------------------------- +@c Numeric limits +@c --------------------------------------------------------------------- + +@node Numeric limits +@chapter Numeric limits + +The C++ library requires information about the fundamental data types, +such as the minimum and maximum representable values of each type. +You can define each of these values individually, but it is usually +easiest just to indicate how many bits are used in each of the data +types and let the library do the rest. For information about the +macros to define, see the top of @file{include/bits/std_limits.h}. + +If you need to define any macros, you can do so in +@file{os_defines.h}. However, if all operating systems for your CPU +are likely to use the same values, you can provide a CPU-specific file +instead so that you do not have to provide the same definitions for +each operating system. To take that approach, create a new file +called @file{limits.h} in your CPU configuration directory (e.g., +@file{config/cpu/i386/bits}) and then modify @file{configure.target} +so that @code{LIMITSH} is set to the CPU directory (e.g., +@file{config/cpu/i386}). Note that @code{LIMITSH} should not include +the @samp{bits} part of the directory name. + @c --------------------------------------------------------------------- @c Libtool @c --------------------------------------------------------------------- diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index 0839375cf7af..c1b76a225b17 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -99,6 +99,7 @@ INTLOBJS = @INTLOBJS@ LIBMATHOBJS = @LIBMATHOBJS@ LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@ LIBTOOL = @LIBTOOL@ +LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in index 3bf801b4c74e..1d6dcce2348c 100644 --- a/libstdc++-v3/testsuite/Makefile.in +++ b/libstdc++-v3/testsuite/Makefile.in @@ -105,6 +105,7 @@ LIBMATH_INCLUDES = @LIBMATH_INCLUDES@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@ LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@ LIBTOOL = @LIBTOOL@ +LIMITS_INC_SRCDIR = @LIMITS_INC_SRCDIR@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ -- 2.43.5