acconfig.h (_GLIBCPP_USE_C99): Add.
2001-04-19 Benjamin Kosnik <bkoz@redhat.com> * acconfig.h (_GLIBCPP_USE_C99): Add. * config.h.in: Regenerate. * acinclude.m4 (GLIBCPP_ENABLE_C99): New macro. Test for ISO/IEC 9899: 1999 support. * aclocal.m4: Regenerate. * configure.in (GLIBCPP_ENABLE_C99): Use it, on by default. * configure: Regenerate. * configure.in (GLIBCPP_ENABLE_LONG_LONG): Set default to yes. * configure: Regenerate. * include/c_std/bits/std_cwchar.h: Put wcstold, wcstoll, wcstoull into c99. * include/c_std/bits/std_cmath.h: Bring C99 functions into c99 namespace. * include/c_std/bits/std_cstdlib.h: Same. * docs/html/configopts.html: Update. * testsuite/26_numerics/c99_macros.cc: Edit, use cmath instead of math.h (test_c99_classify): Add. * config/os/gnu-linux/bits/os_defines.h (_GNU_SOURCE): Remove. (_ISOC99_SOURCE): Remove. * include/bits/stl_algo.h: Use _GLIBCPP_HAVE_DRAND48. * include/bits/c++config (__STL_ASSERTIONS): Simplify. * acinclude.m4 (GLIBCPP_CHECK_STDLIB_SUPPORT): Add check for drand48. * aclocal.m4: Regenerate. * configure: Regenerate. From-SVN: r41451
This commit is contained in:
parent
856a688433
commit
7cda84dc70
@ -1,3 +1,32 @@
|
||||
2001-04-19 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
* acconfig.h (_GLIBCPP_USE_C99): Add.
|
||||
* config.h.in: Regenerate.
|
||||
* acinclude.m4 (GLIBCPP_ENABLE_C99): New macro. Test for ISO/IEC
|
||||
9899: 1999 support.
|
||||
* aclocal.m4: Regenerate.
|
||||
* configure.in (GLIBCPP_ENABLE_C99): Use it, on by default.
|
||||
* configure: Regenerate.
|
||||
* configure.in (GLIBCPP_ENABLE_LONG_LONG): Set default to yes.
|
||||
* configure: Regenerate.
|
||||
* include/c_std/bits/std_cwchar.h: Put wcstold, wcstoll, wcstoull
|
||||
into c99.
|
||||
* include/c_std/bits/std_cmath.h: Bring C99 functions into c99
|
||||
namespace.
|
||||
* include/c_std/bits/std_cstdlib.h: Same.
|
||||
* docs/html/configopts.html: Update.
|
||||
* testsuite/26_numerics/c99_macros.cc: Edit, use cmath instead of
|
||||
math.h
|
||||
(test_c99_classify): Add.
|
||||
* config/os/gnu-linux/bits/os_defines.h (_GNU_SOURCE): Remove.
|
||||
(_ISOC99_SOURCE): Remove.
|
||||
|
||||
* include/bits/stl_algo.h: Use _GLIBCPP_HAVE_DRAND48.
|
||||
* include/bits/c++config (__STL_ASSERTIONS): Simplify.
|
||||
* acinclude.m4 (GLIBCPP_CHECK_STDLIB_SUPPORT): Add check for drand48.
|
||||
* aclocal.m4: Regenerate.
|
||||
* configure: Regenerate.
|
||||
|
||||
2001-04-19 Phil Edwards <pme@sources.redhat.com>
|
||||
|
||||
* Makefile.am (doxygen): Assume script is missing execute perms.
|
||||
@ -29,7 +58,8 @@
|
||||
2001-04-13 Phil Edwards <pme@sources.redhat.com>
|
||||
|
||||
* include/bits/stl_algobase.h (equal): Use EqualOpConcept instead
|
||||
of EqualityComparableConcept.
|
||||
of EqualityCo
|
||||
mparableConcept.
|
||||
|
||||
2001-04-13 Phil Edwards <pme@sources.redhat.com>
|
||||
|
||||
|
@ -136,43 +136,7 @@ MULTICLEAN = true
|
||||
# Work around what appears to be a GNU make bug handling MAKEFLAGS
|
||||
# values defined in terms of make variables, as is the case for CC and
|
||||
# friends when we are called from the top level Makefile.
|
||||
AM_MAKEFLAGS = \
|
||||
"AR_FLAGS=$(AR_FLAGS)" \
|
||||
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
|
||||
"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
|
||||
"CFLAGS=$(CFLAGS)" \
|
||||
"CXXFLAGS=$(CXXFLAGS)" \
|
||||
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
|
||||
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
|
||||
"INSTALL=$(INSTALL)" \
|
||||
"INSTALL_DATA=$(INSTALL_DATA)" \
|
||||
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
|
||||
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
|
||||
"LDFLAGS=$(LDFLAGS)" \
|
||||
"LIBCFLAGS=$(LIBCFLAGS)" \
|
||||
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
|
||||
"MAKE=$(MAKE)" \
|
||||
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
|
||||
"PICFLAG=$(PICFLAG)" \
|
||||
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
|
||||
"SHELL=$(SHELL)" \
|
||||
"exec_prefix=$(exec_prefix)" \
|
||||
"infodir=$(infodir)" \
|
||||
"libdir=$(libdir)" \
|
||||
"includedir=$(includedir)" \
|
||||
"prefix=$(prefix)" \
|
||||
"tooldir=$(tooldir)" \
|
||||
"AR=$(AR)" \
|
||||
"AS=$(AS)" \
|
||||
"LD=$(LD)" \
|
||||
"LIBCFLAGS=$(LIBCFLAGS)" \
|
||||
"PICFLAG=$(PICFLAG)" \
|
||||
"RANLIB=$(RANLIB)" \
|
||||
"NM=$(NM)" \
|
||||
"NM_FOR_BUILD=$(NM_FOR_BUILD)" \
|
||||
"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
|
||||
"DESTDIR=$(DESTDIR)" \
|
||||
"WERROR=$(WERROR)"
|
||||
AM_MAKEFLAGS = "AR_FLAGS=$(AR_FLAGS)" "CC_FOR_BUILD=$(CC_FOR_BUILD)" "CC_FOR_TARGET=$(CC_FOR_TARGET)" "CFLAGS=$(CFLAGS)" "CXXFLAGS=$(CXXFLAGS)" "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" "INSTALL=$(INSTALL)" "INSTALL_DATA=$(INSTALL_DATA)" "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" "LDFLAGS=$(LDFLAGS)" "LIBCFLAGS=$(LIBCFLAGS)" "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" "MAKE=$(MAKE)" "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" "PICFLAG=$(PICFLAG)" "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" "SHELL=$(SHELL)" "exec_prefix=$(exec_prefix)" "infodir=$(infodir)" "libdir=$(libdir)" "includedir=$(includedir)" "prefix=$(prefix)" "tooldir=$(tooldir)" "AR=$(AR)" "AS=$(AS)" "LD=$(LD)" "LIBCFLAGS=$(LIBCFLAGS)" "PICFLAG=$(PICFLAG)" "RANLIB=$(RANLIB)" "NM=$(NM)" "NM_FOR_BUILD=$(NM_FOR_BUILD)" "NM_FOR_TARGET=$(NM_FOR_TARGET)" "DESTDIR=$(DESTDIR)" "WERROR=$(WERROR)"
|
||||
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
CONFIG_HEADER = config.h
|
||||
|
@ -12,6 +12,9 @@
|
||||
// Include support for 'long long' and 'unsigned long long'.
|
||||
#undef _GLIBCPP_USE_LONG_LONG
|
||||
|
||||
// Define if code specialized for wchar_t should be used.
|
||||
#undef _GLIBCPP_USE_C99
|
||||
|
||||
// Include support for 'long double'.
|
||||
#undef _GLIBCPP_USE_LONG_DOUBLE
|
||||
|
||||
@ -30,16 +33,13 @@
|
||||
// Define if you have the copysignf function.
|
||||
#undef _GLIBCPP_HAVE_COPYSIGNF
|
||||
|
||||
// Define if lldiv_t exists in stdlib.h.
|
||||
#undef HAVE_LLDIV_T
|
||||
|
||||
// Define if mbstate_t exists in wchar.h. */
|
||||
// Define if mbstate_t exists in wchar.h.
|
||||
#undef HAVE_MBSTATE_T
|
||||
|
||||
// Define if you have the modff function. */
|
||||
// Define if you have the modff function.
|
||||
#undef HAVE_MODFF
|
||||
|
||||
// Define if you have the modfl function. */
|
||||
// Define if you have the modfl function.
|
||||
#undef HAVE_MODFL
|
||||
|
||||
// Define if the compiler/host combination has __builtin_abs
|
||||
@ -99,6 +99,15 @@
|
||||
// underscore, we'll handle those here. Must come after config.h.in.
|
||||
//
|
||||
|
||||
#if defined(_GLIBCPP_USE_C99) && defined(__cplusplus)
|
||||
// Placeholder for declarations in c99 namespace.
|
||||
namespace std
|
||||
{
|
||||
namespace c99 { }
|
||||
using namespace c99;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (HAVE__ISNAN) && ! defined (HAVE_ISNAN)
|
||||
# define HAVE_ISNAN 1
|
||||
# define isnan _isnan
|
||||
|
@ -455,9 +455,6 @@ dnl Check to see if the (stdlib function) argument passed is
|
||||
dnl 1) declared when using the c++ compiler
|
||||
dnl 2) has "C" linkage
|
||||
dnl
|
||||
dnl Define HAVE_STRTOLD if "strtold" is declared and links
|
||||
dnl Define HAVE_STRTOF if "strtof" is declared and links
|
||||
dnl
|
||||
dnl argument 1 is name of function to check
|
||||
dnl
|
||||
dnl ASSUMES argument is a math function with TWO parameters
|
||||
@ -600,8 +597,9 @@ dnl 1) make sure the name is declared when using the c++ compiler
|
||||
dnl 2) make sure the name has "C" linkage
|
||||
dnl This might seem like overkill but experience has shown that it's not...
|
||||
dnl
|
||||
dnl Define HAVE_STRTOF etc if "strtof" is found.
|
||||
dnl Define HAVE_STRTOLD etc if "strtold" is found.
|
||||
dnl Define HAVE_STRTOLD if "strtold" is declared and links
|
||||
dnl Define HAVE_STRTOF if "strtof" is declared and links
|
||||
dnl Define HAVE_DRAND48 if "drand48" is declared and links
|
||||
dnl
|
||||
dnl GLIBCPP_CHECK_STDLIB_SUPPORT
|
||||
AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
|
||||
@ -611,6 +609,7 @@ AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
|
||||
|
||||
AC_CHECK_FUNCS(strtof)
|
||||
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
|
||||
AC_CHECK_FUNCS(drand48)
|
||||
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
])
|
||||
@ -1326,7 +1325,7 @@ dnl GLIBCPP_ENABLE_LONG_LONG
|
||||
dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
|
||||
dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
|
||||
dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
|
||||
dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
|
||||
dnl Where DEFAULT is either `yes' or `no'. If omitted, it
|
||||
dnl defaults to `no'.
|
||||
dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
|
||||
dnl
|
||||
@ -1344,44 +1343,93 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
|
||||
*) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
|
||||
esac],
|
||||
enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
|
||||
|
||||
# Allow use of os-dependent settings, so that macros that turn on
|
||||
# C99 capabilities can be defined and used in a consistent way.
|
||||
OS_INC_PATH=${srcdir}/$os_include_dir
|
||||
ac_test_CFLAGS="${CFLAGS+set}"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="-I$OS_INC_PATH"
|
||||
|
||||
# Check for the existence of functions used if long long is enabled.
|
||||
AC_CHECK_FUNC(strtoll,,ac_strtoll=no)
|
||||
AC_CHECK_FUNC(strtoull,,ac_strtoull=no)
|
||||
|
||||
# Check for lldiv_t, et. al.
|
||||
AC_MSG_CHECKING([for lldiv_t declaration])
|
||||
AC_CACHE_VAL(glibcpp_lldiv_t_use, [
|
||||
AC_TRY_COMPILE([#include <bits/os_defines.h>
|
||||
#include <stdlib.h>],
|
||||
[ lldiv_t mydivt;],
|
||||
[glibcpp_lldiv_t_use=yes], [glibcpp_lldiv_t_use=no])
|
||||
])
|
||||
AC_MSG_RESULT($glibcpp_lldiv_t_use)
|
||||
if test x$glibcpp_lldiv_t_use = x"yes"; then
|
||||
AC_DEFINE(HAVE_LLDIV_T)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for enabled long long])
|
||||
if test x"$ac_strtoll" = xno || test x"$ac_strtoull" = xno; then
|
||||
enable_long_long=no;
|
||||
fi;
|
||||
AC_MSG_RESULT($enable_long_long)
|
||||
|
||||
# Option parsed, now set things appropriately
|
||||
if test x"$enable_long_long" = xyes; then
|
||||
AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
|
||||
fi
|
||||
])
|
||||
|
||||
# Reset CFLAGS
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
|
||||
dnl
|
||||
dnl Check for ISO/IEC 9899:1999 "C99" support.
|
||||
dnl
|
||||
dnl GLIBCPP_ENABLE_C99
|
||||
dnl --enable-c99 defines _GLIBCPP_USE_C99
|
||||
dnl --disable-c99 leaves _GLIBCPP_USE_C99 undefined
|
||||
dnl + Usage: GLIBCPP_ENABLE_C99[(DEFAULT)]
|
||||
dnl Where DEFAULT is either `yes' or `no'. If omitted, it
|
||||
dnl defaults to `no'.
|
||||
dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
|
||||
dnl
|
||||
dnl GLIBCPP_ENABLE_C99
|
||||
AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
|
||||
define([GLIBCPP_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
|
||||
|
||||
AC_ARG_ENABLE(c99,
|
||||
changequote(<<, >>)dnl
|
||||
<<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCPP_ENABLE_C99_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[case "$enableval" in
|
||||
yes) enable_c99=yes ;;
|
||||
no) enable_c99=no ;;
|
||||
*) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
|
||||
esac],
|
||||
enable_c99=GLIBCPP_ENABLE_C99_DEFAULT)dnl
|
||||
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
|
||||
# Check for the existence of <math.h> functions used if C99 is enabled.
|
||||
AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isgreater(0,0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isgreaterequal(0,0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isless(0,0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[islessequal(0,0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[islessgreater(0,0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isunordered(0,0);],, [ac_c99_math=no])
|
||||
|
||||
# Check for the existence in <stdlib.h> of lldiv_t, et. al.
|
||||
AC_CHECK_FUNC(strtoll,,ac_c99_stdlib=no)
|
||||
AC_CHECK_FUNC(strtoull,,ac_c99_stdlib=no)
|
||||
AC_CHECK_FUNC(llabs,,ac_c99_stdlib=no)
|
||||
AC_CHECK_FUNC(lldiv,,ac_c99_stdlib=no)
|
||||
AC_CHECK_FUNC(atoll,,ac_c99_stdlib=no)
|
||||
|
||||
AC_MSG_CHECKING([for lldiv_t declaration])
|
||||
AC_CACHE_VAL(ac_c99_lldiv_t, [
|
||||
AC_TRY_COMPILE([#include <stdlib.h>],
|
||||
[ lldiv_t mydivt;],
|
||||
[ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
|
||||
])
|
||||
AC_MSG_RESULT($ac_c99_lldiv_t)
|
||||
if test x"$ac_c99_lldiv_t" = x"no"; then
|
||||
ac_c99_stdlib=no;
|
||||
fi;
|
||||
|
||||
# Check for the existence of <wchar.h> functions used if C99 is enabled.
|
||||
AC_CHECK_FUNC(wcstold,,ac_c99_wchar=no)
|
||||
AC_CHECK_FUNC(wcstoll,,ac_c99_wchar=no)
|
||||
AC_CHECK_FUNC(wcstoull,,ac_c99_wchar=no)
|
||||
|
||||
AC_MSG_CHECKING([for enabled ISO C99 support])
|
||||
if test x"$ac_c99_math" = x"no" || test x"$ac_c99_wchar" = x"no" \
|
||||
|| test x"$ac_c99_stdlib" = x"no"; then
|
||||
enable_c99=no;
|
||||
fi;
|
||||
AC_MSG_RESULT($enable_c99)
|
||||
|
||||
# Option parsed, now set things appropriately
|
||||
if test x"$enable_c99" = x"yes"; then
|
||||
AC_DEFINE(_GLIBCPP_USE_C99)
|
||||
fi
|
||||
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
|
||||
|
||||
@ -1752,3 +1800,4 @@ AC_DEFUN([AC_LIBTOOL_DLOPEN])
|
||||
AC_DEFUN([AC_PROG_LD])
|
||||
])
|
||||
|
||||
|
||||
|
125
libstdc++-v3/aclocal.m4
vendored
125
libstdc++-v3/aclocal.m4
vendored
@ -467,9 +467,6 @@ dnl Check to see if the (stdlib function) argument passed is
|
||||
dnl 1) declared when using the c++ compiler
|
||||
dnl 2) has "C" linkage
|
||||
dnl
|
||||
dnl Define HAVE_STRTOLD if "strtold" is declared and links
|
||||
dnl Define HAVE_STRTOF if "strtof" is declared and links
|
||||
dnl
|
||||
dnl argument 1 is name of function to check
|
||||
dnl
|
||||
dnl ASSUMES argument is a math function with TWO parameters
|
||||
@ -612,8 +609,9 @@ dnl 1) make sure the name is declared when using the c++ compiler
|
||||
dnl 2) make sure the name has "C" linkage
|
||||
dnl This might seem like overkill but experience has shown that it's not...
|
||||
dnl
|
||||
dnl Define HAVE_STRTOF etc if "strtof" is found.
|
||||
dnl Define HAVE_STRTOLD etc if "strtold" is found.
|
||||
dnl Define HAVE_STRTOLD if "strtold" is declared and links
|
||||
dnl Define HAVE_STRTOF if "strtof" is declared and links
|
||||
dnl Define HAVE_DRAND48 if "drand48" is declared and links
|
||||
dnl
|
||||
dnl GLIBCPP_CHECK_STDLIB_SUPPORT
|
||||
AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
|
||||
@ -623,6 +621,7 @@ AC_DEFUN(GLIBCPP_CHECK_STDLIB_SUPPORT, [
|
||||
|
||||
AC_CHECK_FUNCS(strtof)
|
||||
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
|
||||
AC_CHECK_FUNCS(drand48)
|
||||
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
])
|
||||
@ -1338,7 +1337,7 @@ dnl GLIBCPP_ENABLE_LONG_LONG
|
||||
dnl --enable-long-long defines _GLIBCPP_USE_LONG_LONG
|
||||
dnl --disable-long-long leaves _GLIBCPP_USE_LONG_LONG undefined
|
||||
dnl + Usage: GLIBCPP_ENABLE_LONG_LONG[(DEFAULT)]
|
||||
dnl Where DEFAULT is either `yes' or `no'. If ommitted, it
|
||||
dnl Where DEFAULT is either `yes' or `no'. If omitted, it
|
||||
dnl defaults to `no'.
|
||||
dnl + If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
|
||||
dnl
|
||||
@ -1356,44 +1355,93 @@ AC_DEFUN(GLIBCPP_ENABLE_LONG_LONG, [dnl
|
||||
*) AC_MSG_ERROR([Unknown argument to enable/disable long long]) ;;
|
||||
esac],
|
||||
enable_long_long=GLIBCPP_ENABLE_LONG_LONG_DEFAULT)dnl
|
||||
|
||||
# Allow use of os-dependent settings, so that macros that turn on
|
||||
# C99 capabilities can be defined and used in a consistent way.
|
||||
OS_INC_PATH=${srcdir}/$os_include_dir
|
||||
ac_test_CFLAGS="${CFLAGS+set}"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS="-I$OS_INC_PATH"
|
||||
|
||||
# Check for the existence of functions used if long long is enabled.
|
||||
AC_CHECK_FUNC(strtoll,,ac_strtoll=no)
|
||||
AC_CHECK_FUNC(strtoull,,ac_strtoull=no)
|
||||
|
||||
# Check for lldiv_t, et. al.
|
||||
AC_MSG_CHECKING([for lldiv_t declaration])
|
||||
AC_CACHE_VAL(glibcpp_lldiv_t_use, [
|
||||
AC_TRY_COMPILE([#include <bits/os_defines.h>
|
||||
#include <stdlib.h>],
|
||||
[ lldiv_t mydivt;],
|
||||
[glibcpp_lldiv_t_use=yes], [glibcpp_lldiv_t_use=no])
|
||||
])
|
||||
AC_MSG_RESULT($glibcpp_lldiv_t_use)
|
||||
if test x$glibcpp_lldiv_t_use = x"yes"; then
|
||||
AC_DEFINE(HAVE_LLDIV_T)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for enabled long long])
|
||||
if test x"$ac_strtoll" = xno || test x"$ac_strtoull" = xno; then
|
||||
enable_long_long=no;
|
||||
fi;
|
||||
AC_MSG_RESULT($enable_long_long)
|
||||
|
||||
# Option parsed, now set things appropriately
|
||||
if test x"$enable_long_long" = xyes; then
|
||||
AC_DEFINE(_GLIBCPP_USE_LONG_LONG)
|
||||
fi
|
||||
])
|
||||
|
||||
# Reset CFLAGS
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
|
||||
dnl
|
||||
dnl Check for ISO/IEC 9899:1999 "C99" support.
|
||||
dnl
|
||||
dnl GLIBCPP_ENABLE_C99
|
||||
dnl --enable-c99 defines _GLIBCPP_USE_C99
|
||||
dnl --disable-c99 leaves _GLIBCPP_USE_C99 undefined
|
||||
dnl + Usage: GLIBCPP_ENABLE_C99[(DEFAULT)]
|
||||
dnl Where DEFAULT is either `yes' or `no'. If omitted, it
|
||||
dnl defaults to `no'.
|
||||
dnl + If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
|
||||
dnl
|
||||
dnl GLIBCPP_ENABLE_C99
|
||||
AC_DEFUN(GLIBCPP_ENABLE_C99, [dnl
|
||||
define([GLIBCPP_ENABLE_C99_DEFAULT], ifelse($1, yes, yes, no))dnl
|
||||
|
||||
AC_ARG_ENABLE(c99,
|
||||
changequote(<<, >>)dnl
|
||||
<<--enable-c99 turns on 'ISO/IEC 9899:1999 support' [default=>>GLIBCPP_ENABLE_C99_DEFAULT],
|
||||
changequote([, ])dnl
|
||||
[case "$enableval" in
|
||||
yes) enable_c99=yes ;;
|
||||
no) enable_c99=no ;;
|
||||
*) AC_MSG_ERROR([Unknown argument to enable/disable C99]) ;;
|
||||
esac],
|
||||
enable_c99=GLIBCPP_ENABLE_C99_DEFAULT)dnl
|
||||
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
|
||||
# Check for the existence of <math.h> functions used if C99 is enabled.
|
||||
AC_TRY_COMPILE([#include <math.h>],[fpclassify(0.0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isfinite(0.0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isinf(0.0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isnan(0.0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isnormal(0.0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[signbit(0.0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isgreater(0,0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isgreaterequal(0,0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isless(0,0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[islessequal(0,0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[islessgreater(0,0);],, [ac_c99_math=no])
|
||||
AC_TRY_COMPILE([#include <math.h>],[isunordered(0,0);],, [ac_c99_math=no])
|
||||
|
||||
# Check for the existence in <stdlib.h> of lldiv_t, et. al.
|
||||
AC_CHECK_FUNC(strtoll,,ac_c99_stdlib=no)
|
||||
AC_CHECK_FUNC(strtoull,,ac_c99_stdlib=no)
|
||||
AC_CHECK_FUNC(llabs,,ac_c99_stdlib=no)
|
||||
AC_CHECK_FUNC(lldiv,,ac_c99_stdlib=no)
|
||||
AC_CHECK_FUNC(atoll,,ac_c99_stdlib=no)
|
||||
|
||||
AC_MSG_CHECKING([for lldiv_t declaration])
|
||||
AC_CACHE_VAL(ac_c99_lldiv_t, [
|
||||
AC_TRY_COMPILE([#include <stdlib.h>],
|
||||
[ lldiv_t mydivt;],
|
||||
[ac_c99_lldiv_t=yes], [ac_c99_lldiv_t=no])
|
||||
])
|
||||
AC_MSG_RESULT($ac_c99_lldiv_t)
|
||||
if test x"$ac_c99_lldiv_t" = x"no"; then
|
||||
ac_c99_stdlib=no;
|
||||
fi;
|
||||
|
||||
# Check for the existence of <wchar.h> functions used if C99 is enabled.
|
||||
AC_CHECK_FUNC(wcstold,,ac_c99_wchar=no)
|
||||
AC_CHECK_FUNC(wcstoll,,ac_c99_wchar=no)
|
||||
AC_CHECK_FUNC(wcstoull,,ac_c99_wchar=no)
|
||||
|
||||
AC_MSG_CHECKING([for enabled ISO C99 support])
|
||||
if test x"$ac_c99_math" = x"no" || test x"$ac_c99_wchar" = x"no" \
|
||||
|| test x"$ac_c99_stdlib" = x"no"; then
|
||||
enable_c99=no;
|
||||
fi;
|
||||
AC_MSG_RESULT($enable_c99)
|
||||
|
||||
# Option parsed, now set things appropriately
|
||||
if test x"$enable_c99" = x"yes"; then
|
||||
AC_DEFINE(_GLIBCPP_USE_C99)
|
||||
fi
|
||||
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
|
||||
|
||||
@ -1765,6 +1813,7 @@ AC_DEFUN([AC_PROG_LD])
|
||||
])
|
||||
|
||||
|
||||
|
||||
# Do all the work for Automake. This macro actually does too much --
|
||||
# some checks are only needed if your package does certain things.
|
||||
# But this isn't really a big deal.
|
||||
|
@ -15,22 +15,22 @@
|
||||
// Include support for 'long long' and 'unsigned long long'.
|
||||
#undef _GLIBCPP_USE_LONG_LONG
|
||||
|
||||
// Define if code specialized for wchar_t should be used.
|
||||
#undef _GLIBCPP_USE_C99
|
||||
|
||||
// Include support for shadow headers, ie --enable-cshadow-headers.
|
||||
#undef _GLIBCPP_USE_SHADOW_HEADERS
|
||||
|
||||
// Define if code specialized for wchar_t should be used.
|
||||
#undef _GLIBCPP_USE_WCHAR_T
|
||||
|
||||
// Define if lldiv_t exists in stdlib.h.
|
||||
#undef HAVE_LLDIV_T
|
||||
|
||||
// Define if mbstate_t exists in wchar.h. */
|
||||
// Define if mbstate_t exists in wchar.h.
|
||||
#undef HAVE_MBSTATE_T
|
||||
|
||||
// Define if you have the modff function. */
|
||||
// Define if you have the modff function.
|
||||
#undef HAVE_MODFF
|
||||
|
||||
// Define if you have the modfl function. */
|
||||
// Define if you have the modfl function.
|
||||
#undef HAVE_MODFL
|
||||
|
||||
// Define if the compiler/host combination has __builtin_abs
|
||||
@ -303,6 +303,9 @@
|
||||
/* Define if you have the cosl function. */
|
||||
#undef HAVE_COSL
|
||||
|
||||
/* Define if you have the drand48 function. */
|
||||
#undef HAVE_DRAND48
|
||||
|
||||
/* Define if you have the expf function. */
|
||||
#undef HAVE_EXPF
|
||||
|
||||
@ -557,6 +560,15 @@
|
||||
// underscore, we'll handle those here. Must come after config.h.in.
|
||||
//
|
||||
|
||||
#if defined(_GLIBCPP_USE_C99) && defined(__cplusplus)
|
||||
// Placeholder for declarations in c99 namespace.
|
||||
namespace std
|
||||
{
|
||||
namespace c99 { }
|
||||
using namespace c99;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined (HAVE__ISNAN) && ! defined (HAVE_ISNAN)
|
||||
# define HAVE_ISNAN 1
|
||||
# define isnan _isnan
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Specific definitions for GNU/Linux -*- C++ -*-
|
||||
|
||||
// Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2000, 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
|
||||
@ -29,13 +29,7 @@
|
||||
|
||||
|
||||
#ifndef _GLIBCPP_OS_DEFINES
|
||||
# define _GLIBCPP_OS_DEFINES
|
||||
|
||||
// By defining this, all GNU extensions are enabled.
|
||||
#define _GNU_SOURCE 1
|
||||
|
||||
// By defining this, all ISO C99 functionality is enabled.
|
||||
#define _ISOC99_SOURCE 1
|
||||
#define _GLIBCPP_OS_DEFINES 1
|
||||
|
||||
// This keeps isanum, et al from being propagated as macros.
|
||||
#define __NO_CTYPE 1
|
||||
|
2287
libstdc++-v3/configure
vendored
2287
libstdc++-v3/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -64,7 +64,8 @@ GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
|
||||
GLIBCPP_ENABLE_CSTDIO
|
||||
GLIBCPP_ENABLE_CLOCALE
|
||||
GLIBCPP_ENABLE_C_MBCHAR([yes])
|
||||
GLIBCPP_ENABLE_LONG_LONG([no])
|
||||
GLIBCPP_ENABLE_C99([yes])
|
||||
GLIBCPP_ENABLE_LONG_LONG([yes])
|
||||
GLIBCPP_ENABLE_CHEADERS([c_std])
|
||||
GLIBCPP_ENABLE_THREADS
|
||||
GLIBCPP_ENABLE_CXX_FLAGS([none])
|
||||
|
@ -7,7 +7,7 @@
|
||||
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
|
||||
<TITLE>libstdc++-v3 configure options</TITLE>
|
||||
<LINK REL=StyleSheet HREF="lib3styles.css">
|
||||
<!-- $Id: configopts.html,v 1.8 2001/04/02 19:00:13 bkoz Exp $ -->
|
||||
<!-- $Id: configopts.html,v 1.9 2001/04/06 01:47:11 bkoz Exp $ -->
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
@ -91,16 +91,31 @@ options</A></H1>
|
||||
'generic'.
|
||||
</P>
|
||||
|
||||
<DT><TT>--enable-c99 </TT>
|
||||
<DD><P>The "long long" type was introduced in C99, along
|
||||
with bunches of other functions for wide characters, and math
|
||||
classification macros, etc. If enabled, all C99 functions not
|
||||
specified by the C++ standard will be put into namespace c99,
|
||||
and then all names in the c99 namespace will be injected into
|
||||
namespace std, so that C99 functions can be used "as if" they
|
||||
were in the C++ standard (as they will eventually be in some
|
||||
future revision of the standard, without a doubt.) By default,
|
||||
C99 support is on, assuming the configure probes find all the
|
||||
necessary functions and bits necessary.
|
||||
</P>
|
||||
|
||||
<DT><TT>--enable-long-long </TT>
|
||||
<DD><P>The "long long" type was introduced in C99. It is
|
||||
provided as a GNU extension to C++98 in g++. This flag builds
|
||||
support for "long long" into the library
|
||||
(specialized templates and the like). This option is off by
|
||||
default: if enabled, users will have to either use the
|
||||
new-style "C" headers by default (ie cmath not math.h)
|
||||
or add appropriate compile-time flags to all compile lines to
|
||||
allow "C" visibility of this feature (on GNU/Linux,
|
||||
the flag is -D_ISOC99_SOURCE).
|
||||
(specialized templates and the like for iostreams). This
|
||||
option is on by default: if enabled, users will have to either
|
||||
use the new-style "C" headers by default (ie cmath
|
||||
not math.h) or add appropriate compile-time flags to all
|
||||
compile lines to allow "C" visibility of this
|
||||
feature (on GNU/Linux, the flag is -D_ISOC99_SOURCE, which is
|
||||
added automatically via CPLUSPLUS_CPP_SPEC's addition of
|
||||
_GNU_SOURCE).
|
||||
</P>
|
||||
|
||||
<DT><TT>--enable-cheaders=OPTION </TT>
|
||||
@ -197,7 +212,7 @@ options</A></H1>
|
||||
|
||||
<HR>
|
||||
<P CLASS="fineprint"><EM>
|
||||
$Id: configopts.html,v 1.8 2001/04/02 19:00:13 bkoz Exp $
|
||||
$Id: configopts.html,v 1.9 2001/04/06 01:47:11 bkoz Exp $
|
||||
</EM></P>
|
||||
|
||||
|
||||
|
@ -49,6 +49,10 @@
|
||||
// by the compiler, but instead instantiated into the library binary.
|
||||
#define _GLIBCPP_FULLY_COMPLIANT_HEADERS 1
|
||||
|
||||
// Define this to permit user-level control of the expansion of string
|
||||
// buffers (via a fn pointer), see basic_string.* for more.
|
||||
//#define _GLIBCPP_ALLOC_CONTROL
|
||||
|
||||
// To enable older, ARM-style iostreams and other anachronisms use this.
|
||||
//#define _GLIBCPP_DEPRECATED 1
|
||||
|
||||
@ -59,86 +63,54 @@
|
||||
//#define _GLIBCPP_CONCEPT_CHECKS 1
|
||||
|
||||
// From SGI's stl_config.h; generic settings and user hooks (_NOTHREADS).
|
||||
#if defined(_PTHREADS) && !defined(_NOTHREADS)
|
||||
# define __STL_PTHREADS
|
||||
#ifdef _REENTRANT
|
||||
# define __STL_THREADS
|
||||
#endif
|
||||
|
||||
#if defined(_PTHREADS) && !defined(_NOTHREADS)
|
||||
# define __STL_PTHREADS
|
||||
#endif
|
||||
|
||||
#if defined(_UITHREADS) && !defined(_PTHREADS) && !defined(_NOTHREADS)
|
||||
# define __STL_UITHREADS
|
||||
# define __STL_UITHREADS
|
||||
#endif
|
||||
|
||||
#if defined(__STL_WIN32THREADS) || defined(__STL_SGI_THREADS) \
|
||||
|| defined(__STL_PTHREADS) || defined(__STL_UITHREADS)
|
||||
# define __STL_THREADS
|
||||
# define __STL_VOLATILE volatile
|
||||
#else
|
||||
# define __STL_VOLATILE
|
||||
#endif
|
||||
|
||||
// This is also a user hook, but via -f[no-]exceptions, not direct #defines.
|
||||
#ifdef __EXCEPTIONS
|
||||
# define __STL_USE_EXCEPTIONS
|
||||
# define __STL_TRY try
|
||||
# define __STL_CATCH_ALL catch(...)
|
||||
# define __STL_THROW(x) throw x
|
||||
# define __STL_RETHROW throw
|
||||
# define __STL_NOTHROW throw()
|
||||
# define __STL_UNWIND(action) catch(...) { action; throw; }
|
||||
# define __STL_USE_EXCEPTIONS
|
||||
# define __STL_TRY try
|
||||
# define __STL_CATCH_ALL catch(...)
|
||||
# define __STL_THROW(x) throw x
|
||||
# define __STL_RETHROW throw
|
||||
# define __STL_NOTHROW throw()
|
||||
# define __STL_UNWIND(action) catch(...) { action; throw; }
|
||||
#else
|
||||
# define __STL_TRY
|
||||
# define __STL_CATCH_ALL if (false)
|
||||
# define __STL_THROW(x)
|
||||
# define __STL_RETHROW
|
||||
# define __STL_NOTHROW
|
||||
# define __STL_UNWIND(action)
|
||||
# define __STL_TRY
|
||||
# define __STL_CATCH_ALL if (false)
|
||||
# define __STL_THROW(x)
|
||||
# define __STL_RETHROW
|
||||
# define __STL_NOTHROW
|
||||
# define __STL_UNWIND(action)
|
||||
#endif
|
||||
|
||||
// This is the "underlying allocator" for STL. The alternatives are
|
||||
// homegrown schemes involving a kind of mutex and free list; see stl_alloc.h.
|
||||
#define __USE_MALLOC
|
||||
|
||||
// Define this to permit user-level control of the expansion of string
|
||||
// buffers (via a fn pointer), see basic_string.* for more.
|
||||
//#define _GLIBCPP_ALLOC_CONTROL
|
||||
|
||||
// The remainder of the prewritten config is mostly automatic; all the
|
||||
// user hooks are listed above.
|
||||
|
||||
#ifdef _REENTRANT
|
||||
# define __STL_THREADS
|
||||
#endif
|
||||
#ifdef _PTHREADS
|
||||
# define __STL_PTHREADS
|
||||
#endif
|
||||
//#ifndef __STRICT_ANSI__
|
||||
//# define __STL_LONG_LONG
|
||||
//#endif
|
||||
|
||||
// Mingw32, GCC compiler using the Microsoft C runtime (settings taken from
|
||||
// SGI's stl_config.h)
|
||||
#if defined(__MINGW32__)
|
||||
# define __STL_NO_DRAND48
|
||||
# ifdef _MT
|
||||
# define __STL_WIN32THREADS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Cygwin32, GCC compiler on MS Windows (settings taken from SGI's
|
||||
// stl_config.h)
|
||||
#if defined(__CYGWIN__)
|
||||
# define __STL_NO_DRAND48
|
||||
#endif
|
||||
|
||||
// XXX Only used in the SGI rope extensions; this is from stl_config.h and
|
||||
// XXX
|
||||
// Only used in the SGI rope extensions; this is from stl_config.h and
|
||||
// should be cleaned up.
|
||||
#ifdef __STL_ASSERTIONS
|
||||
# include <stdio.h>
|
||||
# define __stl_assert(expr) \
|
||||
if (!(expr)) { fprintf(stderr, "%s:%d STL assertion failure: %s\n", \
|
||||
__FILE__, __LINE__, # expr); abort(); }
|
||||
#else
|
||||
# define __stl_assert(expr)
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__STL_WIN32THREADS) || defined(__STL_SGI_THREADS) \
|
||||
|| defined(__STL_PTHREADS) || defined(__STL_UITHREADS)
|
||||
# define __STL_THREADS
|
||||
# define __STL_VOLATILE volatile
|
||||
#else
|
||||
# define __STL_VOLATILE
|
||||
#endif
|
||||
|
||||
|
||||
// End of prewritten config; the discovered settings follow.
|
||||
|
@ -1088,13 +1088,12 @@ _OutputIter rotate_copy(_ForwardIter __first, _ForwardIter __middle,
|
||||
// Return a random number in the range [0, __n). This function encapsulates
|
||||
// whether we're using rand (part of the standard C library) or lrand48
|
||||
// (not standard, but a much better choice whenever it's available).
|
||||
|
||||
template <class _Distance>
|
||||
inline _Distance __random_number(_Distance __n) {
|
||||
#ifdef __STL_NO_DRAND48
|
||||
return rand() % __n;
|
||||
#else
|
||||
#ifdef _GLIBCPP_HAVE_DRAND48
|
||||
return lrand48() % __n;
|
||||
#else
|
||||
return rand() % __n;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -67,24 +67,6 @@
|
||||
#undef tan
|
||||
#undef tanh
|
||||
|
||||
// These are possible macros imported from C99-land. They tend to break
|
||||
// well-formed C++ programs. Just pretend we don't know about them.
|
||||
// At some point, we should provide extensions in std:: -- Gaby
|
||||
|
||||
#undef fpclassify
|
||||
#undef isfinite
|
||||
#undef isinf
|
||||
#undef isnan
|
||||
#undef isnormal
|
||||
#undef signbit
|
||||
|
||||
#undef isgreater
|
||||
#undef isgreaterequal
|
||||
#undef isless
|
||||
#undef islessequal
|
||||
#undef islessgreater
|
||||
#undef isunordered
|
||||
|
||||
namespace std
|
||||
{
|
||||
// Forward declaration of a helper function. This really should be
|
||||
@ -619,6 +601,136 @@ namespace std
|
||||
#endif
|
||||
} // std
|
||||
|
||||
|
||||
#if _GLIBCPP_USE_C99
|
||||
// These are possible macros imported from C99-land. For strict
|
||||
// conformance, remove possible C99-injected names from the
|
||||
// global namespace, and sequester them in the c99 namespace.
|
||||
namespace c99
|
||||
{
|
||||
template<typename _Tp>
|
||||
int
|
||||
__capture_fpclassify(_Tp __f) { return fpclassify(__f); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
__capture_isfinite(_Tp __f) { return isfinite(__f); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
__capture_isinf(_Tp __f) { return isinf(__f); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
__capture_isnan(_Tp __f) { return isnan(__f); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
__capture_isnormal(_Tp __f) { return isnormal(__f); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
__capture_signbit(_Tp __f) { return signbit(__f); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
__capture_isgreater(_Tp __f1, _Tp __f2) { return isgreater(__f1, __f2); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
__capture_isgreaterequal(_Tp __f1, _Tp __f2)
|
||||
{ return isgreaterequal(__f1, __f2); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
__capture_isless(_Tp __f1, _Tp __f2) { return isless(__f1, __f2); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
__capture_islessequal(_Tp __f1, _Tp __f2)
|
||||
{ return islessequal(__f1, __f2); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
__capture_islessgreater(_Tp __f1, _Tp __f2)
|
||||
{ return islessgreater(__f1, __f2); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
__capture_isunordered(_Tp __f1, _Tp __f2)
|
||||
{ return isunordered(__f1, __f2); }
|
||||
} // namespace c99
|
||||
#endif
|
||||
|
||||
#undef fpclassify
|
||||
#undef isfinite
|
||||
#undef isinf
|
||||
#undef isnan
|
||||
#undef isnormal
|
||||
#undef signbit
|
||||
#undef isgreater
|
||||
#undef isgreaterequal
|
||||
#undef isless
|
||||
#undef islessequal
|
||||
#undef islessgreater
|
||||
#undef isunordered
|
||||
|
||||
#if _GLIBCPP_USE_C99
|
||||
namespace c99
|
||||
{
|
||||
template<typename _Tp>
|
||||
int
|
||||
fpclassify(_Tp __f) { return __capture_fpclassify(__f); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
isfinite(_Tp __f) { return __capture_isfinite(__f); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
isinf(_Tp __f) { return __capture_isinf(__f); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
isnan(_Tp __f) { return __capture_isnan(__f); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
isnormal(_Tp __f) { return __capture_isnormal(__f); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
signbit(_Tp __f) { return __capture_signbit(__f); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
isgreater(_Tp __f1, _Tp __f2) { return __capture_isgreater(__f1, __f2); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
isgreaterequal(_Tp __f1, _Tp __f2)
|
||||
{ return __capture_isgreaterequal(__f1, __f2); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
isless(_Tp __f1, _Tp __f2) { return __capture_isless(__f1, __f2); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
islessequal(_Tp __f1, _Tp __f2)
|
||||
{ return __capture_islessequal(__f1, __f2); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
islessgreater(_Tp __f) { return __capture_islessgreater(__f); }
|
||||
|
||||
template<typename _Tp>
|
||||
int
|
||||
isunordered(_Tp __f1, _Tp __f2)
|
||||
{ return __capture_isunordered(__f1, __f2); }
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
|
||||
# define export
|
||||
# include <bits/cmath.tcc>
|
||||
|
@ -85,18 +85,6 @@ namespace std
|
||||
using ::div_t;
|
||||
using ::ldiv_t;
|
||||
|
||||
#ifdef _GLIBCPP_USE_LONG_LONG
|
||||
# ifdef _GLIBCPP_HAVE_LLDIV_T
|
||||
using ::lldiv_t;
|
||||
# else
|
||||
struct lldiv_t
|
||||
{
|
||||
long long quot;
|
||||
long long rem;
|
||||
};
|
||||
# endif
|
||||
#endif
|
||||
|
||||
extern "C" double atof(const char*);
|
||||
extern "C" int atoi(const char*);
|
||||
extern "C" long int atol(const char*);
|
||||
@ -135,8 +123,13 @@ namespace std
|
||||
|
||||
inline ldiv_t
|
||||
div(long __i, long __j) { return ::ldiv(__i, __j); }
|
||||
} // namespace std
|
||||
|
||||
#if _GLIBCPP_USE_C99
|
||||
namespace c99
|
||||
{
|
||||
using ::lldiv_t;
|
||||
|
||||
#ifdef _GLIBCPP_USE_LONG_LONG
|
||||
inline long long
|
||||
abs(long long __x) { return __x >= 0 ? __x : -__x; }
|
||||
|
||||
@ -154,18 +147,11 @@ namespace std
|
||||
extern "C" long long int atoll(const char*);
|
||||
extern "C" long long int strtoll(const char*, char**, int);
|
||||
extern "C" unsigned long long int strtoull(const char*, char**, int);
|
||||
#endif
|
||||
|
||||
#ifdef _GLIBCPP_HAVE_STRTOLD
|
||||
extern "C" long double strtold(const char*, char**);
|
||||
#endif
|
||||
}
|
||||
} // namespace c99
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -46,7 +46,6 @@
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
|
||||
|
||||
// Need to do a bit of trickery here with mbstate_t as char_traits
|
||||
// assumes it is in wchar.h, regardless of wchar_t specializations.
|
||||
#ifndef _GLIBCPP_HAVE_MBSTATE_T
|
||||
@ -192,19 +191,21 @@ namespace std
|
||||
return const_cast<wchar_t*>(wmemchr(const_cast<const wchar_t*>(__p), __c, __n));
|
||||
}
|
||||
extern "C" int wmemcmp(const wchar_t*, const wchar_t*, size_t);
|
||||
//extern "C" int wmemcmp(wchar_t*, const wchar_t*, size_t);
|
||||
extern "C" wchar_t* wmemcpy(wchar_t*, const wchar_t*, size_t);
|
||||
extern "C" wchar_t* wmemmove(wchar_t*, const wchar_t*, size_t);
|
||||
extern "C" wchar_t* wmemset(wchar_t*, wchar_t, size_t);
|
||||
extern "C" size_t wcsftime(wchar_t*, size_t, const wchar_t*, const struct tm*);
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Full C99 listing
|
||||
#if _GLIBCPP_USE_C99
|
||||
namespace c99
|
||||
{
|
||||
extern "C" long double wcstold(const wchar_t*, wchar_t**);
|
||||
extern "C" long long int wcstoll(const wchar_t*, wchar_t**, int);
|
||||
extern "C" unsigned long long int wcstoull(const wchar_t*, wchar_t**, int);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //_GLIBCPP_USE_WCHAR_T
|
||||
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
// 2001-04-06 gdr
|
||||
|
||||
// Copyright (C) 1999, 2000 Free Software Foundation, Inc.
|
||||
// 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
|
||||
@ -29,7 +29,7 @@
|
||||
|
||||
// { dg-do compile }
|
||||
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
void fpclassify() { }
|
||||
|
||||
@ -55,7 +55,38 @@ void islessgreater() { }
|
||||
|
||||
void isunordered() { }
|
||||
|
||||
#if _GLIBCPP_USE_C99
|
||||
template <typename _Tp>
|
||||
void test_c99_classify()
|
||||
{
|
||||
using namespace std;
|
||||
test = bool;
|
||||
|
||||
typedef _Tp fp_type;
|
||||
fp_type f1 = 1.0;
|
||||
fp_type f2 = 3.0;
|
||||
int res = 0;
|
||||
|
||||
res = fpclassify(f1);
|
||||
res = isfinite(f2);
|
||||
res = isinf(f1);
|
||||
res = isnan(f2);
|
||||
res = isnormal(f1);
|
||||
res = signbit(f2);
|
||||
res = isgreater(f1, f2);
|
||||
res = isgreaterequal(f1, f2);
|
||||
res = isless(f1, f2);
|
||||
res = islessequal(f1,f2);
|
||||
res = islessgreater(f1, f2);
|
||||
res = isunordered(f1, f2);
|
||||
}
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
#if _GLIBCPP_USE_C99
|
||||
test_c99_classify<float>();
|
||||
test_c99_classify<double>();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user