From: Stephen M. Webb Date: Wed, 18 Jul 2001 17:09:02 +0000 (+0000) Subject: All occurrences of the __value_type() and __distance_type() functions... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=02d92e3b707a5433814ca22aab53da2d229dc3e1;p=gcc.git All occurrences of the __value_type() and __distance_type() functions... 2001-07-17 Stephen M. Webb r All occurrences of the __value_type() and __distance_type() functions, which were required to support the HP STL, have been removed along with all the auxiliary forwarding functions that were required to support their use. The __iterator_category() function was pretty much left alone because there was no benefit to removing it and its use made code just a little more readable. Incidences of distance() with nonstandard argument list were replaced by calls to the standard function (only in the files affected by the removal of the other HP functions). The signature of the rotate() algorithm was changed to match the standard. Headers were reformatted under C++STYLE guidelines (indentation, linebreaks, typename keyword). * include/bits/stl_algo.h: replaced __value_type() and __distance_type() with iterator_traits, eliminated auxiliary support functions required to support said function usage. Changed nonstandard distance() call to standard call. * include/bits/stl_algobase.h: Same. * include/bits/stl_heap.h: Same. * include/bits/stl_numeric.h: Same. * include/bits/stl_uninitialized.h: Same. * include/bits/stl_iterator_base_types.h (__value_type()): Removed. (__distance_type()): Removed. (value_type()): Gone. (distance_type()): Done in. (iterator_category()): Hasta la vista, baby. * include/bits/stl_iterator_base_funcs.h (iterator_category()): Replaced with __iterator_category(). * include/backward/iterator.h: moved definition of value_type(), distance_type(), and iterator_category() out of std:: and into here. * testsuite/23_containers/vector_ctor.cc (test03): New testcases. * testsuite/23_containers/vector_modifiers.cc (test03): New testcases. * testsuite/25_algorithms/rotate.cc: New testcase. * testsuite/25_algorithms/copy.cc: New testcase. * testsuite/25_algorithms/sort.cc: Same. * testsuite/25_algorithms/heap.cc: Same. * testsuite/25_algorithms/partition.cc: Same. * testsuite/25_algorithms/binary_search.cc: Same. * testsuite/26_numerics/sum_diff.cc: Ditto. From-SVN: r44117 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7ab90ba79f9..ff2efd386c7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,4 +1,56 @@ -2001-07-17 Benjamin Kosnik +2001-07-17 Stephen M. Webb r + + All occurrences of the __value_type() and __distance_type() + functions, which were required to support the HP STL, have been + removed along with all the auxiliary forwarding functions that + were required to support their use. + + The __iterator_category() function was pretty much left alone + because there was no benefit to removing it and its use made code + just a little more readable. + + Incidences of distance() with nonstandard argument list were + replaced by calls to the standard function (only in the files + affected by the removal of the other HP functions). + + The signature of the rotate() algorithm was changed to match the + standard. + + Headers were reformatted under C++STYLE guidelines (indentation, + linebreaks, typename keyword). + + * include/bits/stl_algo.h: replaced __value_type() and + __distance_type() with iterator_traits, eliminated auxiliary + support functions required to support said function usage. + Changed nonstandard distance() call to standard call. + + * include/bits/stl_algobase.h: Same. + * include/bits/stl_heap.h: Same. + * include/bits/stl_numeric.h: Same. + * include/bits/stl_uninitialized.h: Same. + * include/bits/stl_iterator_base_types.h (__value_type()): + Removed. + (__distance_type()): Removed. + (value_type()): Gone. + (distance_type()): Done in. + (iterator_category()): Hasta la vista, baby. + + * include/bits/stl_iterator_base_funcs.h (iterator_category()): + Replaced with __iterator_category(). + * include/backward/iterator.h: moved definition of value_type(), + distance_type(), and iterator_category() out of std:: and into + here. + * testsuite/23_containers/vector_ctor.cc (test03): New testcases. + * testsuite/23_containers/vector_modifiers.cc (test03): New testcases. + * testsuite/25_algorithms/rotate.cc: New testcase. + * testsuite/25_algorithms/copy.cc: New testcase. + * testsuite/25_algorithms/sort.cc: Same. + * testsuite/25_algorithms/heap.cc: Same. + * testsuite/25_algorithms/partition.cc: Same. + * testsuite/25_algorithms/binary_search.cc: Same. + * testsuite/26_numerics/sum_diff.cc: Ditto. + +001-07-17 Benjamin Kosnik * testsuite/README: Add notes on naming test cases. * testsuite/22_locale/members.cc: Mark as xfail. diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in index 2a976e4a74b..08f3f616549 100644 --- a/libstdc++-v3/Makefile.in +++ b/libstdc++-v3/Makefile.in @@ -145,44 +145,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)" \ - "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ - "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)" "RUNTESTFLAGS=$(RUNTESTFLAGS)" "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 diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index c04aff76c55..46075a08dc5 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -77,7 +77,6 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= -sitefile= srcdir= target=NONE verbose= @@ -192,7 +191,6 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -363,11 +361,6 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -533,16 +526,12 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -else - CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -655,7 +644,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:659: checking host system type" >&5 +echo "configure:648: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -676,7 +665,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:680: checking target system type" >&5 +echo "configure:669: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -694,7 +683,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:698: checking build system type" >&5 +echo "configure:687: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -723,7 +712,7 @@ target_alias=${target_alias-$target} # be 'cp -p' if linking isn't available. #ac_cv_prog_LN_S='cp -p' echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:727: checking whether ln -s works" >&5 +echo "configure:716: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -772,7 +761,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:776: checking for a BSD compatible install" >&5 +echo "configure:765: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -825,7 +814,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:829: checking whether build environment is sane" >&5 +echo "configure:818: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -882,7 +871,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:886: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:875: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -915,12 +904,12 @@ else fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:919: checking for Cygwin environment" >&5 +echo "configure:908: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:924: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -948,19 +937,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:952: checking for mingw32 environment" >&5 +echo "configure:941: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -1012,7 +1001,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:1016: checking for working aclocal" >&5 +echo "configure:1005: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1025,7 +1014,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1029: checking for working autoconf" >&5 +echo "configure:1018: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1038,7 +1027,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1042: checking for working automake" >&5 +echo "configure:1031: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1051,7 +1040,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1055: checking for working autoheader" >&5 +echo "configure:1044: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1064,7 +1053,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1068: checking for working makeinfo" >&5 +echo "configure:1057: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1099,7 +1088,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1103: checking for $ac_word" >&5 +echo "configure:1092: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1129,7 +1118,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1133: checking for $ac_word" >&5 +echo "configure:1122: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1178,7 +1167,7 @@ fi fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1182: checking whether we are using GNU C" >&5 +echo "configure:1171: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1187,7 +1176,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1180: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1202,7 +1191,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1206: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1195: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1247,7 +1236,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1251: checking for $ac_word" >&5 +echo "configure:1240: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_glibcpp_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1282,7 +1271,7 @@ CXX=$glibcpp_CXX test -z "$glibcpp_CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:1286: checking whether we are using GNU C++" >&5 +echo "configure:1275: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1291,7 +1280,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1295: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -1306,7 +1295,7 @@ if test $ac_cv_prog_gxx = yes; then ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:1310: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:1299: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1337,7 +1326,7 @@ fi # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1341: checking for $ac_word" >&5 +echo "configure:1330: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1369,7 +1358,7 @@ fi # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1373: checking for $ac_word" >&5 +echo "configure:1362: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1401,7 +1390,7 @@ fi # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1405: checking for $ac_word" >&5 +echo "configure:1394: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1433,7 +1422,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1437: checking for $ac_word" >&5 +echo "configure:1426: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1477,7 +1466,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1481: checking for a BSD compatible install" >&5 +echo "configure:1470: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1531,7 +1520,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:1535: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:1524: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -1569,7 +1558,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1573: checking for executable suffix" >&5 +echo "configure:1562: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1579,10 +1568,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1699,7 +1688,7 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1703: checking for ld used by GCC" >&5 +echo "configure:1692: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1729,10 +1718,10 @@ echo "configure:1703: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1733: checking for GNU ld" >&5 +echo "configure:1722: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1736: checking for non-GNU ld" >&5 +echo "configure:1725: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1767,7 +1756,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1771: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1760: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1784,7 +1773,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1788: checking for $LD option to reload object files" >&5 +echo "configure:1777: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1796,7 +1785,7 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1800: checking for BSD-compatible nm" >&5 +echo "configure:1789: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1834,7 +1823,7 @@ NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1838: checking how to recognise dependant libraries" >&5 +echo "configure:1827: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1998,13 +1987,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:2002: checking for object suffix" >&5 +echo "configure:1991: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:2008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -2028,7 +2017,7 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:2032: checking for ${ac_tool_prefix}file" >&5 +echo "configure:2021: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2090,7 +2079,7 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:2094: checking for file" >&5 +echo "configure:2083: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2161,7 +2150,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2165: checking for $ac_word" >&5 +echo "configure:2154: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2193,7 +2182,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2197: checking for $ac_word" >&5 +echo "configure:2186: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2228,7 +2217,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2232: checking for $ac_word" >&5 +echo "configure:2221: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2260,7 +2249,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2264: checking for $ac_word" >&5 +echo "configure:2253: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2327,8 +2316,8 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2331 "configure"' > conftest.$ac_ext - if { (eval echo configure:2332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 2320 "configure"' > conftest.$ac_ext + if { (eval echo configure:2321: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" @@ -2349,7 +2338,7 @@ case $host in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2353: checking whether the C compiler needs -belf" >&5 +echo "configure:2342: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2362,14 +2351,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2399,7 +2388,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 esac echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 -echo "configure:2403: checking how to run the C++ preprocessor" >&5 +echo "configure:2392: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2412,12 +2401,12 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2552,7 +2541,7 @@ exec 5>>./config.log echo $ac_n "checking for GNU make""... $ac_c" 1>&6 -echo "configure:2556: checking for GNU make" >&5 +echo "configure:2545: checking for GNU make" >&5 if eval "test \"`echo '$''{'_cv_gnu_make_command'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2584,7 +2573,7 @@ echo "$ac_t""$_cv_gnu_make_command" 1>&6 ; if test ! -f stamp-sanity-compiler; then echo $ac_n "checking for g++ that will successfully compile libstdc++-v3""... $ac_c" 1>&6 -echo "configure:2588: checking for g++ that will successfully compile libstdc++-v3" >&5 +echo "configure:2577: checking for g++ that will successfully compile libstdc++-v3" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2594,7 +2583,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2598: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* gpp_satisfactory=yes else @@ -2651,7 +2640,7 @@ esac echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2655: checking how to run the C preprocessor" >&5 +echo "configure:2644: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2666,13 +2655,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2676: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2683,13 +2672,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2693: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2682: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2700,13 +2689,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2710: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2699: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2732,7 +2721,7 @@ echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for cstdio to use""... $ac_c" 1>&6 -echo "configure:2736: checking for cstdio to use" >&5 +echo "configure:2725: checking for cstdio to use" >&5 # Check whether --enable-cstdio or --disable-cstdio was given. if test "${enable_cstdio+set}" = set; then enableval="$enable_cstdio" @@ -2756,17 +2745,17 @@ fi # see if we are on a system with libio native (ie, linux) ac_safe=`echo "libio.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libio.h""... $ac_c" 1>&6 -echo "configure:2760: checking for libio.h" >&5 +echo "configure:2749: checking for libio.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2770: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2796,9 +2785,9 @@ fi case "$target" in *-*-linux*) echo $ac_n "checking for glibc version >= 2.2""... $ac_c" 1>&6 -echo "configure:2800: checking for glibc version >= 2.2" >&5 +echo "configure:2789: checking for glibc version >= 2.2" >&5 cat > conftest.$ac_ext < @@ -2912,7 +2901,7 @@ fi echo $ac_n "checking for clocale to use""... $ac_c" 1>&6 -echo "configure:2916: checking for clocale to use" >&5 +echo "configure:2905: checking for clocale to use" >&5 # Check whether --enable-clocale or --disable-clocale was given. if test "${enable_clocale+set}" = set; then enableval="$enable_clocale" @@ -2983,16 +2972,16 @@ cross_compiling=$ac_cv_prog_cxx_cross # Check for the existence of functions used if C99 is enabled. ac_c99_math=yes; echo $ac_n "checking for ISO C99 support in ""... $ac_c" 1>&6 -echo "configure:2987: checking for ISO C99 support in " >&5 +echo "configure:2976: checking for ISO C99 support in " >&5 cat > conftest.$ac_ext < int main() { fpclassify(0.0); ; return 0; } EOF -if { (eval echo configure:2996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3002,14 +2991,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { isfinite(0.0); ; return 0; } EOF -if { (eval echo configure:3013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3019,14 +3008,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { isinf(0.0); ; return 0; } EOF -if { (eval echo configure:3030: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3036,14 +3025,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { isnan(0.0); ; return 0; } EOF -if { (eval echo configure:3047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3036: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3053,14 +3042,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { isnormal(0.0); ; return 0; } EOF -if { (eval echo configure:3064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3070,14 +3059,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { signbit(0.0); ; return 0; } EOF -if { (eval echo configure:3081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3070: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3087,14 +3076,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { isgreater(0.0,0.0); ; return 0; } EOF -if { (eval echo configure:3098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3104,14 +3093,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { isgreaterequal(0.0,0.0); ; return 0; } EOF -if { (eval echo configure:3115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3121,14 +3110,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { isless(0.0,0.0); ; return 0; } EOF -if { (eval echo configure:3132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3138,14 +3127,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { islessequal(0.0,0.0); ; return 0; } EOF -if { (eval echo configure:3149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3138: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3155,14 +3144,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { islessgreater(0.0,0.0); ; return 0; } EOF -if { (eval echo configure:3166: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3172,14 +3161,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { isunordered(0.0,0.0); ; return 0; } EOF -if { (eval echo configure:3183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3193,16 +3182,16 @@ rm -f conftest* # Check for the existence in of vscanf, et. al. ac_c99_stdio=yes; echo $ac_n "checking for ISO C99 support in ""... $ac_c" 1>&6 -echo "configure:3197: checking for ISO C99 support in " >&5 +echo "configure:3186: checking for ISO C99 support in " >&5 cat > conftest.$ac_ext < int main() { snprintf("12", 0, "%i"); ; return 0; } EOF -if { (eval echo configure:3206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3212,7 +3201,7 @@ else fi rm -f conftest* cat > conftest.$ac_ext < #include @@ -3223,7 +3212,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3227: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3233,7 +3222,7 @@ else fi rm -f conftest* cat > conftest.$ac_ext < #include @@ -3244,7 +3233,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3254,7 +3243,7 @@ else fi rm -f conftest* cat > conftest.$ac_ext < #include @@ -3265,7 +3254,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3269: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3275,7 +3264,7 @@ else fi rm -f conftest* cat > conftest.$ac_ext < #include @@ -3286,7 +3275,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3300,20 +3289,20 @@ rm -f conftest* # Check for the existence in of lldiv_t, et. al. ac_c99_stdlib=yes; echo $ac_n "checking for lldiv_t declaration""... $ac_c" 1>&6 -echo "configure:3304: checking for lldiv_t declaration" >&5 +echo "configure:3293: checking for lldiv_t declaration" >&5 if eval "test \"`echo '$''{'ac_c99_lldiv_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { lldiv_t mydivt; ; return 0; } EOF -if { (eval echo configure:3317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_c99_lldiv_t=yes else @@ -3329,16 +3318,16 @@ fi echo "$ac_t""$ac_c99_lldiv_t" 1>&6 echo $ac_n "checking for ISO C99 support in ""... $ac_c" 1>&6 -echo "configure:3333: checking for ISO C99 support in " >&5 +echo "configure:3322: checking for ISO C99 support in " >&5 cat > conftest.$ac_ext < int main() { char* tmp; strtof("gnu", &tmp); ; return 0; } EOF -if { (eval echo configure:3342: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3331: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3348,14 +3337,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { char* tmp; strtold("gnu", &tmp); ; return 0; } EOF -if { (eval echo configure:3359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3365,14 +3354,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { char* tmp; strtoll("gnu", &tmp, 10); ; return 0; } EOF -if { (eval echo configure:3376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3382,14 +3371,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { char* tmp; strtoull("gnu", &tmp, 10); ; return 0; } EOF -if { (eval echo configure:3393: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3399,14 +3388,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { llabs(10); ; return 0; } EOF -if { (eval echo configure:3410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3416,14 +3405,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { lldiv(10,1); ; return 0; } EOF -if { (eval echo configure:3427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3433,14 +3422,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { atoll("10"); ; return 0; } EOF -if { (eval echo configure:3444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3433: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3450,14 +3439,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { _Exit(0); ; return 0; } EOF -if { (eval echo configure:3461: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3475,16 +3464,16 @@ rm -f conftest* # XXX the wchar.h checks should be rolled into the general C99 bits. ac_c99_wchar=yes; echo $ac_n "checking for additional ISO C99 support in ""... $ac_c" 1>&6 -echo "configure:3479: checking for additional ISO C99 support in " >&5 +echo "configure:3468: checking for additional ISO C99 support in " >&5 cat > conftest.$ac_ext < int main() { wcstold(L"10.0", NULL); ; return 0; } EOF -if { (eval echo configure:3488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3477: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3494,14 +3483,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { wcstoll(L"10", NULL, 10); ; return 0; } EOF -if { (eval echo configure:3505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3511,14 +3500,14 @@ else fi rm -f conftest* cat > conftest.$ac_ext < int main() { wcstoull(L"10", NULL, 10); ; return 0; } EOF -if { (eval echo configure:3522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3511: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -3530,7 +3519,7 @@ rm -f conftest* echo "$ac_t""$ac_c99_wchar" 1>&6 echo $ac_n "checking for enabled ISO C99 support""... $ac_c" 1>&6 -echo "configure:3534: checking for enabled ISO C99 support" >&5 +echo "configure:3523: checking for enabled ISO C99 support" >&5 if test x"$ac_c99_math" = x"no" || test x"$ac_c99_stdio" = x"no" || test x"$ac_c99_stdlib" = x"no" || @@ -3577,7 +3566,7 @@ fi # Option parsed, now set things appropriately echo $ac_n "checking for enabled long long support""... $ac_c" 1>&6 -echo "configure:3581: checking for enabled long long support" >&5 +echo "configure:3570: checking for enabled long long support" >&5 if test x"$enable_long_long" = xyes; then cat >> confdefs.h <<\EOF #define _GLIBCPP_USE_LONG_LONG 1 @@ -3587,7 +3576,7 @@ EOF echo "$ac_t""$enable_long_long" 1>&6 echo $ac_n "checking for c header strategy to use""... $ac_c" 1>&6 -echo "configure:3591: checking for c header strategy to use" >&5 +echo "configure:3580: checking for c header strategy to use" >&5 # Check whether --enable-cheaders or --disable-cheaders was given. if test "${enable_cheaders+set}" = set; then enableval="$enable_cheaders" @@ -3644,7 +3633,7 @@ fi echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6 -echo "configure:3648: checking for thread model used by GCC" >&5 +echo "configure:3637: checking for thread model used by GCC" >&5 target_thread_file=`$CC -v 2>&1 | sed -n 's/^Thread model: //p'` echo "$ac_t""$target_thread_file" 1>&6 @@ -3697,7 +3686,7 @@ EXTRA_CXX_FLAGS="$enable_cxx_flags" echo $ac_n "checking for exception model to use""... $ac_c" 1>&6 -echo "configure:3701: checking for exception model to use" >&5 +echo "configure:3690: checking for exception model to use" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -3712,7 +3701,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then : else cat > conftest.$ac_ext << EOF -#line 3716 "configure" +#line 3705 "configure" struct S { ~S(); }; void bar(); void foo() @@ -3723,7 +3712,7 @@ void foo() EOF old_CXXFLAGS="$CXXFLAGS" CXXFLAGS=-S - if { (eval echo configure:3727: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:3716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1 ; then enable_sjlj_exceptions=yes elif grep _Unwind_Resume conftest.s >/dev/null 2>&1 ; then @@ -3782,17 +3771,17 @@ if test -n "$with_cross_host" || test x"$build" != x"$host"; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3786: checking for $ac_hdr" >&5 +echo "configure:3775: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3796: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3848,12 +3837,12 @@ done # used sections, first .eh_frame and now some of the glibc sections for # iconv). Bzzzzt. Thanks for playing, maybe next time. echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6 -echo "configure:3852: checking for ld that supports -Wl,--gc-sections" >&5 +echo "configure:3841: checking for ld that supports -Wl,--gc-sections" >&5 if test "$cross_compiling" = yes; then ac_sectionLDflags=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_sectionLDflags=yes else @@ -4143,7 +4132,7 @@ EOF fi echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:4147: checking for main in -lm" >&5 +echo "configure:4136: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4151,14 +4140,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4188,12 +4177,12 @@ fi for ac_func in nan hypot hypotf copysignf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4192: checking for $ac_func" >&5 +echo "configure:4181: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4250,12 +4239,12 @@ done for ac_func in hypotl signbitl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4254: checking for $ac_func" >&5 +echo "configure:4243: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4311,16 +4300,16 @@ done echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6 -echo "configure:4315: checking for mbstate_t" >&5 +echo "configure:4304: checking for mbstate_t" >&5 cat > conftest.$ac_ext < int main() { mbstate_t teststate; ; return 0; } EOF -if { (eval echo configure:4324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_mbstate_t=yes else @@ -4342,17 +4331,17 @@ EOF do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4346: checking for $ac_hdr" >&5 +echo "configure:4335: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4381,17 +4370,17 @@ done ac_safe=`echo "wctype.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for wctype.h""... $ac_c" 1>&6 -echo "configure:4385: checking for wctype.h" >&5 +echo "configure:4374: checking for wctype.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4419,16 +4408,16 @@ fi test x"$enable_c_mbchar" != xno; then echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6 -echo "configure:4423: checking for WCHAR_MIN and WCHAR_MAX" >&5 +echo "configure:4412: checking for WCHAR_MIN and WCHAR_MAX" >&5 cat > conftest.$ac_ext < int main() { int i = WCHAR_MIN; int j = WCHAR_MAX; ; return 0; } EOF -if { (eval echo configure:4432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* has_wchar_minmax=yes else @@ -4441,9 +4430,9 @@ rm -f conftest* echo "$ac_t""$has_wchar_minmax" 1>&6 echo $ac_n "checking for WEOF""... $ac_c" 1>&6 -echo "configure:4445: checking for WEOF" >&5 +echo "configure:4434: checking for WEOF" >&5 cat > conftest.$ac_ext < @@ -4452,7 +4441,7 @@ int main() { wint_t i = WEOF; ; return 0; } EOF -if { (eval echo configure:4456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* has_weof=yes else @@ -4468,12 +4457,12 @@ rm -f conftest* for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4472: checking for $ac_func" >&5 +echo "configure:4461: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4531,12 +4520,12 @@ done wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4535: checking for $ac_func" >&5 +echo "configure:4524: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4587,7 +4576,7 @@ done echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6 -echo "configure:4591: checking for ISO C99 wchar_t support" >&5 +echo "configure:4580: checking for ISO C99 wchar_t support" >&5 if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes && test x"$ac_wfuncs" = xyes; then @@ -4599,17 +4588,17 @@ echo "configure:4591: checking for ISO C99 wchar_t support" >&5 ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for iconv.h""... $ac_c" 1>&6 -echo "configure:4603: checking for iconv.h" >&5 +echo "configure:4592: checking for iconv.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4613: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4602: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4633,17 +4622,17 @@ fi ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6 -echo "configure:4637: checking for langinfo.h" >&5 +echo "configure:4626: checking for langinfo.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4647: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4667,7 +4656,7 @@ fi echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6 -echo "configure:4671: checking for iconv in -liconv" >&5 +echo "configure:4660: checking for iconv in -liconv" >&5 ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4675,7 +4664,7 @@ else ac_save_LIBS="$LIBS" LIBS="-liconv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4712,12 +4701,12 @@ fi for ac_func in iconv_open iconv_close iconv nl_langinfo do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4716: checking for $ac_func" >&5 +echo "configure:4705: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4770,7 +4759,7 @@ done LIBS="$ac_save_LIBS" echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6 -echo "configure:4774: checking for XPG2 wchar_t support" >&5 +echo "configure:4763: checking for XPG2 wchar_t support" >&5 if test x"$ac_has_iconv_h" = xyes && test x"$ac_has_langinfo_h" = xyes && test x"$ac_XPG2funcs" = xyes; then @@ -4781,7 +4770,7 @@ echo "configure:4774: checking for XPG2 wchar_t support" >&5 echo "$ac_t""$ac_XPG2_wchar_t" 1>&6 echo $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6 -echo "configure:4785: checking for enabled wchar_t specializations" >&5 +echo "configure:4774: checking for enabled wchar_t specializations" >&5 if test x"$ac_isoC99_wchar_t" = xyes && test x"$ac_XPG2_wchar_t" = xyes; then cat >> confdefs.h <<\EOF @@ -4855,17 +4844,17 @@ else do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4859: checking for $ac_hdr" >&5 +echo "configure:4848: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4916,10 +4905,10 @@ cross_compiling=$ac_cv_prog_cxx_cross # Check for -ffunction-sections -fdata-sections echo $ac_n "checking for g++ that supports -ffunction-sections -fdata-sections""... $ac_c" 1>&6 -echo "configure:4920: checking for g++ that supports -ffunction-sections -fdata-sections" >&5 +echo "configure:4909: checking for g++ that supports -ffunction-sections -fdata-sections" >&5 CXXFLAGS='-Werror -ffunction-sections -fdata-sections' cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4920: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_fdsections=yes else @@ -4985,12 +4974,12 @@ cross_compiling=$ac_cv_prog_cc_cross # used sections, first .eh_frame and now some of the glibc sections for # iconv). Bzzzzt. Thanks for playing, maybe next time. echo $ac_n "checking for ld that supports -Wl,--gc-sections""... $ac_c" 1>&6 -echo "configure:4989: checking for ld that supports -Wl,--gc-sections" >&5 +echo "configure:4978: checking for ld that supports -Wl,--gc-sections" >&5 if test "$cross_compiling" = yes; then ac_sectionLDflags=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_sectionLDflags=yes else @@ -5037,7 +5026,7 @@ fi echo $ac_n "checking for __builtin_abs declaration""... $ac_c" 1>&6 -echo "configure:5041: checking for __builtin_abs declaration" >&5 +echo "configure:5030: checking for __builtin_abs declaration" >&5 if test x${glibcpp_cv_func___builtin_abs_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_abs_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5052,14 +5041,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { __builtin_abs(0); ; return 0; } EOF -if { (eval echo configure:5063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func___builtin_abs_use=yes else @@ -5083,21 +5072,21 @@ fi echo "$ac_t""$glibcpp_cv_func___builtin_abs_use" 1>&6 if test x$glibcpp_cv_func___builtin_abs_use = x"yes"; then echo $ac_n "checking for __builtin_abs linkage""... $ac_c" 1>&6 -echo "configure:5087: checking for __builtin_abs linkage" >&5 +echo "configure:5076: checking for __builtin_abs linkage" >&5 if test x${glibcpp_cv_func___builtin_abs_link+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_abs_link'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { __builtin_abs(0); ; return 0; } EOF -if { (eval echo configure:5101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* glibcpp_cv_func___builtin_abs_link=yes else @@ -5123,7 +5112,7 @@ EOF echo $ac_n "checking for __builtin_fabsf declaration""... $ac_c" 1>&6 -echo "configure:5127: checking for __builtin_fabsf declaration" >&5 +echo "configure:5116: checking for __builtin_fabsf declaration" >&5 if test x${glibcpp_cv_func___builtin_fabsf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fabsf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5138,14 +5127,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { __builtin_fabsf(0); ; return 0; } EOF -if { (eval echo configure:5149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5138: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func___builtin_fabsf_use=yes else @@ -5169,21 +5158,21 @@ fi echo "$ac_t""$glibcpp_cv_func___builtin_fabsf_use" 1>&6 if test x$glibcpp_cv_func___builtin_fabsf_use = x"yes"; then echo $ac_n "checking for __builtin_fabsf linkage""... $ac_c" 1>&6 -echo "configure:5173: checking for __builtin_fabsf linkage" >&5 +echo "configure:5162: checking for __builtin_fabsf linkage" >&5 if test x${glibcpp_cv_func___builtin_fabsf_link+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fabsf_link'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { __builtin_fabsf(0); ; return 0; } EOF -if { (eval echo configure:5187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* glibcpp_cv_func___builtin_fabsf_link=yes else @@ -5209,7 +5198,7 @@ EOF echo $ac_n "checking for __builtin_fabs declaration""... $ac_c" 1>&6 -echo "configure:5213: checking for __builtin_fabs declaration" >&5 +echo "configure:5202: checking for __builtin_fabs declaration" >&5 if test x${glibcpp_cv_func___builtin_fabs_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fabs_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5224,14 +5213,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { __builtin_fabs(0); ; return 0; } EOF -if { (eval echo configure:5235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5224: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func___builtin_fabs_use=yes else @@ -5255,21 +5244,21 @@ fi echo "$ac_t""$glibcpp_cv_func___builtin_fabs_use" 1>&6 if test x$glibcpp_cv_func___builtin_fabs_use = x"yes"; then echo $ac_n "checking for __builtin_fabs linkage""... $ac_c" 1>&6 -echo "configure:5259: checking for __builtin_fabs linkage" >&5 +echo "configure:5248: checking for __builtin_fabs linkage" >&5 if test x${glibcpp_cv_func___builtin_fabs_link+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fabs_link'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { __builtin_fabs(0); ; return 0; } EOF -if { (eval echo configure:5273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* glibcpp_cv_func___builtin_fabs_link=yes else @@ -5295,7 +5284,7 @@ EOF echo $ac_n "checking for __builtin_fabsl declaration""... $ac_c" 1>&6 -echo "configure:5299: checking for __builtin_fabsl declaration" >&5 +echo "configure:5288: checking for __builtin_fabsl declaration" >&5 if test x${glibcpp_cv_func___builtin_fabsl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fabsl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5310,14 +5299,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { __builtin_fabsl(0); ; return 0; } EOF -if { (eval echo configure:5321: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func___builtin_fabsl_use=yes else @@ -5341,21 +5330,21 @@ fi echo "$ac_t""$glibcpp_cv_func___builtin_fabsl_use" 1>&6 if test x$glibcpp_cv_func___builtin_fabsl_use = x"yes"; then echo $ac_n "checking for __builtin_fabsl linkage""... $ac_c" 1>&6 -echo "configure:5345: checking for __builtin_fabsl linkage" >&5 +echo "configure:5334: checking for __builtin_fabsl linkage" >&5 if test x${glibcpp_cv_func___builtin_fabsl_link+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fabsl_link'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { __builtin_fabsl(0); ; return 0; } EOF -if { (eval echo configure:5359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* glibcpp_cv_func___builtin_fabsl_link=yes else @@ -5381,7 +5370,7 @@ EOF echo $ac_n "checking for __builtin_labs declaration""... $ac_c" 1>&6 -echo "configure:5385: checking for __builtin_labs declaration" >&5 +echo "configure:5374: checking for __builtin_labs declaration" >&5 if test x${glibcpp_cv_func___builtin_labs_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_labs_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5396,14 +5385,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { __builtin_labs(0); ; return 0; } EOF -if { (eval echo configure:5407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func___builtin_labs_use=yes else @@ -5427,21 +5416,21 @@ fi echo "$ac_t""$glibcpp_cv_func___builtin_labs_use" 1>&6 if test x$glibcpp_cv_func___builtin_labs_use = x"yes"; then echo $ac_n "checking for __builtin_labs linkage""... $ac_c" 1>&6 -echo "configure:5431: checking for __builtin_labs linkage" >&5 +echo "configure:5420: checking for __builtin_labs linkage" >&5 if test x${glibcpp_cv_func___builtin_labs_link+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_labs_link'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { __builtin_labs(0); ; return 0; } EOF -if { (eval echo configure:5445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* glibcpp_cv_func___builtin_labs_link=yes else @@ -5468,7 +5457,7 @@ EOF echo $ac_n "checking for __builtin_sqrtf declaration""... $ac_c" 1>&6 -echo "configure:5472: checking for __builtin_sqrtf declaration" >&5 +echo "configure:5461: checking for __builtin_sqrtf declaration" >&5 if test x${glibcpp_cv_func___builtin_sqrtf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sqrtf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5483,14 +5472,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { __builtin_sqrtf(0); ; return 0; } EOF -if { (eval echo configure:5494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func___builtin_sqrtf_use=yes else @@ -5514,21 +5503,21 @@ fi echo "$ac_t""$glibcpp_cv_func___builtin_sqrtf_use" 1>&6 if test x$glibcpp_cv_func___builtin_sqrtf_use = x"yes"; then echo $ac_n "checking for __builtin_sqrtf linkage""... $ac_c" 1>&6 -echo "configure:5518: checking for __builtin_sqrtf linkage" >&5 +echo "configure:5507: checking for __builtin_sqrtf linkage" >&5 if test x${glibcpp_cv_func___builtin_sqrtf_link+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sqrtf_link'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { __builtin_sqrtf(0); ; return 0; } EOF -if { (eval echo configure:5532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* glibcpp_cv_func___builtin_sqrtf_link=yes else @@ -5554,7 +5543,7 @@ EOF echo $ac_n "checking for __builtin_fsqrt declaration""... $ac_c" 1>&6 -echo "configure:5558: checking for __builtin_fsqrt declaration" >&5 +echo "configure:5547: checking for __builtin_fsqrt declaration" >&5 if test x${glibcpp_cv_func___builtin_fsqrt_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fsqrt_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5569,14 +5558,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { __builtin_fsqrt(0); ; return 0; } EOF -if { (eval echo configure:5580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func___builtin_fsqrt_use=yes else @@ -5600,21 +5589,21 @@ fi echo "$ac_t""$glibcpp_cv_func___builtin_fsqrt_use" 1>&6 if test x$glibcpp_cv_func___builtin_fsqrt_use = x"yes"; then echo $ac_n "checking for __builtin_fsqrt linkage""... $ac_c" 1>&6 -echo "configure:5604: checking for __builtin_fsqrt linkage" >&5 +echo "configure:5593: checking for __builtin_fsqrt linkage" >&5 if test x${glibcpp_cv_func___builtin_fsqrt_link+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_fsqrt_link'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { __builtin_fsqrt(0); ; return 0; } EOF -if { (eval echo configure:5618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* glibcpp_cv_func___builtin_fsqrt_link=yes else @@ -5640,7 +5629,7 @@ EOF echo $ac_n "checking for __builtin_sqrtl declaration""... $ac_c" 1>&6 -echo "configure:5644: checking for __builtin_sqrtl declaration" >&5 +echo "configure:5633: checking for __builtin_sqrtl declaration" >&5 if test x${glibcpp_cv_func___builtin_sqrtl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sqrtl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5655,14 +5644,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { __builtin_sqrtl(0); ; return 0; } EOF -if { (eval echo configure:5666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5655: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func___builtin_sqrtl_use=yes else @@ -5686,21 +5675,21 @@ fi echo "$ac_t""$glibcpp_cv_func___builtin_sqrtl_use" 1>&6 if test x$glibcpp_cv_func___builtin_sqrtl_use = x"yes"; then echo $ac_n "checking for __builtin_sqrtl linkage""... $ac_c" 1>&6 -echo "configure:5690: checking for __builtin_sqrtl linkage" >&5 +echo "configure:5679: checking for __builtin_sqrtl linkage" >&5 if test x${glibcpp_cv_func___builtin_sqrtl_link+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sqrtl_link'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { __builtin_sqrtl(0); ; return 0; } EOF -if { (eval echo configure:5704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* glibcpp_cv_func___builtin_sqrtl_link=yes else @@ -5727,7 +5716,7 @@ EOF echo $ac_n "checking for __builtin_sinf declaration""... $ac_c" 1>&6 -echo "configure:5731: checking for __builtin_sinf declaration" >&5 +echo "configure:5720: checking for __builtin_sinf declaration" >&5 if test x${glibcpp_cv_func___builtin_sinf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sinf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5742,14 +5731,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { __builtin_sinf(0); ; return 0; } EOF -if { (eval echo configure:5753: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5742: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func___builtin_sinf_use=yes else @@ -5773,21 +5762,21 @@ fi echo "$ac_t""$glibcpp_cv_func___builtin_sinf_use" 1>&6 if test x$glibcpp_cv_func___builtin_sinf_use = x"yes"; then echo $ac_n "checking for __builtin_sinf linkage""... $ac_c" 1>&6 -echo "configure:5777: checking for __builtin_sinf linkage" >&5 +echo "configure:5766: checking for __builtin_sinf linkage" >&5 if test x${glibcpp_cv_func___builtin_sinf_link+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sinf_link'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { __builtin_sinf(0); ; return 0; } EOF -if { (eval echo configure:5791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* glibcpp_cv_func___builtin_sinf_link=yes else @@ -5813,7 +5802,7 @@ EOF echo $ac_n "checking for __builtin_sin declaration""... $ac_c" 1>&6 -echo "configure:5817: checking for __builtin_sin declaration" >&5 +echo "configure:5806: checking for __builtin_sin declaration" >&5 if test x${glibcpp_cv_func___builtin_sin_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sin_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5828,14 +5817,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { __builtin_sin(0); ; return 0; } EOF -if { (eval echo configure:5839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func___builtin_sin_use=yes else @@ -5859,21 +5848,21 @@ fi echo "$ac_t""$glibcpp_cv_func___builtin_sin_use" 1>&6 if test x$glibcpp_cv_func___builtin_sin_use = x"yes"; then echo $ac_n "checking for __builtin_sin linkage""... $ac_c" 1>&6 -echo "configure:5863: checking for __builtin_sin linkage" >&5 +echo "configure:5852: checking for __builtin_sin linkage" >&5 if test x${glibcpp_cv_func___builtin_sin_link+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sin_link'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { __builtin_sin(0); ; return 0; } EOF -if { (eval echo configure:5877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* glibcpp_cv_func___builtin_sin_link=yes else @@ -5899,7 +5888,7 @@ EOF echo $ac_n "checking for __builtin_sinl declaration""... $ac_c" 1>&6 -echo "configure:5903: checking for __builtin_sinl declaration" >&5 +echo "configure:5892: checking for __builtin_sinl declaration" >&5 if test x${glibcpp_cv_func___builtin_sinl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sinl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5914,14 +5903,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { __builtin_sinl(0); ; return 0; } EOF -if { (eval echo configure:5925: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func___builtin_sinl_use=yes else @@ -5945,21 +5934,21 @@ fi echo "$ac_t""$glibcpp_cv_func___builtin_sinl_use" 1>&6 if test x$glibcpp_cv_func___builtin_sinl_use = x"yes"; then echo $ac_n "checking for __builtin_sinl linkage""... $ac_c" 1>&6 -echo "configure:5949: checking for __builtin_sinl linkage" >&5 +echo "configure:5938: checking for __builtin_sinl linkage" >&5 if test x${glibcpp_cv_func___builtin_sinl_link+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_sinl_link'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { __builtin_sinl(0); ; return 0; } EOF -if { (eval echo configure:5963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* glibcpp_cv_func___builtin_sinl_link=yes else @@ -5986,7 +5975,7 @@ EOF echo $ac_n "checking for __builtin_cosf declaration""... $ac_c" 1>&6 -echo "configure:5990: checking for __builtin_cosf declaration" >&5 +echo "configure:5979: checking for __builtin_cosf declaration" >&5 if test x${glibcpp_cv_func___builtin_cosf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_cosf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6001,14 +5990,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { __builtin_cosf(0); ; return 0; } EOF -if { (eval echo configure:6012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func___builtin_cosf_use=yes else @@ -6032,21 +6021,21 @@ fi echo "$ac_t""$glibcpp_cv_func___builtin_cosf_use" 1>&6 if test x$glibcpp_cv_func___builtin_cosf_use = x"yes"; then echo $ac_n "checking for __builtin_cosf linkage""... $ac_c" 1>&6 -echo "configure:6036: checking for __builtin_cosf linkage" >&5 +echo "configure:6025: checking for __builtin_cosf linkage" >&5 if test x${glibcpp_cv_func___builtin_cosf_link+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_cosf_link'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { __builtin_cosf(0); ; return 0; } EOF -if { (eval echo configure:6050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* glibcpp_cv_func___builtin_cosf_link=yes else @@ -6072,7 +6061,7 @@ EOF echo $ac_n "checking for __builtin_cos declaration""... $ac_c" 1>&6 -echo "configure:6076: checking for __builtin_cos declaration" >&5 +echo "configure:6065: checking for __builtin_cos declaration" >&5 if test x${glibcpp_cv_func___builtin_cos_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_cos_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6087,14 +6076,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { __builtin_cos(0); ; return 0; } EOF -if { (eval echo configure:6098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func___builtin_cos_use=yes else @@ -6118,21 +6107,21 @@ fi echo "$ac_t""$glibcpp_cv_func___builtin_cos_use" 1>&6 if test x$glibcpp_cv_func___builtin_cos_use = x"yes"; then echo $ac_n "checking for __builtin_cos linkage""... $ac_c" 1>&6 -echo "configure:6122: checking for __builtin_cos linkage" >&5 +echo "configure:6111: checking for __builtin_cos linkage" >&5 if test x${glibcpp_cv_func___builtin_cos_link+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_cos_link'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { __builtin_cos(0); ; return 0; } EOF -if { (eval echo configure:6136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* glibcpp_cv_func___builtin_cos_link=yes else @@ -6158,7 +6147,7 @@ EOF echo $ac_n "checking for __builtin_cosl declaration""... $ac_c" 1>&6 -echo "configure:6162: checking for __builtin_cosl declaration" >&5 +echo "configure:6151: checking for __builtin_cosl declaration" >&5 if test x${glibcpp_cv_func___builtin_cosl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_cosl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6173,14 +6162,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { __builtin_cosl(0); ; return 0; } EOF -if { (eval echo configure:6184: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func___builtin_cosl_use=yes else @@ -6204,21 +6193,21 @@ fi echo "$ac_t""$glibcpp_cv_func___builtin_cosl_use" 1>&6 if test x$glibcpp_cv_func___builtin_cosl_use = x"yes"; then echo $ac_n "checking for __builtin_cosl linkage""... $ac_c" 1>&6 -echo "configure:6208: checking for __builtin_cosl linkage" >&5 +echo "configure:6197: checking for __builtin_cosl linkage" >&5 if test x${glibcpp_cv_func___builtin_cosl_link+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func___builtin_cosl_link'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { __builtin_cosl(0); ; return 0; } EOF -if { (eval echo configure:6222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* glibcpp_cv_func___builtin_cosl_link=yes else @@ -6309,7 +6298,7 @@ EOF CXXFLAGS='-fno-builtins -D_GNU_SOURCE' echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6 -echo "configure:6313: checking for sin in -lm" >&5 +echo "configure:6302: checking for sin in -lm" >&5 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6317,7 +6306,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6354,7 +6343,7 @@ fi echo $ac_n "checking for isinf declaration""... $ac_c" 1>&6 -echo "configure:6358: checking for isinf declaration" >&5 +echo "configure:6347: checking for isinf declaration" >&5 if test x${glibcpp_cv_func_isinf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_isinf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6369,7 +6358,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -6380,7 +6369,7 @@ int main() { isinf(0); ; return 0; } EOF -if { (eval echo configure:6384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_isinf_use=yes else @@ -6407,12 +6396,12 @@ fi for ac_func in isinf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6411: checking for $ac_func" >&5 +echo "configure:6400: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6462,7 +6451,7 @@ done else echo $ac_n "checking for _isinf declaration""... $ac_c" 1>&6 -echo "configure:6466: checking for _isinf declaration" >&5 +echo "configure:6455: checking for _isinf declaration" >&5 if test x${glibcpp_cv_func__isinf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__isinf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6477,7 +6466,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -6488,7 +6477,7 @@ int main() { _isinf(0); ; return 0; } EOF -if { (eval echo configure:6492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6481: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__isinf_use=yes else @@ -6515,12 +6504,12 @@ fi for ac_func in _isinf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6519: checking for $ac_func" >&5 +echo "configure:6508: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6573,7 +6562,7 @@ done echo $ac_n "checking for isnan declaration""... $ac_c" 1>&6 -echo "configure:6577: checking for isnan declaration" >&5 +echo "configure:6566: checking for isnan declaration" >&5 if test x${glibcpp_cv_func_isnan_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_isnan_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6588,7 +6577,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -6599,7 +6588,7 @@ int main() { isnan(0); ; return 0; } EOF -if { (eval echo configure:6603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_isnan_use=yes else @@ -6626,12 +6615,12 @@ fi for ac_func in isnan do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6630: checking for $ac_func" >&5 +echo "configure:6619: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6681,7 +6670,7 @@ done else echo $ac_n "checking for _isnan declaration""... $ac_c" 1>&6 -echo "configure:6685: checking for _isnan declaration" >&5 +echo "configure:6674: checking for _isnan declaration" >&5 if test x${glibcpp_cv_func__isnan_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__isnan_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6696,7 +6685,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -6707,7 +6696,7 @@ int main() { _isnan(0); ; return 0; } EOF -if { (eval echo configure:6711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6700: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__isnan_use=yes else @@ -6734,12 +6723,12 @@ fi for ac_func in _isnan do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6738: checking for $ac_func" >&5 +echo "configure:6727: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6792,7 +6781,7 @@ done echo $ac_n "checking for finite declaration""... $ac_c" 1>&6 -echo "configure:6796: checking for finite declaration" >&5 +echo "configure:6785: checking for finite declaration" >&5 if test x${glibcpp_cv_func_finite_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_finite_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6807,7 +6796,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -6818,7 +6807,7 @@ int main() { finite(0); ; return 0; } EOF -if { (eval echo configure:6822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_finite_use=yes else @@ -6845,12 +6834,12 @@ fi for ac_func in finite do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6849: checking for $ac_func" >&5 +echo "configure:6838: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -6900,7 +6889,7 @@ done else echo $ac_n "checking for _finite declaration""... $ac_c" 1>&6 -echo "configure:6904: checking for _finite declaration" >&5 +echo "configure:6893: checking for _finite declaration" >&5 if test x${glibcpp_cv_func__finite_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__finite_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6915,7 +6904,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -6926,7 +6915,7 @@ int main() { _finite(0); ; return 0; } EOF -if { (eval echo configure:6930: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6919: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__finite_use=yes else @@ -6953,12 +6942,12 @@ fi for ac_func in _finite do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6957: checking for $ac_func" >&5 +echo "configure:6946: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7011,7 +7000,7 @@ done echo $ac_n "checking for copysign declaration""... $ac_c" 1>&6 -echo "configure:7015: checking for copysign declaration" >&5 +echo "configure:7004: checking for copysign declaration" >&5 if test x${glibcpp_cv_func_copysign_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_copysign_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7026,14 +7015,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { copysign(0, 0); ; return 0; } EOF -if { (eval echo configure:7037: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7026: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_copysign_use=yes else @@ -7060,12 +7049,12 @@ fi for ac_func in copysign do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7064: checking for $ac_func" >&5 +echo "configure:7053: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7115,7 +7104,7 @@ done else echo $ac_n "checking for _copysign declaration""... $ac_c" 1>&6 -echo "configure:7119: checking for _copysign declaration" >&5 +echo "configure:7108: checking for _copysign declaration" >&5 if test x${glibcpp_cv_func__copysign_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__copysign_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7130,14 +7119,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _copysign(0, 0); ; return 0; } EOF -if { (eval echo configure:7141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__copysign_use=yes else @@ -7164,12 +7153,12 @@ fi for ac_func in _copysign do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7168: checking for $ac_func" >&5 +echo "configure:7157: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7222,7 +7211,7 @@ done echo $ac_n "checking for sincos declaration""... $ac_c" 1>&6 -echo "configure:7226: checking for sincos declaration" >&5 +echo "configure:7215: checking for sincos declaration" >&5 if test x${glibcpp_cv_func_sincos_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_sincos_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7237,14 +7226,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { sincos(0, 0, 0); ; return 0; } EOF -if { (eval echo configure:7248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_sincos_use=yes else @@ -7271,12 +7260,12 @@ fi for ac_func in sincos do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7275: checking for $ac_func" >&5 +echo "configure:7264: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7326,7 +7315,7 @@ done else echo $ac_n "checking for _sincos declaration""... $ac_c" 1>&6 -echo "configure:7330: checking for _sincos declaration" >&5 +echo "configure:7319: checking for _sincos declaration" >&5 if test x${glibcpp_cv_func__sincos_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__sincos_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7341,14 +7330,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _sincos(0, 0, 0); ; return 0; } EOF -if { (eval echo configure:7352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7341: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__sincos_use=yes else @@ -7375,12 +7364,12 @@ fi for ac_func in _sincos do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7379: checking for $ac_func" >&5 +echo "configure:7368: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7433,7 +7422,7 @@ done echo $ac_n "checking for fpclass declaration""... $ac_c" 1>&6 -echo "configure:7437: checking for fpclass declaration" >&5 +echo "configure:7426: checking for fpclass declaration" >&5 if test x${glibcpp_cv_func_fpclass_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_fpclass_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7448,7 +7437,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -7459,7 +7448,7 @@ int main() { fpclass(0); ; return 0; } EOF -if { (eval echo configure:7463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_fpclass_use=yes else @@ -7486,12 +7475,12 @@ fi for ac_func in fpclass do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7490: checking for $ac_func" >&5 +echo "configure:7479: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7541,7 +7530,7 @@ done else echo $ac_n "checking for _fpclass declaration""... $ac_c" 1>&6 -echo "configure:7545: checking for _fpclass declaration" >&5 +echo "configure:7534: checking for _fpclass declaration" >&5 if test x${glibcpp_cv_func__fpclass_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__fpclass_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7556,7 +7545,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -7567,7 +7556,7 @@ int main() { _fpclass(0); ; return 0; } EOF -if { (eval echo configure:7571: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__fpclass_use=yes else @@ -7594,12 +7583,12 @@ fi for ac_func in _fpclass do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7598: checking for $ac_func" >&5 +echo "configure:7587: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7652,7 +7641,7 @@ done echo $ac_n "checking for qfpclass declaration""... $ac_c" 1>&6 -echo "configure:7656: checking for qfpclass declaration" >&5 +echo "configure:7645: checking for qfpclass declaration" >&5 if test x${glibcpp_cv_func_qfpclass_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_qfpclass_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7667,7 +7656,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -7678,7 +7667,7 @@ int main() { qfpclass(0); ; return 0; } EOF -if { (eval echo configure:7682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_qfpclass_use=yes else @@ -7705,12 +7694,12 @@ fi for ac_func in qfpclass do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7709: checking for $ac_func" >&5 +echo "configure:7698: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7760,7 +7749,7 @@ done else echo $ac_n "checking for _qfpclass declaration""... $ac_c" 1>&6 -echo "configure:7764: checking for _qfpclass declaration" >&5 +echo "configure:7753: checking for _qfpclass declaration" >&5 if test x${glibcpp_cv_func__qfpclass_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__qfpclass_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7775,7 +7764,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -7786,7 +7775,7 @@ int main() { _qfpclass(0); ; return 0; } EOF -if { (eval echo configure:7790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7779: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__qfpclass_use=yes else @@ -7813,12 +7802,12 @@ fi for ac_func in _qfpclass do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7817: checking for $ac_func" >&5 +echo "configure:7806: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7871,7 +7860,7 @@ done echo $ac_n "checking for float trig functions""... $ac_c" 1>&6 -echo "configure:7875: checking for float trig functions" >&5 +echo "configure:7864: checking for float trig functions" >&5 if eval "test \"`echo '$''{'glibcpp_cv_func_float_trig_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7885,7 +7874,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { @@ -7894,7 +7883,7 @@ int main() { coshf sinhf tanhf; do echo "$x (0);"; done` ; return 0; } EOF -if { (eval echo configure:7898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_float_trig_use=yes else @@ -7920,12 +7909,12 @@ fi coshf sinhf tanhf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7924: checking for $ac_func" >&5 +echo "configure:7913: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7976,7 +7965,7 @@ done echo $ac_n "checking for float round functions""... $ac_c" 1>&6 -echo "configure:7980: checking for float round functions" >&5 +echo "configure:7969: checking for float round functions" >&5 if eval "test \"`echo '$''{'glibcpp_cv_func_float_round_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7990,14 +7979,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { `for x in ceilf floorf; do echo "$x (0);"; done` ; return 0; } EOF -if { (eval echo configure:8001: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_float_round_use=yes else @@ -8021,12 +8010,12 @@ fi for ac_func in ceilf floorf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8025: checking for $ac_func" >&5 +echo "configure:8014: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8078,7 +8067,7 @@ done echo $ac_n "checking for isnanf declaration""... $ac_c" 1>&6 -echo "configure:8082: checking for isnanf declaration" >&5 +echo "configure:8071: checking for isnanf declaration" >&5 if test x${glibcpp_cv_func_isnanf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_isnanf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8093,7 +8082,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -8104,7 +8093,7 @@ int main() { isnanf(0); ; return 0; } EOF -if { (eval echo configure:8108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_isnanf_use=yes else @@ -8131,12 +8120,12 @@ fi for ac_func in isnanf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8135: checking for $ac_func" >&5 +echo "configure:8124: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8186,7 +8175,7 @@ done else echo $ac_n "checking for _isnanf declaration""... $ac_c" 1>&6 -echo "configure:8190: checking for _isnanf declaration" >&5 +echo "configure:8179: checking for _isnanf declaration" >&5 if test x${glibcpp_cv_func__isnanf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__isnanf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8201,7 +8190,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -8212,7 +8201,7 @@ int main() { _isnanf(0); ; return 0; } EOF -if { (eval echo configure:8216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8205: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__isnanf_use=yes else @@ -8239,12 +8228,12 @@ fi for ac_func in _isnanf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8243: checking for $ac_func" >&5 +echo "configure:8232: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8297,7 +8286,7 @@ done echo $ac_n "checking for isinff declaration""... $ac_c" 1>&6 -echo "configure:8301: checking for isinff declaration" >&5 +echo "configure:8290: checking for isinff declaration" >&5 if test x${glibcpp_cv_func_isinff_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_isinff_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8312,7 +8301,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -8323,7 +8312,7 @@ int main() { isinff(0); ; return 0; } EOF -if { (eval echo configure:8327: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_isinff_use=yes else @@ -8350,12 +8339,12 @@ fi for ac_func in isinff do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8354: checking for $ac_func" >&5 +echo "configure:8343: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8405,7 +8394,7 @@ done else echo $ac_n "checking for _isinff declaration""... $ac_c" 1>&6 -echo "configure:8409: checking for _isinff declaration" >&5 +echo "configure:8398: checking for _isinff declaration" >&5 if test x${glibcpp_cv_func__isinff_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__isinff_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8420,7 +8409,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -8431,7 +8420,7 @@ int main() { _isinff(0); ; return 0; } EOF -if { (eval echo configure:8435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8424: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__isinff_use=yes else @@ -8458,12 +8447,12 @@ fi for ac_func in _isinff do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8462: checking for $ac_func" >&5 +echo "configure:8451: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8516,7 +8505,7 @@ done echo $ac_n "checking for fabsf declaration""... $ac_c" 1>&6 -echo "configure:8520: checking for fabsf declaration" >&5 +echo "configure:8509: checking for fabsf declaration" >&5 if test x${glibcpp_cv_func_fabsf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_fabsf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8531,7 +8520,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -8542,7 +8531,7 @@ int main() { fabsf(0); ; return 0; } EOF -if { (eval echo configure:8546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_fabsf_use=yes else @@ -8569,12 +8558,12 @@ fi for ac_func in fabsf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8573: checking for $ac_func" >&5 +echo "configure:8562: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8624,7 +8613,7 @@ done else echo $ac_n "checking for _fabsf declaration""... $ac_c" 1>&6 -echo "configure:8628: checking for _fabsf declaration" >&5 +echo "configure:8617: checking for _fabsf declaration" >&5 if test x${glibcpp_cv_func__fabsf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__fabsf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8639,7 +8628,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -8650,7 +8639,7 @@ int main() { _fabsf(0); ; return 0; } EOF -if { (eval echo configure:8654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__fabsf_use=yes else @@ -8677,12 +8666,12 @@ fi for ac_func in _fabsf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8681: checking for $ac_func" >&5 +echo "configure:8670: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8735,7 +8724,7 @@ done echo $ac_n "checking for fmodf declaration""... $ac_c" 1>&6 -echo "configure:8739: checking for fmodf declaration" >&5 +echo "configure:8728: checking for fmodf declaration" >&5 if test x${glibcpp_cv_func_fmodf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_fmodf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8750,14 +8739,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { fmodf(0, 0); ; return 0; } EOF -if { (eval echo configure:8761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8750: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_fmodf_use=yes else @@ -8784,12 +8773,12 @@ fi for ac_func in fmodf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8788: checking for $ac_func" >&5 +echo "configure:8777: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8839,7 +8828,7 @@ done else echo $ac_n "checking for _fmodf declaration""... $ac_c" 1>&6 -echo "configure:8843: checking for _fmodf declaration" >&5 +echo "configure:8832: checking for _fmodf declaration" >&5 if test x${glibcpp_cv_func__fmodf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__fmodf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8854,14 +8843,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _fmodf(0, 0); ; return 0; } EOF -if { (eval echo configure:8865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8854: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__fmodf_use=yes else @@ -8888,12 +8877,12 @@ fi for ac_func in _fmodf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8892: checking for $ac_func" >&5 +echo "configure:8881: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8946,7 +8935,7 @@ done echo $ac_n "checking for frexpf declaration""... $ac_c" 1>&6 -echo "configure:8950: checking for frexpf declaration" >&5 +echo "configure:8939: checking for frexpf declaration" >&5 if test x${glibcpp_cv_func_frexpf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_frexpf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8961,14 +8950,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { frexpf(0, 0); ; return 0; } EOF -if { (eval echo configure:8972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8961: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_frexpf_use=yes else @@ -8995,12 +8984,12 @@ fi for ac_func in frexpf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8999: checking for $ac_func" >&5 +echo "configure:8988: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9050,7 +9039,7 @@ done else echo $ac_n "checking for _frexpf declaration""... $ac_c" 1>&6 -echo "configure:9054: checking for _frexpf declaration" >&5 +echo "configure:9043: checking for _frexpf declaration" >&5 if test x${glibcpp_cv_func__frexpf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__frexpf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9065,14 +9054,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _frexpf(0, 0); ; return 0; } EOF -if { (eval echo configure:9076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__frexpf_use=yes else @@ -9099,12 +9088,12 @@ fi for ac_func in _frexpf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9103: checking for $ac_func" >&5 +echo "configure:9092: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9157,7 +9146,7 @@ done echo $ac_n "checking for ldexpf declaration""... $ac_c" 1>&6 -echo "configure:9161: checking for ldexpf declaration" >&5 +echo "configure:9150: checking for ldexpf declaration" >&5 if test x${glibcpp_cv_func_ldexpf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_ldexpf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9172,14 +9161,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { ldexpf(0, 0); ; return 0; } EOF -if { (eval echo configure:9183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_ldexpf_use=yes else @@ -9206,12 +9195,12 @@ fi for ac_func in ldexpf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9210: checking for $ac_func" >&5 +echo "configure:9199: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9261,7 +9250,7 @@ done else echo $ac_n "checking for _ldexpf declaration""... $ac_c" 1>&6 -echo "configure:9265: checking for _ldexpf declaration" >&5 +echo "configure:9254: checking for _ldexpf declaration" >&5 if test x${glibcpp_cv_func__ldexpf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__ldexpf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9276,14 +9265,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _ldexpf(0, 0); ; return 0; } EOF -if { (eval echo configure:9287: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__ldexpf_use=yes else @@ -9310,12 +9299,12 @@ fi for ac_func in _ldexpf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9314: checking for $ac_func" >&5 +echo "configure:9303: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9368,7 +9357,7 @@ done echo $ac_n "checking for logf declaration""... $ac_c" 1>&6 -echo "configure:9372: checking for logf declaration" >&5 +echo "configure:9361: checking for logf declaration" >&5 if test x${glibcpp_cv_func_logf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_logf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9383,7 +9372,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -9394,7 +9383,7 @@ int main() { logf(0); ; return 0; } EOF -if { (eval echo configure:9398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9387: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_logf_use=yes else @@ -9421,12 +9410,12 @@ fi for ac_func in logf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9425: checking for $ac_func" >&5 +echo "configure:9414: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9476,7 +9465,7 @@ done else echo $ac_n "checking for _logf declaration""... $ac_c" 1>&6 -echo "configure:9480: checking for _logf declaration" >&5 +echo "configure:9469: checking for _logf declaration" >&5 if test x${glibcpp_cv_func__logf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__logf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9491,7 +9480,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -9502,7 +9491,7 @@ int main() { _logf(0); ; return 0; } EOF -if { (eval echo configure:9506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__logf_use=yes else @@ -9529,12 +9518,12 @@ fi for ac_func in _logf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9533: checking for $ac_func" >&5 +echo "configure:9522: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9587,7 +9576,7 @@ done echo $ac_n "checking for log10f declaration""... $ac_c" 1>&6 -echo "configure:9591: checking for log10f declaration" >&5 +echo "configure:9580: checking for log10f declaration" >&5 if test x${glibcpp_cv_func_log10f_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_log10f_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9602,7 +9591,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -9613,7 +9602,7 @@ int main() { log10f(0); ; return 0; } EOF -if { (eval echo configure:9617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9606: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_log10f_use=yes else @@ -9640,12 +9629,12 @@ fi for ac_func in log10f do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9644: checking for $ac_func" >&5 +echo "configure:9633: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9695,7 +9684,7 @@ done else echo $ac_n "checking for _log10f declaration""... $ac_c" 1>&6 -echo "configure:9699: checking for _log10f declaration" >&5 +echo "configure:9688: checking for _log10f declaration" >&5 if test x${glibcpp_cv_func__log10f_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__log10f_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9710,7 +9699,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -9721,7 +9710,7 @@ int main() { _log10f(0); ; return 0; } EOF -if { (eval echo configure:9725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9714: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__log10f_use=yes else @@ -9748,12 +9737,12 @@ fi for ac_func in _log10f do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9752: checking for $ac_func" >&5 +echo "configure:9741: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9806,7 +9795,7 @@ done echo $ac_n "checking for modff declaration""... $ac_c" 1>&6 -echo "configure:9810: checking for modff declaration" >&5 +echo "configure:9799: checking for modff declaration" >&5 if test x${glibcpp_cv_func_modff_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_modff_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9821,14 +9810,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { modff(0, 0); ; return 0; } EOF -if { (eval echo configure:9832: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9821: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_modff_use=yes else @@ -9855,12 +9844,12 @@ fi for ac_func in modff do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9859: checking for $ac_func" >&5 +echo "configure:9848: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -9910,7 +9899,7 @@ done else echo $ac_n "checking for _modff declaration""... $ac_c" 1>&6 -echo "configure:9914: checking for _modff declaration" >&5 +echo "configure:9903: checking for _modff declaration" >&5 if test x${glibcpp_cv_func__modff_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__modff_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9925,14 +9914,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _modff(0, 0); ; return 0; } EOF -if { (eval echo configure:9936: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9925: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__modff_use=yes else @@ -9959,12 +9948,12 @@ fi for ac_func in _modff do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:9963: checking for $ac_func" >&5 +echo "configure:9952: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10017,7 +10006,7 @@ done echo $ac_n "checking for powf declaration""... $ac_c" 1>&6 -echo "configure:10021: checking for powf declaration" >&5 +echo "configure:10010: checking for powf declaration" >&5 if test x${glibcpp_cv_func_powf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_powf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -10032,14 +10021,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { powf(0, 0); ; return 0; } EOF -if { (eval echo configure:10043: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10032: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_powf_use=yes else @@ -10066,12 +10055,12 @@ fi for ac_func in powf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10070: checking for $ac_func" >&5 +echo "configure:10059: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10121,7 +10110,7 @@ done else echo $ac_n "checking for _powf declaration""... $ac_c" 1>&6 -echo "configure:10125: checking for _powf declaration" >&5 +echo "configure:10114: checking for _powf declaration" >&5 if test x${glibcpp_cv_func__powf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__powf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -10136,14 +10125,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _powf(0, 0); ; return 0; } EOF -if { (eval echo configure:10147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10136: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__powf_use=yes else @@ -10170,12 +10159,12 @@ fi for ac_func in _powf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10174: checking for $ac_func" >&5 +echo "configure:10163: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10228,7 +10217,7 @@ done echo $ac_n "checking for sqrtf declaration""... $ac_c" 1>&6 -echo "configure:10232: checking for sqrtf declaration" >&5 +echo "configure:10221: checking for sqrtf declaration" >&5 if test x${glibcpp_cv_func_sqrtf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_sqrtf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -10243,7 +10232,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -10254,7 +10243,7 @@ int main() { sqrtf(0); ; return 0; } EOF -if { (eval echo configure:10258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_sqrtf_use=yes else @@ -10281,12 +10270,12 @@ fi for ac_func in sqrtf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10285: checking for $ac_func" >&5 +echo "configure:10274: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10336,7 +10325,7 @@ done else echo $ac_n "checking for _sqrtf declaration""... $ac_c" 1>&6 -echo "configure:10340: checking for _sqrtf declaration" >&5 +echo "configure:10329: checking for _sqrtf declaration" >&5 if test x${glibcpp_cv_func__sqrtf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__sqrtf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -10351,7 +10340,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -10362,7 +10351,7 @@ int main() { _sqrtf(0); ; return 0; } EOF -if { (eval echo configure:10366: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__sqrtf_use=yes else @@ -10389,12 +10378,12 @@ fi for ac_func in _sqrtf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10393: checking for $ac_func" >&5 +echo "configure:10382: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10447,7 +10436,7 @@ done echo $ac_n "checking for sincosf declaration""... $ac_c" 1>&6 -echo "configure:10451: checking for sincosf declaration" >&5 +echo "configure:10440: checking for sincosf declaration" >&5 if test x${glibcpp_cv_func_sincosf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_sincosf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -10462,14 +10451,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { sincosf(0, 0, 0); ; return 0; } EOF -if { (eval echo configure:10473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_sincosf_use=yes else @@ -10496,12 +10485,12 @@ fi for ac_func in sincosf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10500: checking for $ac_func" >&5 +echo "configure:10489: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10551,7 +10540,7 @@ done else echo $ac_n "checking for _sincosf declaration""... $ac_c" 1>&6 -echo "configure:10555: checking for _sincosf declaration" >&5 +echo "configure:10544: checking for _sincosf declaration" >&5 if test x${glibcpp_cv_func__sincosf_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__sincosf_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -10566,14 +10555,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _sincosf(0, 0, 0); ; return 0; } EOF -if { (eval echo configure:10577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__sincosf_use=yes else @@ -10600,12 +10589,12 @@ fi for ac_func in _sincosf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10604: checking for $ac_func" >&5 +echo "configure:10593: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10658,7 +10647,7 @@ done echo $ac_n "checking for finitef declaration""... $ac_c" 1>&6 -echo "configure:10662: checking for finitef declaration" >&5 +echo "configure:10651: checking for finitef declaration" >&5 if test x${glibcpp_cv_func_finitef_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_finitef_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -10673,7 +10662,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -10684,7 +10673,7 @@ int main() { finitef(0); ; return 0; } EOF -if { (eval echo configure:10688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_finitef_use=yes else @@ -10711,12 +10700,12 @@ fi for ac_func in finitef do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10715: checking for $ac_func" >&5 +echo "configure:10704: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10766,7 +10755,7 @@ done else echo $ac_n "checking for _finitef declaration""... $ac_c" 1>&6 -echo "configure:10770: checking for _finitef declaration" >&5 +echo "configure:10759: checking for _finitef declaration" >&5 if test x${glibcpp_cv_func__finitef_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__finitef_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -10781,7 +10770,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -10792,7 +10781,7 @@ int main() { _finitef(0); ; return 0; } EOF -if { (eval echo configure:10796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10785: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__finitef_use=yes else @@ -10819,12 +10808,12 @@ fi for ac_func in _finitef do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10823: checking for $ac_func" >&5 +echo "configure:10812: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10877,7 +10866,7 @@ done echo $ac_n "checking for long double trig functions""... $ac_c" 1>&6 -echo "configure:10881: checking for long double trig functions" >&5 +echo "configure:10870: checking for long double trig functions" >&5 if eval "test \"`echo '$''{'glibcpp_cv_func_long_double_trig_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -10891,7 +10880,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { @@ -10900,7 +10889,7 @@ int main() { coshl sinhl tanhl; do echo "$x (0);"; done` ; return 0; } EOF -if { (eval echo configure:10904: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_long_double_trig_use=yes else @@ -10926,12 +10915,12 @@ fi coshl sinhl tanhl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10930: checking for $ac_func" >&5 +echo "configure:10919: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10982,7 +10971,7 @@ done echo $ac_n "checking for long double round functions""... $ac_c" 1>&6 -echo "configure:10986: checking for long double round functions" >&5 +echo "configure:10975: checking for long double round functions" >&5 if eval "test \"`echo '$''{'glibcpp_cv_func_long_double_round_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -10996,14 +10985,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { `for x in ceill floorl; do echo "$x (0);"; done` ; return 0; } EOF -if { (eval echo configure:11007: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:10996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_long_double_round_use=yes else @@ -11027,12 +11016,12 @@ fi for ac_func in ceill floorl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11031: checking for $ac_func" >&5 +echo "configure:11020: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11084,7 +11073,7 @@ done echo $ac_n "checking for isnanl declaration""... $ac_c" 1>&6 -echo "configure:11088: checking for isnanl declaration" >&5 +echo "configure:11077: checking for isnanl declaration" >&5 if test x${glibcpp_cv_func_isnanl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_isnanl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11099,7 +11088,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -11110,7 +11099,7 @@ int main() { isnanl(0); ; return 0; } EOF -if { (eval echo configure:11114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11103: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_isnanl_use=yes else @@ -11137,12 +11126,12 @@ fi for ac_func in isnanl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11141: checking for $ac_func" >&5 +echo "configure:11130: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11192,7 +11181,7 @@ done else echo $ac_n "checking for _isnanl declaration""... $ac_c" 1>&6 -echo "configure:11196: checking for _isnanl declaration" >&5 +echo "configure:11185: checking for _isnanl declaration" >&5 if test x${glibcpp_cv_func__isnanl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__isnanl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11207,7 +11196,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -11218,7 +11207,7 @@ int main() { _isnanl(0); ; return 0; } EOF -if { (eval echo configure:11222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__isnanl_use=yes else @@ -11245,12 +11234,12 @@ fi for ac_func in _isnanl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11249: checking for $ac_func" >&5 +echo "configure:11238: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11303,7 +11292,7 @@ done echo $ac_n "checking for isinfl declaration""... $ac_c" 1>&6 -echo "configure:11307: checking for isinfl declaration" >&5 +echo "configure:11296: checking for isinfl declaration" >&5 if test x${glibcpp_cv_func_isinfl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_isinfl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11318,7 +11307,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -11329,7 +11318,7 @@ int main() { isinfl(0); ; return 0; } EOF -if { (eval echo configure:11333: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_isinfl_use=yes else @@ -11356,12 +11345,12 @@ fi for ac_func in isinfl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11360: checking for $ac_func" >&5 +echo "configure:11349: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11411,7 +11400,7 @@ done else echo $ac_n "checking for _isinfl declaration""... $ac_c" 1>&6 -echo "configure:11415: checking for _isinfl declaration" >&5 +echo "configure:11404: checking for _isinfl declaration" >&5 if test x${glibcpp_cv_func__isinfl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__isinfl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11426,7 +11415,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -11437,7 +11426,7 @@ int main() { _isinfl(0); ; return 0; } EOF -if { (eval echo configure:11441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__isinfl_use=yes else @@ -11464,12 +11453,12 @@ fi for ac_func in _isinfl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11468: checking for $ac_func" >&5 +echo "configure:11457: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11522,7 +11511,7 @@ done echo $ac_n "checking for copysignl declaration""... $ac_c" 1>&6 -echo "configure:11526: checking for copysignl declaration" >&5 +echo "configure:11515: checking for copysignl declaration" >&5 if test x${glibcpp_cv_func_copysignl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_copysignl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11537,14 +11526,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { copysignl(0, 0); ; return 0; } EOF -if { (eval echo configure:11548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_copysignl_use=yes else @@ -11571,12 +11560,12 @@ fi for ac_func in copysignl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11575: checking for $ac_func" >&5 +echo "configure:11564: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11626,7 +11615,7 @@ done else echo $ac_n "checking for _copysignl declaration""... $ac_c" 1>&6 -echo "configure:11630: checking for _copysignl declaration" >&5 +echo "configure:11619: checking for _copysignl declaration" >&5 if test x${glibcpp_cv_func__copysignl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__copysignl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11641,14 +11630,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _copysignl(0, 0); ; return 0; } EOF -if { (eval echo configure:11652: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__copysignl_use=yes else @@ -11675,12 +11664,12 @@ fi for ac_func in _copysignl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11679: checking for $ac_func" >&5 +echo "configure:11668: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11733,7 +11722,7 @@ done echo $ac_n "checking for atan2l declaration""... $ac_c" 1>&6 -echo "configure:11737: checking for atan2l declaration" >&5 +echo "configure:11726: checking for atan2l declaration" >&5 if test x${glibcpp_cv_func_atan2l_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_atan2l_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11748,14 +11737,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { atan2l(0, 0); ; return 0; } EOF -if { (eval echo configure:11759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_atan2l_use=yes else @@ -11782,12 +11771,12 @@ fi for ac_func in atan2l do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11786: checking for $ac_func" >&5 +echo "configure:11775: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11837,7 +11826,7 @@ done else echo $ac_n "checking for _atan2l declaration""... $ac_c" 1>&6 -echo "configure:11841: checking for _atan2l declaration" >&5 +echo "configure:11830: checking for _atan2l declaration" >&5 if test x${glibcpp_cv_func__atan2l_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__atan2l_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11852,14 +11841,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _atan2l(0, 0); ; return 0; } EOF -if { (eval echo configure:11863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__atan2l_use=yes else @@ -11886,12 +11875,12 @@ fi for ac_func in _atan2l do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11890: checking for $ac_func" >&5 +echo "configure:11879: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11944,7 +11933,7 @@ done echo $ac_n "checking for expl declaration""... $ac_c" 1>&6 -echo "configure:11948: checking for expl declaration" >&5 +echo "configure:11937: checking for expl declaration" >&5 if test x${glibcpp_cv_func_expl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_expl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11959,7 +11948,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -11970,7 +11959,7 @@ int main() { expl(0); ; return 0; } EOF -if { (eval echo configure:11974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_expl_use=yes else @@ -11997,12 +11986,12 @@ fi for ac_func in expl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12001: checking for $ac_func" >&5 +echo "configure:11990: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12052,7 +12041,7 @@ done else echo $ac_n "checking for _expl declaration""... $ac_c" 1>&6 -echo "configure:12056: checking for _expl declaration" >&5 +echo "configure:12045: checking for _expl declaration" >&5 if test x${glibcpp_cv_func__expl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__expl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12067,7 +12056,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -12078,7 +12067,7 @@ int main() { _expl(0); ; return 0; } EOF -if { (eval echo configure:12082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__expl_use=yes else @@ -12105,12 +12094,12 @@ fi for ac_func in _expl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12109: checking for $ac_func" >&5 +echo "configure:12098: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12163,7 +12152,7 @@ done echo $ac_n "checking for fabsl declaration""... $ac_c" 1>&6 -echo "configure:12167: checking for fabsl declaration" >&5 +echo "configure:12156: checking for fabsl declaration" >&5 if test x${glibcpp_cv_func_fabsl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_fabsl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12178,7 +12167,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -12189,7 +12178,7 @@ int main() { fabsl(0); ; return 0; } EOF -if { (eval echo configure:12193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12182: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_fabsl_use=yes else @@ -12216,12 +12205,12 @@ fi for ac_func in fabsl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12220: checking for $ac_func" >&5 +echo "configure:12209: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12271,7 +12260,7 @@ done else echo $ac_n "checking for _fabsl declaration""... $ac_c" 1>&6 -echo "configure:12275: checking for _fabsl declaration" >&5 +echo "configure:12264: checking for _fabsl declaration" >&5 if test x${glibcpp_cv_func__fabsl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__fabsl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12286,7 +12275,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -12297,7 +12286,7 @@ int main() { _fabsl(0); ; return 0; } EOF -if { (eval echo configure:12301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__fabsl_use=yes else @@ -12324,12 +12313,12 @@ fi for ac_func in _fabsl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12328: checking for $ac_func" >&5 +echo "configure:12317: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12382,7 +12371,7 @@ done echo $ac_n "checking for fmodl declaration""... $ac_c" 1>&6 -echo "configure:12386: checking for fmodl declaration" >&5 +echo "configure:12375: checking for fmodl declaration" >&5 if test x${glibcpp_cv_func_fmodl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_fmodl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12397,14 +12386,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { fmodl(0, 0); ; return 0; } EOF -if { (eval echo configure:12408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_fmodl_use=yes else @@ -12431,12 +12420,12 @@ fi for ac_func in fmodl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12435: checking for $ac_func" >&5 +echo "configure:12424: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12486,7 +12475,7 @@ done else echo $ac_n "checking for _fmodl declaration""... $ac_c" 1>&6 -echo "configure:12490: checking for _fmodl declaration" >&5 +echo "configure:12479: checking for _fmodl declaration" >&5 if test x${glibcpp_cv_func__fmodl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__fmodl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12501,14 +12490,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _fmodl(0, 0); ; return 0; } EOF -if { (eval echo configure:12512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__fmodl_use=yes else @@ -12535,12 +12524,12 @@ fi for ac_func in _fmodl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12539: checking for $ac_func" >&5 +echo "configure:12528: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12593,7 +12582,7 @@ done echo $ac_n "checking for frexpl declaration""... $ac_c" 1>&6 -echo "configure:12597: checking for frexpl declaration" >&5 +echo "configure:12586: checking for frexpl declaration" >&5 if test x${glibcpp_cv_func_frexpl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_frexpl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12608,14 +12597,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { frexpl(0, 0); ; return 0; } EOF -if { (eval echo configure:12619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_frexpl_use=yes else @@ -12642,12 +12631,12 @@ fi for ac_func in frexpl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12646: checking for $ac_func" >&5 +echo "configure:12635: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12697,7 +12686,7 @@ done else echo $ac_n "checking for _frexpl declaration""... $ac_c" 1>&6 -echo "configure:12701: checking for _frexpl declaration" >&5 +echo "configure:12690: checking for _frexpl declaration" >&5 if test x${glibcpp_cv_func__frexpl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__frexpl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12712,14 +12701,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _frexpl(0, 0); ; return 0; } EOF -if { (eval echo configure:12723: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__frexpl_use=yes else @@ -12746,12 +12735,12 @@ fi for ac_func in _frexpl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12750: checking for $ac_func" >&5 +echo "configure:12739: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12804,7 +12793,7 @@ done echo $ac_n "checking for ldexpl declaration""... $ac_c" 1>&6 -echo "configure:12808: checking for ldexpl declaration" >&5 +echo "configure:12797: checking for ldexpl declaration" >&5 if test x${glibcpp_cv_func_ldexpl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_ldexpl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12819,14 +12808,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { ldexpl(0, 0); ; return 0; } EOF -if { (eval echo configure:12830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_ldexpl_use=yes else @@ -12853,12 +12842,12 @@ fi for ac_func in ldexpl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12857: checking for $ac_func" >&5 +echo "configure:12846: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12908,7 +12897,7 @@ done else echo $ac_n "checking for _ldexpl declaration""... $ac_c" 1>&6 -echo "configure:12912: checking for _ldexpl declaration" >&5 +echo "configure:12901: checking for _ldexpl declaration" >&5 if test x${glibcpp_cv_func__ldexpl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__ldexpl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12923,14 +12912,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _ldexpl(0, 0); ; return 0; } EOF -if { (eval echo configure:12934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__ldexpl_use=yes else @@ -12957,12 +12946,12 @@ fi for ac_func in _ldexpl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12961: checking for $ac_func" >&5 +echo "configure:12950: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13015,7 +13004,7 @@ done echo $ac_n "checking for logl declaration""... $ac_c" 1>&6 -echo "configure:13019: checking for logl declaration" >&5 +echo "configure:13008: checking for logl declaration" >&5 if test x${glibcpp_cv_func_logl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_logl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -13030,7 +13019,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -13041,7 +13030,7 @@ int main() { logl(0); ; return 0; } EOF -if { (eval echo configure:13045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13034: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_logl_use=yes else @@ -13068,12 +13057,12 @@ fi for ac_func in logl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13072: checking for $ac_func" >&5 +echo "configure:13061: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13123,7 +13112,7 @@ done else echo $ac_n "checking for _logl declaration""... $ac_c" 1>&6 -echo "configure:13127: checking for _logl declaration" >&5 +echo "configure:13116: checking for _logl declaration" >&5 if test x${glibcpp_cv_func__logl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__logl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -13138,7 +13127,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -13149,7 +13138,7 @@ int main() { _logl(0); ; return 0; } EOF -if { (eval echo configure:13153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__logl_use=yes else @@ -13176,12 +13165,12 @@ fi for ac_func in _logl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13180: checking for $ac_func" >&5 +echo "configure:13169: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13234,7 +13223,7 @@ done echo $ac_n "checking for log10l declaration""... $ac_c" 1>&6 -echo "configure:13238: checking for log10l declaration" >&5 +echo "configure:13227: checking for log10l declaration" >&5 if test x${glibcpp_cv_func_log10l_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_log10l_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -13249,7 +13238,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -13260,7 +13249,7 @@ int main() { log10l(0); ; return 0; } EOF -if { (eval echo configure:13264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13253: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_log10l_use=yes else @@ -13287,12 +13276,12 @@ fi for ac_func in log10l do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13291: checking for $ac_func" >&5 +echo "configure:13280: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13342,7 +13331,7 @@ done else echo $ac_n "checking for _log10l declaration""... $ac_c" 1>&6 -echo "configure:13346: checking for _log10l declaration" >&5 +echo "configure:13335: checking for _log10l declaration" >&5 if test x${glibcpp_cv_func__log10l_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__log10l_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -13357,7 +13346,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -13368,7 +13357,7 @@ int main() { _log10l(0); ; return 0; } EOF -if { (eval echo configure:13372: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__log10l_use=yes else @@ -13395,12 +13384,12 @@ fi for ac_func in _log10l do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13399: checking for $ac_func" >&5 +echo "configure:13388: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13453,7 +13442,7 @@ done echo $ac_n "checking for modfl declaration""... $ac_c" 1>&6 -echo "configure:13457: checking for modfl declaration" >&5 +echo "configure:13446: checking for modfl declaration" >&5 if test x${glibcpp_cv_func_modfl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_modfl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -13468,14 +13457,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { modfl(0, 0); ; return 0; } EOF -if { (eval echo configure:13479: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13468: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_modfl_use=yes else @@ -13502,12 +13491,12 @@ fi for ac_func in modfl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13506: checking for $ac_func" >&5 +echo "configure:13495: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13557,7 +13546,7 @@ done else echo $ac_n "checking for _modfl declaration""... $ac_c" 1>&6 -echo "configure:13561: checking for _modfl declaration" >&5 +echo "configure:13550: checking for _modfl declaration" >&5 if test x${glibcpp_cv_func__modfl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__modfl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -13572,14 +13561,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _modfl(0, 0); ; return 0; } EOF -if { (eval echo configure:13583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__modfl_use=yes else @@ -13606,12 +13595,12 @@ fi for ac_func in _modfl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13610: checking for $ac_func" >&5 +echo "configure:13599: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13664,7 +13653,7 @@ done echo $ac_n "checking for powl declaration""... $ac_c" 1>&6 -echo "configure:13668: checking for powl declaration" >&5 +echo "configure:13657: checking for powl declaration" >&5 if test x${glibcpp_cv_func_powl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_powl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -13679,14 +13668,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { powl(0, 0); ; return 0; } EOF -if { (eval echo configure:13690: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13679: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_powl_use=yes else @@ -13713,12 +13702,12 @@ fi for ac_func in powl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13717: checking for $ac_func" >&5 +echo "configure:13706: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13768,7 +13757,7 @@ done else echo $ac_n "checking for _powl declaration""... $ac_c" 1>&6 -echo "configure:13772: checking for _powl declaration" >&5 +echo "configure:13761: checking for _powl declaration" >&5 if test x${glibcpp_cv_func__powl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__powl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -13783,14 +13772,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _powl(0, 0); ; return 0; } EOF -if { (eval echo configure:13794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13783: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__powl_use=yes else @@ -13817,12 +13806,12 @@ fi for ac_func in _powl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13821: checking for $ac_func" >&5 +echo "configure:13810: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13838: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13875,7 +13864,7 @@ done echo $ac_n "checking for sqrtl declaration""... $ac_c" 1>&6 -echo "configure:13879: checking for sqrtl declaration" >&5 +echo "configure:13868: checking for sqrtl declaration" >&5 if test x${glibcpp_cv_func_sqrtl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_sqrtl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -13890,7 +13879,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -13901,7 +13890,7 @@ int main() { sqrtl(0); ; return 0; } EOF -if { (eval echo configure:13905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:13894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_sqrtl_use=yes else @@ -13928,12 +13917,12 @@ fi for ac_func in sqrtl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:13932: checking for $ac_func" >&5 +echo "configure:13921: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:13949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13983,7 +13972,7 @@ done else echo $ac_n "checking for _sqrtl declaration""... $ac_c" 1>&6 -echo "configure:13987: checking for _sqrtl declaration" >&5 +echo "configure:13976: checking for _sqrtl declaration" >&5 if test x${glibcpp_cv_func__sqrtl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__sqrtl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -13998,7 +13987,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -14009,7 +13998,7 @@ int main() { _sqrtl(0); ; return 0; } EOF -if { (eval echo configure:14013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__sqrtl_use=yes else @@ -14036,12 +14025,12 @@ fi for ac_func in _sqrtl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14040: checking for $ac_func" >&5 +echo "configure:14029: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -14094,7 +14083,7 @@ done echo $ac_n "checking for sincosl declaration""... $ac_c" 1>&6 -echo "configure:14098: checking for sincosl declaration" >&5 +echo "configure:14087: checking for sincosl declaration" >&5 if test x${glibcpp_cv_func_sincosl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_sincosl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -14109,14 +14098,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { sincosl(0, 0, 0); ; return 0; } EOF -if { (eval echo configure:14120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_sincosl_use=yes else @@ -14143,12 +14132,12 @@ fi for ac_func in sincosl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14147: checking for $ac_func" >&5 +echo "configure:14136: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -14198,7 +14187,7 @@ done else echo $ac_n "checking for _sincosl declaration""... $ac_c" 1>&6 -echo "configure:14202: checking for _sincosl declaration" >&5 +echo "configure:14191: checking for _sincosl declaration" >&5 if test x${glibcpp_cv_func__sincosl_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__sincosl_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -14213,14 +14202,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { _sincosl(0, 0, 0); ; return 0; } EOF -if { (eval echo configure:14224: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__sincosl_use=yes else @@ -14247,12 +14236,12 @@ fi for ac_func in _sincosl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14251: checking for $ac_func" >&5 +echo "configure:14240: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -14305,7 +14294,7 @@ done echo $ac_n "checking for finitel declaration""... $ac_c" 1>&6 -echo "configure:14309: checking for finitel declaration" >&5 +echo "configure:14298: checking for finitel declaration" >&5 if test x${glibcpp_cv_func_finitel_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_finitel_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -14320,7 +14309,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -14331,7 +14320,7 @@ int main() { finitel(0); ; return 0; } EOF -if { (eval echo configure:14335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_finitel_use=yes else @@ -14358,12 +14347,12 @@ fi for ac_func in finitel do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14362: checking for $ac_func" >&5 +echo "configure:14351: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -14413,7 +14402,7 @@ done else echo $ac_n "checking for _finitel declaration""... $ac_c" 1>&6 -echo "configure:14417: checking for _finitel declaration" >&5 +echo "configure:14406: checking for _finitel declaration" >&5 if test x${glibcpp_cv_func__finitel_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func__finitel_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -14428,7 +14417,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < #ifdef HAVE_IEEEFP_H @@ -14439,7 +14428,7 @@ int main() { _finitel(0); ; return 0; } EOF -if { (eval echo configure:14443: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__finitel_use=yes else @@ -14466,12 +14455,12 @@ fi for ac_func in _finitel do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14470: checking for $ac_func" >&5 +echo "configure:14459: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -14525,7 +14514,7 @@ done echo $ac_n "checking for _float trig functions""... $ac_c" 1>&6 -echo "configure:14529: checking for _float trig functions" >&5 +echo "configure:14518: checking for _float trig functions" >&5 if eval "test \"`echo '$''{'glibcpp_cv_func__float_trig_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -14539,7 +14528,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { @@ -14548,7 +14537,7 @@ int main() { _coshf _sinhf _tanhf; do echo "$x (0);"; done` ; return 0; } EOF -if { (eval echo configure:14552: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__float_trig_use=yes else @@ -14574,12 +14563,12 @@ fi _coshf _sinhf _tanhf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14578: checking for $ac_func" >&5 +echo "configure:14567: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -14630,7 +14619,7 @@ done echo $ac_n "checking for _float round functions""... $ac_c" 1>&6 -echo "configure:14634: checking for _float round functions" >&5 +echo "configure:14623: checking for _float round functions" >&5 if eval "test \"`echo '$''{'glibcpp_cv_func__float_round_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -14644,14 +14633,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { `for x in _ceilf _floorf; do echo "$x (0);"; done` ; return 0; } EOF -if { (eval echo configure:14655: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__float_round_use=yes else @@ -14675,12 +14664,12 @@ fi for ac_func in _ceilf _floorf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14679: checking for $ac_func" >&5 +echo "configure:14668: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -14732,7 +14721,7 @@ done echo $ac_n "checking for _long double trig functions""... $ac_c" 1>&6 -echo "configure:14736: checking for _long double trig functions" >&5 +echo "configure:14725: checking for _long double trig functions" >&5 if eval "test \"`echo '$''{'glibcpp_cv_func__long_double_trig_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -14746,7 +14735,7 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { @@ -14755,7 +14744,7 @@ int main() { _coshl _sinhl _tanhl; do echo "$x (0);"; done` ; return 0; } EOF -if { (eval echo configure:14759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__long_double_trig_use=yes else @@ -14781,12 +14770,12 @@ fi _coshl _sinhl _tanhl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14785: checking for $ac_func" >&5 +echo "configure:14774: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -14837,7 +14826,7 @@ done echo $ac_n "checking for _long double round functions""... $ac_c" 1>&6 -echo "configure:14841: checking for _long double round functions" >&5 +echo "configure:14830: checking for _long double round functions" >&5 if eval "test \"`echo '$''{'glibcpp_cv_func__long_double_round_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -14851,14 +14840,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { `for x in _ceill _floorl; do echo "$x (0);"; done` ; return 0; } EOF -if { (eval echo configure:14862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:14851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func__long_double_round_use=yes else @@ -14882,12 +14871,12 @@ fi for ac_func in _ceill _floorl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14886: checking for $ac_func" >&5 +echo "configure:14875: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -14942,7 +14931,7 @@ done echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:14946: checking for main in -lm" >&5 +echo "configure:14935: checking for main in -lm" >&5 ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -14950,14 +14939,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:14950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -14987,12 +14976,12 @@ fi for ac_func in nan hypot hypotf copysignf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:14991: checking for $ac_func" >&5 +echo "configure:14980: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15049,12 +15038,12 @@ done for ac_func in hypotl signbitl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:15053: checking for $ac_func" >&5 +echo "configure:15042: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15110,16 +15099,16 @@ done echo $ac_n "checking for mbstate_t""... $ac_c" 1>&6 -echo "configure:15114: checking for mbstate_t" >&5 +echo "configure:15103: checking for mbstate_t" >&5 cat > conftest.$ac_ext < int main() { mbstate_t teststate; ; return 0; } EOF -if { (eval echo configure:15123: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:15112: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* have_mbstate_t=yes else @@ -15141,17 +15130,17 @@ EOF do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:15145: checking for $ac_hdr" >&5 +echo "configure:15134: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:15155: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:15144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -15180,17 +15169,17 @@ done ac_safe=`echo "wctype.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for wctype.h""... $ac_c" 1>&6 -echo "configure:15184: checking for wctype.h" >&5 +echo "configure:15173: checking for wctype.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:15194: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:15183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -15218,16 +15207,16 @@ fi test x"$enable_c_mbchar" != xno; then echo $ac_n "checking for WCHAR_MIN and WCHAR_MAX""... $ac_c" 1>&6 -echo "configure:15222: checking for WCHAR_MIN and WCHAR_MAX" >&5 +echo "configure:15211: checking for WCHAR_MIN and WCHAR_MAX" >&5 cat > conftest.$ac_ext < int main() { int i = WCHAR_MIN; int j = WCHAR_MAX; ; return 0; } EOF -if { (eval echo configure:15231: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:15220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* has_wchar_minmax=yes else @@ -15240,9 +15229,9 @@ rm -f conftest* echo "$ac_t""$has_wchar_minmax" 1>&6 echo $ac_n "checking for WEOF""... $ac_c" 1>&6 -echo "configure:15244: checking for WEOF" >&5 +echo "configure:15233: checking for WEOF" >&5 cat > conftest.$ac_ext < @@ -15251,7 +15240,7 @@ int main() { wint_t i = WEOF; ; return 0; } EOF -if { (eval echo configure:15255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:15244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* has_weof=yes else @@ -15267,12 +15256,12 @@ rm -f conftest* for ac_func in wcslen wmemchr wmemcmp wmemcpy wmemmove wmemset do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:15271: checking for $ac_func" >&5 +echo "configure:15260: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15330,12 +15319,12 @@ done wcscspn wcsspn wcstok wcsftime wcschr wcspbrk wcsrchr wcsstr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:15334: checking for $ac_func" >&5 +echo "configure:15323: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15386,7 +15375,7 @@ done echo $ac_n "checking for ISO C99 wchar_t support""... $ac_c" 1>&6 -echo "configure:15390: checking for ISO C99 wchar_t support" >&5 +echo "configure:15379: checking for ISO C99 wchar_t support" >&5 if test x"$has_weof" = xyes && test x"$has_wchar_minmax" = xyes && test x"$ac_wfuncs" = xyes; then @@ -15398,17 +15387,17 @@ echo "configure:15390: checking for ISO C99 wchar_t support" >&5 ac_safe=`echo "iconv.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for iconv.h""... $ac_c" 1>&6 -echo "configure:15402: checking for iconv.h" >&5 +echo "configure:15391: checking for iconv.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:15412: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:15401: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -15432,17 +15421,17 @@ fi ac_safe=`echo "langinfo.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for langinfo.h""... $ac_c" 1>&6 -echo "configure:15436: checking for langinfo.h" >&5 +echo "configure:15425: checking for langinfo.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:15446: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:15435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -15466,7 +15455,7 @@ fi echo $ac_n "checking for iconv in -liconv""... $ac_c" 1>&6 -echo "configure:15470: checking for iconv in -liconv" >&5 +echo "configure:15459: checking for iconv in -liconv" >&5 ac_lib_var=`echo iconv'_'iconv | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -15474,7 +15463,7 @@ else ac_save_LIBS="$LIBS" LIBS="-liconv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -15511,12 +15500,12 @@ fi for ac_func in iconv_open iconv_close iconv nl_langinfo do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:15515: checking for $ac_func" >&5 +echo "configure:15504: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15569,7 +15558,7 @@ done LIBS="$ac_save_LIBS" echo $ac_n "checking for XPG2 wchar_t support""... $ac_c" 1>&6 -echo "configure:15573: checking for XPG2 wchar_t support" >&5 +echo "configure:15562: checking for XPG2 wchar_t support" >&5 if test x"$ac_has_iconv_h" = xyes && test x"$ac_has_langinfo_h" = xyes && test x"$ac_XPG2funcs" = xyes; then @@ -15580,7 +15569,7 @@ echo "configure:15573: checking for XPG2 wchar_t support" >&5 echo "$ac_t""$ac_XPG2_wchar_t" 1>&6 echo $ac_n "checking for enabled wchar_t specializations""... $ac_c" 1>&6 -echo "configure:15584: checking for enabled wchar_t specializations" >&5 +echo "configure:15573: checking for enabled wchar_t specializations" >&5 if test x"$ac_isoC99_wchar_t" = xyes && test x"$ac_XPG2_wchar_t" = xyes; then cat >> confdefs.h <<\EOF @@ -15602,7 +15591,7 @@ EOF echo $ac_n "checking for strtold declaration""... $ac_c" 1>&6 -echo "configure:15606: checking for strtold declaration" >&5 +echo "configure:15595: checking for strtold declaration" >&5 if test x${glibcpp_cv_func_strtold_use+set} != xset; then if eval "test \"`echo '$''{'glibcpp_cv_func_strtold_use'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -15617,14 +15606,14 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < int main() { strtold(0, 0); ; return 0; } EOF -if { (eval echo configure:15628: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:15617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* glibcpp_cv_func_strtold_use=yes else @@ -15650,12 +15639,12 @@ fi for ac_func in strtold do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:15654: checking for $ac_func" >&5 +echo "configure:15643: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15707,12 +15696,12 @@ done for ac_func in drand48 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:15711: checking for $ac_func" >&5 +echo "configure:15700: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15764,7 +15753,7 @@ done cat > conftest.$ac_ext < @@ -15773,7 +15762,7 @@ int main() { sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1); ; return 0; } EOF -if { (eval echo configure:15777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:15766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_SIGSETJMP 1 @@ -15789,17 +15778,17 @@ rm -f conftest* do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:15793: checking for $ac_hdr" >&5 +echo "configure:15782: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:15803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:15792: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -15828,12 +15817,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:15832: checking for $ac_func" >&5 +echo "configure:15821: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:15849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -15881,7 +15870,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:15885: checking for working mmap" >&5 +echo "configure:15874: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -15889,7 +15878,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:16022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -16121,17 +16110,17 @@ rm -f confcache ac_safe=`echo "locale.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for locale.h""... $ac_c" 1>&6 -echo "configure:16125: checking for locale.h" >&5 +echo "configure:16114: checking for locale.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:16135: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:16124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -16149,19 +16138,19 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:16153: checking for LC_MESSAGES" >&5 +echo "configure:16142: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'ac_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:16165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:16154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_val_LC_MESSAGES=yes else @@ -16214,13 +16203,13 @@ esac glibcpp_prefixdir=${prefix} echo $ac_n "checking for interface version number""... $ac_c" 1>&6 -echo "configure:16218: checking for interface version number" >&5 +echo "configure:16207: 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:16224: checking for --with-gxx-include-dir" >&5 +echo "configure:16213: 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" @@ -16244,7 +16233,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:16248: checking for --enable-version-specific-runtime-libs" >&5 +echo "configure:16237: 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" @@ -16285,7 +16274,7 @@ if test x"$glibcpp_toolexecdir" = x"no"; then fi echo $ac_n "checking for install location""... $ac_c" 1>&6 -echo "configure:16289: checking for install location" >&5 +echo "configure:16278: checking for install location" >&5 echo "$ac_t""$gxx_include_dir" 1>&6 diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index c145b78008b..339607aa447 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -131,254 +131,43 @@ glibcpp_builddir = @glibcpp_builddir@ bits_srcdir = ${glibcpp_srcdir}/include/bits bits_builddir = ./bits -bits_headers = \ - ${bits_srcdir}/basic_file.h \ - ${bits_srcdir}/basic_ios.h \ - ${bits_srcdir}/basic_ios.tcc \ - ${bits_srcdir}/basic_string.h \ - ${bits_srcdir}/basic_string.tcc \ - ${bits_srcdir}/boost_concept_check.h \ - ${bits_srcdir}/char_traits.h \ - ${bits_srcdir}/codecvt.h \ - ${bits_srcdir}/concept_check.h \ - ${bits_srcdir}/cpp_type_traits.h \ - ${bits_srcdir}/fpos.h \ - ${bits_srcdir}/fstream.tcc \ - ${bits_srcdir}/functexcept.h \ - ${bits_srcdir}/generic_shadow.h \ - ${bits_srcdir}/gslice.h \ - ${bits_srcdir}/gslice_array.h \ - ${bits_srcdir}/indirect_array.h \ - ${bits_srcdir}/ios_base.h \ - ${bits_srcdir}/istream.tcc \ - ${bits_srcdir}/locale_facets.h \ - ${bits_srcdir}/locale_facets.tcc \ - ${bits_srcdir}/localefwd.h \ - ${bits_srcdir}/mask_array.h \ - ${bits_srcdir}/ostream.tcc \ - ${bits_srcdir}/pthread_allocimpl.h \ - ${bits_srcdir}/stream_iterator.h \ - ${bits_srcdir}/streambuf_iterator.h \ - ${bits_srcdir}/slice.h \ - ${bits_srcdir}/slice_array.h \ - ${bits_srcdir}/sstream.tcc \ - ${bits_srcdir}/std_algorithm.h \ - ${bits_srcdir}/std_bitset.h \ - ${bits_srcdir}/std_complex.h \ - ${bits_srcdir}/std_deque.h \ - ${bits_srcdir}/std_fstream.h \ - ${bits_srcdir}/std_functional.h \ - ${bits_srcdir}/std_iomanip.h \ - ${bits_srcdir}/std_ios.h \ - ${bits_srcdir}/std_iosfwd.h \ - ${bits_srcdir}/std_iostream.h \ - ${bits_srcdir}/std_istream.h \ - ${bits_srcdir}/std_iterator.h \ - ${bits_srcdir}/std_list.h \ - ${bits_srcdir}/std_locale.h \ - ${bits_srcdir}/std_map.h \ - ${bits_srcdir}/std_memory.h \ - ${bits_srcdir}/std_numeric.h \ - ${bits_srcdir}/std_ostream.h \ - ${bits_srcdir}/std_queue.h \ - ${bits_srcdir}/std_set.h \ - ${bits_srcdir}/std_sstream.h \ - ${bits_srcdir}/std_stack.h \ - ${bits_srcdir}/std_stdexcept.h \ - ${bits_srcdir}/std_streambuf.h \ - ${bits_srcdir}/std_string.h \ - ${bits_srcdir}/std_utility.h \ - ${bits_srcdir}/std_valarray.h \ - ${bits_srcdir}/std_vector.h \ - ${bits_srcdir}/stl_algo.h \ - ${bits_srcdir}/stl_algobase.h \ - ${bits_srcdir}/stl_alloc.h \ - ${bits_srcdir}/stl_bvector.h \ - ${bits_srcdir}/stl_construct.h \ - ${bits_srcdir}/stl_deque.h \ - ${bits_srcdir}/stl_function.h \ - ${bits_srcdir}/stl_heap.h \ - ${bits_srcdir}/stl_iterator.h \ - ${bits_srcdir}/stl_iterator_base_funcs.h \ - ${bits_srcdir}/stl_iterator_base_types.h \ - ${bits_srcdir}/stl_list.h \ - ${bits_srcdir}/stl_map.h \ - ${bits_srcdir}/stl_multimap.h \ - ${bits_srcdir}/stl_multiset.h \ - ${bits_srcdir}/stl_numeric.h \ - ${bits_srcdir}/stl_pair.h \ - ${bits_srcdir}/stl_pthread_alloc.h \ - ${bits_srcdir}/stl_queue.h \ - ${bits_srcdir}/stl_raw_storage_iter.h \ - ${bits_srcdir}/stl_relops.h \ - ${bits_srcdir}/stl_set.h \ - ${bits_srcdir}/stl_stack.h \ - ${bits_srcdir}/stl_tempbuf.h \ - ${bits_srcdir}/stl_threads.h \ - ${bits_srcdir}/stl_tree.h \ - ${bits_srcdir}/stl_uninitialized.h \ - ${bits_srcdir}/stl_vector.h \ - ${bits_srcdir}/streambuf.tcc \ - ${bits_srcdir}/stringfwd.h \ - ${bits_srcdir}/type_traits.h \ - ${bits_srcdir}/valarray_array.h \ - ${bits_srcdir}/valarray_array.tcc \ - ${bits_srcdir}/valarray_meta.h +bits_headers = ${bits_srcdir}/basic_file.h ${bits_srcdir}/basic_ios.h ${bits_srcdir}/basic_ios.tcc ${bits_srcdir}/basic_string.h ${bits_srcdir}/basic_string.tcc ${bits_srcdir}/boost_concept_check.h ${bits_srcdir}/char_traits.h ${bits_srcdir}/codecvt.h ${bits_srcdir}/concept_check.h ${bits_srcdir}/cpp_type_traits.h ${bits_srcdir}/fpos.h ${bits_srcdir}/fstream.tcc ${bits_srcdir}/functexcept.h ${bits_srcdir}/generic_shadow.h ${bits_srcdir}/gslice.h ${bits_srcdir}/gslice_array.h ${bits_srcdir}/indirect_array.h ${bits_srcdir}/ios_base.h ${bits_srcdir}/istream.tcc ${bits_srcdir}/locale_facets.h ${bits_srcdir}/locale_facets.tcc ${bits_srcdir}/localefwd.h ${bits_srcdir}/mask_array.h ${bits_srcdir}/ostream.tcc ${bits_srcdir}/pthread_allocimpl.h ${bits_srcdir}/stream_iterator.h ${bits_srcdir}/streambuf_iterator.h ${bits_srcdir}/slice.h ${bits_srcdir}/slice_array.h ${bits_srcdir}/sstream.tcc ${bits_srcdir}/std_algorithm.h ${bits_srcdir}/std_bitset.h ${bits_srcdir}/std_complex.h ${bits_srcdir}/std_deque.h ${bits_srcdir}/std_fstream.h ${bits_srcdir}/std_functional.h ${bits_srcdir}/std_iomanip.h ${bits_srcdir}/std_ios.h ${bits_srcdir}/std_iosfwd.h ${bits_srcdir}/std_iostream.h ${bits_srcdir}/std_istream.h ${bits_srcdir}/std_iterator.h ${bits_srcdir}/std_list.h ${bits_srcdir}/std_locale.h ${bits_srcdir}/std_map.h ${bits_srcdir}/std_memory.h ${bits_srcdir}/std_numeric.h ${bits_srcdir}/std_ostream.h ${bits_srcdir}/std_queue.h ${bits_srcdir}/std_set.h ${bits_srcdir}/std_sstream.h ${bits_srcdir}/std_stack.h ${bits_srcdir}/std_stdexcept.h ${bits_srcdir}/std_streambuf.h ${bits_srcdir}/std_string.h ${bits_srcdir}/std_utility.h ${bits_srcdir}/std_valarray.h ${bits_srcdir}/std_vector.h ${bits_srcdir}/stl_algo.h ${bits_srcdir}/stl_algobase.h ${bits_srcdir}/stl_alloc.h ${bits_srcdir}/stl_bvector.h ${bits_srcdir}/stl_construct.h ${bits_srcdir}/stl_deque.h ${bits_srcdir}/stl_function.h ${bits_srcdir}/stl_heap.h ${bits_srcdir}/stl_iterator.h ${bits_srcdir}/stl_iterator_base_funcs.h ${bits_srcdir}/stl_iterator_base_types.h ${bits_srcdir}/stl_list.h ${bits_srcdir}/stl_map.h ${bits_srcdir}/stl_multimap.h ${bits_srcdir}/stl_multiset.h ${bits_srcdir}/stl_numeric.h ${bits_srcdir}/stl_pair.h ${bits_srcdir}/stl_pthread_alloc.h ${bits_srcdir}/stl_queue.h ${bits_srcdir}/stl_raw_storage_iter.h ${bits_srcdir}/stl_relops.h ${bits_srcdir}/stl_set.h ${bits_srcdir}/stl_stack.h ${bits_srcdir}/stl_tempbuf.h ${bits_srcdir}/stl_threads.h ${bits_srcdir}/stl_tree.h ${bits_srcdir}/stl_uninitialized.h ${bits_srcdir}/stl_vector.h ${bits_srcdir}/streambuf.tcc ${bits_srcdir}/stringfwd.h ${bits_srcdir}/type_traits.h ${bits_srcdir}/valarray_array.h ${bits_srcdir}/valarray_array.tcc ${bits_srcdir}/valarray_meta.h backward_srcdir = ${glibcpp_srcdir}/include/backward backward_builddir = ./backward -backward_headers = \ - ${backward_srcdir}/complex.h \ - ${backward_srcdir}/iomanip.h \ - ${backward_srcdir}/istream.h \ - ${backward_srcdir}/ostream.h \ - ${backward_srcdir}/stream.h \ - ${backward_srcdir}/streambuf.h \ - ${backward_srcdir}/algo.h \ - ${backward_srcdir}/algobase.h \ - ${backward_srcdir}/alloc.h \ - ${backward_srcdir}/bvector.h \ - ${backward_srcdir}/defalloc.h \ - ${backward_srcdir}/deque.h \ - ${backward_srcdir}/function.h \ - ${backward_srcdir}/hash_map.h \ - ${backward_srcdir}/hash_set.h \ - ${backward_srcdir}/hashtable.h \ - ${backward_srcdir}/heap.h \ - ${backward_srcdir}/iostream.h \ - ${backward_srcdir}/iterator.h \ - ${backward_srcdir}/list.h \ - ${backward_srcdir}/map.h \ - ${backward_srcdir}/multimap.h \ - ${backward_srcdir}/new.h \ - ${backward_srcdir}/multiset.h \ - ${backward_srcdir}/pair.h \ - ${backward_srcdir}/queue.h \ - ${backward_srcdir}/rope.h \ - ${backward_srcdir}/set.h \ - ${backward_srcdir}/slist.h \ - ${backward_srcdir}/stack.h \ - ${backward_srcdir}/tempbuf.h \ - ${backward_srcdir}/tree.h \ - ${backward_srcdir}/vector.h \ - ${backward_srcdir}/fstream.h \ - ${backward_srcdir}/strstream.h \ - ${backward_srcdir}/strstream \ - ${backward_srcdir}/backward_warning.h +backward_headers = ${backward_srcdir}/complex.h ${backward_srcdir}/iomanip.h ${backward_srcdir}/istream.h ${backward_srcdir}/ostream.h ${backward_srcdir}/stream.h ${backward_srcdir}/streambuf.h ${backward_srcdir}/algo.h ${backward_srcdir}/algobase.h ${backward_srcdir}/alloc.h ${backward_srcdir}/bvector.h ${backward_srcdir}/defalloc.h ${backward_srcdir}/deque.h ${backward_srcdir}/function.h ${backward_srcdir}/hash_map.h ${backward_srcdir}/hash_set.h ${backward_srcdir}/hashtable.h ${backward_srcdir}/heap.h ${backward_srcdir}/iostream.h ${backward_srcdir}/iterator.h ${backward_srcdir}/list.h ${backward_srcdir}/map.h ${backward_srcdir}/multimap.h ${backward_srcdir}/new.h ${backward_srcdir}/multiset.h ${backward_srcdir}/pair.h ${backward_srcdir}/queue.h ${backward_srcdir}/rope.h ${backward_srcdir}/set.h ${backward_srcdir}/slist.h ${backward_srcdir}/stack.h ${backward_srcdir}/tempbuf.h ${backward_srcdir}/tree.h ${backward_srcdir}/vector.h ${backward_srcdir}/fstream.h ${backward_srcdir}/strstream.h ${backward_srcdir}/strstream ${backward_srcdir}/backward_warning.h ext_srcdir = ${glibcpp_srcdir}/include/ext ext_builddir = ./ext -ext_headers = \ - ${ext_srcdir}/rope \ - ${ext_srcdir}/ropeimpl.h \ - ${ext_srcdir}/stl_rope.h \ - ${ext_srcdir}/slist \ - ${ext_srcdir}/hash_map \ - ${ext_srcdir}/hash_set \ - ${ext_srcdir}/stl_hashtable.h \ - ${ext_srcdir}/stl_hash_fun.h +ext_headers = ${ext_srcdir}/rope ${ext_srcdir}/ropeimpl.h ${ext_srcdir}/stl_rope.h ${ext_srcdir}/slist ${ext_srcdir}/hash_map ${ext_srcdir}/hash_set ${ext_srcdir}/stl_hashtable.h ${ext_srcdir}/stl_hash_fun.h # This is the common subset of files that all three "C" header models use. c_base_srcdir = @C_INCLUDE_DIR@/bits c_base_builddir = ./bits -c_base_headers = \ - ${c_base_srcdir}/std_cassert.h \ - ${c_base_srcdir}/std_cctype.h \ - ${c_base_srcdir}/std_cerrno.h \ - ${c_base_srcdir}/std_cfloat.h \ - ${c_base_srcdir}/std_climits.h \ - ${c_base_srcdir}/std_clocale.h \ - ${c_base_srcdir}/std_cmath.h \ - ${c_base_srcdir}/std_csetjmp.h \ - ${c_base_srcdir}/std_csignal.h \ - ${c_base_srcdir}/std_cstdarg.h \ - ${c_base_srcdir}/std_cstddef.h \ - ${c_base_srcdir}/std_cstdio.h \ - ${c_base_srcdir}/std_cstdlib.h \ - ${c_base_srcdir}/std_cstring.h \ - ${c_base_srcdir}/std_ctime.h \ - ${c_base_srcdir}/std_cwchar.h \ - ${c_base_srcdir}/std_cwctype.h \ - ${c_base_srcdir}/cmath.tcc +c_base_headers = ${c_base_srcdir}/std_cassert.h ${c_base_srcdir}/std_cctype.h ${c_base_srcdir}/std_cerrno.h ${c_base_srcdir}/std_cfloat.h ${c_base_srcdir}/std_climits.h ${c_base_srcdir}/std_clocale.h ${c_base_srcdir}/std_cmath.h ${c_base_srcdir}/std_csetjmp.h ${c_base_srcdir}/std_csignal.h ${c_base_srcdir}/std_cstdarg.h ${c_base_srcdir}/std_cstddef.h ${c_base_srcdir}/std_cstdio.h ${c_base_srcdir}/std_cstdlib.h ${c_base_srcdir}/std_cstring.h ${c_base_srcdir}/std_ctime.h ${c_base_srcdir}/std_cwchar.h ${c_base_srcdir}/std_cwctype.h ${c_base_srcdir}/cmath.tcc std_srcdir = ${glibcpp_srcdir}/include/std std_builddir = ./ -std_headers = \ - ${std_srcdir}/algorithm \ - ${std_srcdir}/bitset \ - ${std_srcdir}/complex \ - ${std_srcdir}/deque \ - ${std_srcdir}/fstream \ - ${std_srcdir}/functional \ - ${std_srcdir}/iomanip \ - ${std_srcdir}/ios \ - ${std_srcdir}/iosfwd \ - ${std_srcdir}/iostream \ - ${std_srcdir}/istream \ - ${std_srcdir}/iterator \ - ${std_srcdir}/limits \ - ${std_srcdir}/list \ - ${std_srcdir}/locale \ - ${std_srcdir}/map \ - ${std_srcdir}/memory \ - ${std_srcdir}/numeric \ - ${std_srcdir}/ostream \ - ${std_srcdir}/queue \ - ${std_srcdir}/set \ - ${std_srcdir}/sstream \ - ${std_srcdir}/stack \ - ${std_srcdir}/stdexcept \ - ${std_srcdir}/streambuf \ - ${std_srcdir}/string \ - ${std_srcdir}/utility \ - ${std_srcdir}/valarray \ - ${std_srcdir}/vector \ - ${std_srcdir}/cassert \ - ${std_srcdir}/cctype \ - ${std_srcdir}/cerrno \ - ${std_srcdir}/cfloat \ - ${std_srcdir}/climits \ - ${std_srcdir}/clocale \ - ${std_srcdir}/ciso646 \ - ${std_srcdir}/cmath \ - ${std_srcdir}/csetjmp \ - ${std_srcdir}/csignal \ - ${std_srcdir}/cstdarg \ - ${std_srcdir}/cstddef \ - ${std_srcdir}/cstdio \ - ${std_srcdir}/cstdlib \ - ${std_srcdir}/cstring \ - ${std_srcdir}/ctime \ - ${std_srcdir}/cwchar \ - ${std_srcdir}/cwctype +std_headers = ${std_srcdir}/algorithm ${std_srcdir}/bitset ${std_srcdir}/complex ${std_srcdir}/deque ${std_srcdir}/fstream ${std_srcdir}/functional ${std_srcdir}/iomanip ${std_srcdir}/ios ${std_srcdir}/iosfwd ${std_srcdir}/iostream ${std_srcdir}/istream ${std_srcdir}/iterator ${std_srcdir}/limits ${std_srcdir}/list ${std_srcdir}/locale ${std_srcdir}/map ${std_srcdir}/memory ${std_srcdir}/numeric ${std_srcdir}/ostream ${std_srcdir}/queue ${std_srcdir}/set ${std_srcdir}/sstream ${std_srcdir}/stack ${std_srcdir}/stdexcept ${std_srcdir}/streambuf ${std_srcdir}/string ${std_srcdir}/utility ${std_srcdir}/valarray ${std_srcdir}/vector ${std_srcdir}/cassert ${std_srcdir}/cctype ${std_srcdir}/cerrno ${std_srcdir}/cfloat ${std_srcdir}/climits ${std_srcdir}/clocale ${std_srcdir}/ciso646 ${std_srcdir}/cmath ${std_srcdir}/csetjmp ${std_srcdir}/csignal ${std_srcdir}/cstdarg ${std_srcdir}/cstddef ${std_srcdir}/cstdio ${std_srcdir}/cstdlib ${std_srcdir}/cstring ${std_srcdir}/ctime ${std_srcdir}/cwchar ${std_srcdir}/cwctype 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 thread_builddir = ./${target_alias}/bits -thread_headers = \ - ${thread_builddir}/gthr.h \ - ${thread_builddir}/gthr-single.h \ - ${thread_builddir}/gthr-default.h +thread_headers = ${thread_builddir}/gthr.h ${thread_builddir}/gthr-single.h ${thread_builddir}/gthr-default.h # List of all timestamp files. By keeping only one copy of this list, both # CLEANFILES and all-local are kept up-to-date. # XXX stamp-c_compatibility -allstamps = stamp-std stamp-bits stamp-c_base stamp-backward stamp-ext \ - stamp-target stamp-thread stamp-file_model stamp-io stamp-locale +allstamps = stamp-std stamp-bits stamp-c_base stamp-backward stamp-ext stamp-target stamp-thread stamp-file_model stamp-io stamp-locale # By adding these files here, automake will remove them for 'make clean' diff --git a/libstdc++-v3/include/backward/iterator.h b/libstdc++-v3/include/backward/iterator.h index 8cb2878d15e..d213c1d3025 100644 --- a/libstdc++-v3/include/backward/iterator.h +++ b/libstdc++-v3/include/backward/iterator.h @@ -54,9 +54,20 @@ using std::random_access_iterator; using std::iterator_traits; -using std::iterator_category; -using std::distance_type; -using std::value_type; +template + inline typename iterator_traits<_Iter>::iterator_category + iterator_category(const _Iter& __i) + { return __iterator_category(__i); } + +template + inline typename iterator_traits<_Iter>::difference_type* + distance_type(const _Iter&) + { return static_cast::difference_type*>(0); } + +template + inline typename iterator_traits<_Iter>::value_type* + value_type(const _Iter& __i) + { return static_cast::value_type*>(0); } using std::distance; using std::advance; diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index 8498ca58fee..353e4219c3e 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -67,3601 +67,3535 @@ namespace std { -// __median (an extension, not present in the C++ standard). + // __median (an extension, not present in the C++ standard). + + template + inline const _Tp& + __median(const _Tp& __a, const _Tp& __b, const _Tp& __c) + { + // concept requirements + __glibcpp_function_requires(_LessThanComparableConcept<_Tp>); + if (__a < __b) + if (__b < __c) + return __b; + else if (__a < __c) + return __c; + else + return __a; + else if (__a < __c) + return __a; + else if (__b < __c) + return __c; + else + return __b; + } + + template + inline const _Tp& + __median(const _Tp& __a, const _Tp& __b, const _Tp& __c, _Compare __comp) + { + // concept requirements + __glibcpp_function_requires(_BinaryFunctionConcept<_Compare, bool, _Tp, _Tp>); + if (__comp(__a, __b)) + if (__comp(__b, __c)) + return __b; + else if (__comp(__a, __c)) + return __c; + else + return __a; + else if (__comp(__a, __c)) + return __a; + else if (__comp(__b, __c)) + return __c; + else + return __b; + } + + // for_each. Apply a function to every element of a range. + template + _Function + for_each(_InputIter __first, _InputIter __last, _Function __f) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + for ( ; __first != __last; ++__first) + __f(*__first); + return __f; + } + + // find and find_if. + + template + inline _InputIter + find(_InputIter __first, _InputIter __last, + const _Tp& __val, + input_iterator_tag) + { + while (__first != __last && !(*__first == __val)) + ++__first; + return __first; + } -template -inline const _Tp& __median(const _Tp& __a, const _Tp& __b, const _Tp& __c) -{ - // concept requirements - __glibcpp_function_requires(_LessThanComparableConcept<_Tp>); - if (__a < __b) - if (__b < __c) - return __b; - else if (__a < __c) - return __c; - else - return __a; - else if (__a < __c) - return __a; - else if (__b < __c) - return __c; - else - return __b; -} - -template -inline const _Tp& -__median(const _Tp& __a, const _Tp& __b, const _Tp& __c, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_BinaryFunctionConcept<_Compare, bool, _Tp, _Tp>); - if (__comp(__a, __b)) - if (__comp(__b, __c)) - return __b; - else if (__comp(__a, __c)) - return __c; - else - return __a; - else if (__comp(__a, __c)) - return __a; - else if (__comp(__b, __c)) - return __c; - else - return __b; -} - -// for_each. Apply a function to every element of a range. -template -_Function for_each(_InputIter __first, _InputIter __last, _Function __f) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - for ( ; __first != __last; ++__first) - __f(*__first); - return __f; -} - -// find and find_if. - -template -inline _InputIter find(_InputIter __first, _InputIter __last, - const _Tp& __val, - input_iterator_tag) -{ - while (__first != __last && !(*__first == __val)) - ++__first; - return __first; -} - -template -inline _InputIter find_if(_InputIter __first, _InputIter __last, - _Predicate __pred, - input_iterator_tag) -{ - while (__first != __last && !__pred(*__first)) - ++__first; - return __first; -} - -template -_RandomAccessIter find(_RandomAccessIter __first, _RandomAccessIter __last, - const _Tp& __val, - random_access_iterator_tag) -{ - typename iterator_traits<_RandomAccessIter>::difference_type __trip_count - = (__last - __first) >> 2; - - for ( ; __trip_count > 0 ; --__trip_count) { - if (*__first == __val) return __first; - ++__first; - - if (*__first == __val) return __first; - ++__first; - - if (*__first == __val) return __first; - ++__first; - - if (*__first == __val) return __first; - ++__first; - } - - switch(__last - __first) { - case 3: - if (*__first == __val) return __first; - ++__first; - case 2: - if (*__first == __val) return __first; - ++__first; - case 1: - if (*__first == __val) return __first; - ++__first; - case 0: - default: - return __last; - } -} - -template -_RandomAccessIter find_if(_RandomAccessIter __first, _RandomAccessIter __last, - _Predicate __pred, - random_access_iterator_tag) -{ - typename iterator_traits<_RandomAccessIter>::difference_type __trip_count - = (__last - __first) >> 2; - - for ( ; __trip_count > 0 ; --__trip_count) { - if (__pred(*__first)) return __first; - ++__first; - - if (__pred(*__first)) return __first; - ++__first; - - if (__pred(*__first)) return __first; - ++__first; - - if (__pred(*__first)) return __first; - ++__first; - } - - switch(__last - __first) { - case 3: - if (__pred(*__first)) return __first; - ++__first; - case 2: - if (__pred(*__first)) return __first; - ++__first; - case 1: - if (__pred(*__first)) return __first; - ++__first; - case 0: - default: - return __last; - } -} - -template -inline _InputIter find(_InputIter __first, _InputIter __last, - const _Tp& __val) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_EqualOpConcept< - typename iterator_traits<_InputIter>::value_type, _Tp>); - return find(__first, __last, __val, __iterator_category(__first)); -} - -template -inline _InputIter find_if(_InputIter __first, _InputIter __last, - _Predicate __pred) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_InputIter>::value_type>); - return find_if(__first, __last, __pred, __iterator_category(__first)); -} + template + inline _InputIter + find_if(_InputIter __first, _InputIter __last, + _Predicate __pred, + input_iterator_tag) + { + while (__first != __last && !__pred(*__first)) + ++__first; + return __first; + } -// adjacent_find. + template + _RandomAccessIter + find(_RandomAccessIter __first, _RandomAccessIter __last, + const _Tp& __val, + random_access_iterator_tag) + { + typename iterator_traits<_RandomAccessIter>::difference_type __trip_count + = (__last - __first) >> 2; -template -_ForwardIter adjacent_find(_ForwardIter __first, _ForwardIter __last) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_EqualityComparableConcept< - typename iterator_traits<_ForwardIter>::value_type>); - if (__first == __last) - return __last; - _ForwardIter __next = __first; - while(++__next != __last) { - if (*__first == *__next) - return __first; - __first = __next; - } - return __last; -} - -template -_ForwardIter adjacent_find(_ForwardIter __first, _ForwardIter __last, - _BinaryPredicate __binary_pred) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate, - typename iterator_traits<_ForwardIter>::value_type, - typename iterator_traits<_ForwardIter>::value_type>); - if (__first == __last) - return __last; - _ForwardIter __next = __first; - while(++__next != __last) { - if (__binary_pred(*__first, *__next)) - return __first; - __first = __next; - } - return __last; -} - -// count and count_if. There are two version of each, one whose return type -// type is void and one (present only if we have partial specialization) -// whose return type is iterator_traits<_InputIter>::difference_type. The -// C++ standard only has the latter version, but the former, which was present -// in the HP STL, is retained for backward compatibility. - -template -void count(_InputIter __first, _InputIter __last, const _Tp& __value, - _Size& __n) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_EqualityComparableConcept< - typename iterator_traits<_InputIter>::value_type >); - __glibcpp_function_requires(_EqualityComparableConcept<_Tp>); - for ( ; __first != __last; ++__first) - if (*__first == __value) - ++__n; -} - -template -void count_if(_InputIter __first, _InputIter __last, _Predicate __pred, - _Size& __n) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_InputIter>::value_type>); - for ( ; __first != __last; ++__first) - if (__pred(*__first)) - ++__n; -} - -template -typename iterator_traits<_InputIter>::difference_type -count(_InputIter __first, _InputIter __last, const _Tp& __value) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_EqualityComparableConcept< - typename iterator_traits<_InputIter>::value_type >); - __glibcpp_function_requires(_EqualityComparableConcept<_Tp>); - typename iterator_traits<_InputIter>::difference_type __n = 0; - for ( ; __first != __last; ++__first) - if (*__first == __value) - ++__n; - return __n; -} - -template -typename iterator_traits<_InputIter>::difference_type -count_if(_InputIter __first, _InputIter __last, _Predicate __pred) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_InputIter>::value_type>); - typename iterator_traits<_InputIter>::difference_type __n = 0; - for ( ; __first != __last; ++__first) - if (__pred(*__first)) - ++__n; - return __n; -} - - -// search. - -template -_ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1, - _ForwardIter2 __first2, _ForwardIter2 __last2) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>); - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>); - __glibcpp_function_requires(_EqualOpConcept< - typename iterator_traits<_ForwardIter1>::value_type, - typename iterator_traits<_ForwardIter2>::value_type>); + for ( ; __trip_count > 0 ; --__trip_count) { + if (*__first == __val) return __first; + ++__first; + + if (*__first == __val) return __first; + ++__first; - // Test for empty ranges - if (__first1 == __last1 || __first2 == __last2) - return __first1; + if (*__first == __val) return __first; + ++__first; - // Test for a pattern of length 1. - _ForwardIter2 __tmp(__first2); - ++__tmp; - if (__tmp == __last2) - return find(__first1, __last1, *__first2); + if (*__first == __val) return __first; + ++__first; + } - // General case. + switch(__last - __first) { + case 3: + if (*__first == __val) return __first; + ++__first; + case 2: + if (*__first == __val) return __first; + ++__first; + case 1: + if (*__first == __val) return __first; + ++__first; + case 0: + default: + return __last; + } + } - _ForwardIter2 __p1, __p; + template + _RandomAccessIter + find_if(_RandomAccessIter __first, _RandomAccessIter __last, + _Predicate __pred, + random_access_iterator_tag) + { + typename iterator_traits<_RandomAccessIter>::difference_type __trip_count + = (__last - __first) >> 2; - __p1 = __first2; ++__p1; + for ( ; __trip_count > 0 ; --__trip_count) { + if (__pred(*__first)) return __first; + ++__first; - _ForwardIter1 __current = __first1; + if (__pred(*__first)) return __first; + ++__first; - while (__first1 != __last1) { - __first1 = find(__first1, __last1, *__first2); - if (__first1 == __last1) - return __last1; + if (__pred(*__first)) return __first; + ++__first; - __p = __p1; - __current = __first1; - if (++__current == __last1) - return __last1; + if (__pred(*__first)) return __first; + ++__first; + } - while (*__current == *__p) { - if (++__p == __last2) - return __first1; - if (++__current == __last1) - return __last1; + switch(__last - __first) { + case 3: + if (__pred(*__first)) return __first; + ++__first; + case 2: + if (__pred(*__first)) return __first; + ++__first; + case 1: + if (__pred(*__first)) return __first; + ++__first; + case 0: + default: + return __last; + } } - ++__first1; - } - return __first1; -} + template + inline _InputIter + find(_InputIter __first, _InputIter __last, + const _Tp& __val) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_EqualOpConcept< + typename iterator_traits<_InputIter>::value_type, _Tp>); + return find(__first, __last, __val, __iterator_category(__first)); + } + + template + inline _InputIter + find_if(_InputIter __first, _InputIter __last, + _Predicate __pred) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, + typename iterator_traits<_InputIter>::value_type>); + return find_if(__first, __last, __pred, __iterator_category(__first)); + } + + // adjacent_find. + + template + _ForwardIter + adjacent_find(_ForwardIter __first, _ForwardIter __last) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_EqualityComparableConcept< + typename iterator_traits<_ForwardIter>::value_type>); + if (__first == __last) + return __last; + _ForwardIter __next = __first; + while(++__next != __last) { + if (*__first == *__next) + return __first; + __first = __next; + } + return __last; + } + + template + _ForwardIter + adjacent_find(_ForwardIter __first, _ForwardIter __last, + _BinaryPredicate __binary_pred) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate, + typename iterator_traits<_ForwardIter>::value_type, + typename iterator_traits<_ForwardIter>::value_type>); + if (__first == __last) + return __last; + _ForwardIter __next = __first; + while(++__next != __last) { + if (__binary_pred(*__first, *__next)) + return __first; + __first = __next; + } + return __last; + } + + // count and count_if. There are two version of each, one whose return type + // type is void and one (present only if we have partial specialization) + // whose return type is iterator_traits<_InputIter>::difference_type. The + // C++ standard only has the latter version, but the former, which was present + // in the HP STL, is retained for backward compatibility. + + template + void + count(_InputIter __first, _InputIter __last, + const _Tp& __value, + _Size& __n) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_EqualityComparableConcept< + typename iterator_traits<_InputIter>::value_type >); + __glibcpp_function_requires(_EqualityComparableConcept<_Tp>); + for ( ; __first != __last; ++__first) + if (*__first == __value) + ++__n; + } + + template + void + count_if(_InputIter __first, _InputIter __last, + _Predicate __pred, + _Size& __n) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, + typename iterator_traits<_InputIter>::value_type>); + for ( ; __first != __last; ++__first) + if (__pred(*__first)) + ++__n; + } + + template + typename iterator_traits<_InputIter>::difference_type + count(_InputIter __first, _InputIter __last, const _Tp& __value) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_EqualityComparableConcept< + typename iterator_traits<_InputIter>::value_type >); + __glibcpp_function_requires(_EqualityComparableConcept<_Tp>); + typename iterator_traits<_InputIter>::difference_type __n = 0; + for ( ; __first != __last; ++__first) + if (*__first == __value) + ++__n; + return __n; + } + + template + typename iterator_traits<_InputIter>::difference_type + count_if(_InputIter __first, _InputIter __last, _Predicate __pred) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, + typename iterator_traits<_InputIter>::value_type>); + typename iterator_traits<_InputIter>::difference_type __n = 0; + for ( ; __first != __last; ++__first) + if (__pred(*__first)) + ++__n; + return __n; + } + + + // search. + + template + _ForwardIter1 + search(_ForwardIter1 __first1, _ForwardIter1 __last1, + _ForwardIter2 __first2, _ForwardIter2 __last2) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>); + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>); + __glibcpp_function_requires(_EqualOpConcept< + typename iterator_traits<_ForwardIter1>::value_type, + typename iterator_traits<_ForwardIter2>::value_type>); + + // Test for empty ranges + if (__first1 == __last1 || __first2 == __last2) + return __first1; + + // Test for a pattern of length 1. + _ForwardIter2 __tmp(__first2); + ++__tmp; + if (__tmp == __last2) + return find(__first1, __last1, *__first2); + + // General case. + + _ForwardIter2 __p1, __p; + + __p1 = __first2; ++__p1; + + _ForwardIter1 __current = __first1; + + while (__first1 != __last1) { + __first1 = find(__first1, __last1, *__first2); + if (__first1 == __last1) + return __last1; + + __p = __p1; + __current = __first1; + if (++__current == __last1) + return __last1; + + while (*__current == *__p) { + if (++__p == __last2) + return __first1; + if (++__current == __last1) + return __last1; + } + + ++__first1; + } + return __first1; + } + + template + _ForwardIter1 + search(_ForwardIter1 __first1, _ForwardIter1 __last1, + _ForwardIter2 __first2, _ForwardIter2 __last2, + _BinaryPred __predicate) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>); + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>); + __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPred, + typename iterator_traits<_ForwardIter1>::value_type, + typename iterator_traits<_ForwardIter2>::value_type>); + + // Test for empty ranges + if (__first1 == __last1 || __first2 == __last2) + return __first1; + + // Test for a pattern of length 1. + _ForwardIter2 __tmp(__first2); + ++__tmp; + if (__tmp == __last2) { + while (__first1 != __last1 && !__predicate(*__first1, *__first2)) + ++__first1; + return __first1; + } -template -_ForwardIter1 search(_ForwardIter1 __first1, _ForwardIter1 __last1, - _ForwardIter2 __first2, _ForwardIter2 __last2, - _BinaryPred __predicate) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>); - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>); - __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPred, - typename iterator_traits<_ForwardIter1>::value_type, - typename iterator_traits<_ForwardIter2>::value_type>); - - // Test for empty ranges - if (__first1 == __last1 || __first2 == __last2) - return __first1; - - // Test for a pattern of length 1. - _ForwardIter2 __tmp(__first2); - ++__tmp; - if (__tmp == __last2) { - while (__first1 != __last1 && !__predicate(*__first1, *__first2)) - ++__first1; - return __first1; - } - - // General case. - - _ForwardIter2 __p1, __p; - - __p1 = __first2; ++__p1; - - _ForwardIter1 __current = __first1; - - while (__first1 != __last1) { - while (__first1 != __last1) { - if (__predicate(*__first1, *__first2)) - break; - ++__first1; - } - while (__first1 != __last1 && !__predicate(*__first1, *__first2)) - ++__first1; - if (__first1 == __last1) - return __last1; + // General case. - __p = __p1; - __current = __first1; - if (++__current == __last1) return __last1; + _ForwardIter2 __p1, __p; - while (__predicate(*__current, *__p)) { - if (++__p == __last2) - return __first1; - if (++__current == __last1) - return __last1; - } + __p1 = __first2; ++__p1; - ++__first1; - } - return __first1; -} + _ForwardIter1 __current = __first1; -// search_n. Search for __count consecutive copies of __val. + while (__first1 != __last1) { + while (__first1 != __last1) { + if (__predicate(*__first1, *__first2)) + break; + ++__first1; + } + while (__first1 != __last1 && !__predicate(*__first1, *__first2)) + ++__first1; + if (__first1 == __last1) + return __last1; -template -_ForwardIter search_n(_ForwardIter __first, _ForwardIter __last, - _Integer __count, const _Tp& __val) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_EqualityComparableConcept< - typename iterator_traits<_ForwardIter>::value_type>); - __glibcpp_function_requires(_EqualityComparableConcept<_Tp>); - - if (__count <= 0) - return __first; - else { - __first = find(__first, __last, __val); - while (__first != __last) { - _Integer __n = __count - 1; - _ForwardIter __i = __first; - ++__i; - while (__i != __last && __n != 0 && *__i == __val) { - ++__i; - --__n; + __p = __p1; + __current = __first1; + if (++__current == __last1) return __last1; + + while (__predicate(*__current, *__p)) { + if (++__p == __last2) + return __first1; + if (++__current == __last1) + return __last1; + } + + ++__first1; } - if (__n == 0) - return __first; - else - __first = find(__i, __last, __val); + return __first1; } - return __last; - } -} -template -_ForwardIter search_n(_ForwardIter __first, _ForwardIter __last, - _Integer __count, const _Tp& __val, - _BinaryPred __binary_pred) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPred, - typename iterator_traits<_ForwardIter>::value_type, _Tp>); - - if (__count <= 0) - return __first; - else { - while (__first != __last) { - if (__binary_pred(*__first, __val)) - break; - ++__first; - } - while (__first != __last) { - _Integer __n = __count - 1; - _ForwardIter __i = __first; - ++__i; - while (__i != __last && __n != 0 && __binary_pred(*__i, __val)) { - ++__i; - --__n; + // search_n. Search for __count consecutive copies of __val. + + template + _ForwardIter + search_n(_ForwardIter __first, _ForwardIter __last, + _Integer __count, const _Tp& __val) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_EqualityComparableConcept< + typename iterator_traits<_ForwardIter>::value_type>); + __glibcpp_function_requires(_EqualityComparableConcept<_Tp>); + + if (__count <= 0) + return __first; + else { + __first = find(__first, __last, __val); + while (__first != __last) { + _Integer __n = __count - 1; + _ForwardIter __i = __first; + ++__i; + while (__i != __last && __n != 0 && *__i == __val) { + ++__i; + --__n; + } + if (__n == 0) + return __first; + else + __first = find(__i, __last, __val); + } + return __last; } - if (__n == 0) - return __first; + } + + template + _ForwardIter + search_n(_ForwardIter __first, _ForwardIter __last, + _Integer __count, const _Tp& __val, + _BinaryPred __binary_pred) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPred, + typename iterator_traits<_ForwardIter>::value_type, _Tp>); + + if (__count <= 0) + return __first; else { - while (__i != __last) { - if (__binary_pred(*__i, __val)) - break; - ++__i; - } - __first = __i; + while (__first != __last) { + if (__binary_pred(*__first, __val)) + break; + ++__first; + } + while (__first != __last) { + _Integer __n = __count - 1; + _ForwardIter __i = __first; + ++__i; + while (__i != __last && __n != 0 && __binary_pred(*__i, __val)) { + ++__i; + --__n; + } + if (__n == 0) + return __first; + else { + while (__i != __last) { + if (__binary_pred(*__i, __val)) + break; + ++__i; + } + __first = __i; + } + } + return __last; } + } + + // swap_ranges + + template + _ForwardIter2 + swap_ranges(_ForwardIter1 __first1, _ForwardIter1 __last1, + _ForwardIter2 __first2) + { + // concept requirements + __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter1>); + __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter2>); + __glibcpp_function_requires(_ConvertibleConcept< + typename iterator_traits<_ForwardIter1>::value_type, + typename iterator_traits<_ForwardIter2>::value_type>); + __glibcpp_function_requires(_ConvertibleConcept< + typename iterator_traits<_ForwardIter2>::value_type, + typename iterator_traits<_ForwardIter1>::value_type>); + + for ( ; __first1 != __last1; ++__first1, ++__first2) + iter_swap(__first1, __first2); + return __first2; + } + + // transform + + template + _OutputIter + transform(_InputIter __first, _InputIter __last, + _OutputIter __result, _UnaryOperation __unary_op) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + /* XXX + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + // should be "the type returned by _UnaryOperation" + typename iterator_traits<_InputIter>::value_type>); + */ + + for ( ; __first != __last; ++__first, ++__result) + *__result = __unary_op(*__first); + return __result; + } + + template + _OutputIter + transform(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _OutputIter __result, + _BinaryOperation __binary_op) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + /* XXX + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + // should be "the type returned by _BinaryOperation" + typename iterator_traits<_InputIter1>::value_type>); + */ + + for ( ; __first1 != __last1; ++__first1, ++__first2, ++__result) + *__result = __binary_op(*__first1, *__first2); + return __result; + } + + // replace, replace_if, replace_copy, replace_copy_if + + template + void + replace(_ForwardIter __first, _ForwardIter __last, + const _Tp& __old_value, const _Tp& __new_value) + { + // concept requirements + __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_EqualOpConcept< + typename iterator_traits<_ForwardIter>::value_type, _Tp>); + __glibcpp_function_requires(_ConvertibleConcept<_Tp, + typename iterator_traits<_ForwardIter>::value_type>); + + for ( ; __first != __last; ++__first) + if (*__first == __old_value) + *__first = __new_value; + } + + template + void + replace_if(_ForwardIter __first, _ForwardIter __last, + _Predicate __pred, const _Tp& __new_value) + { + // concept requirements + __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_ConvertibleConcept<_Tp, + typename iterator_traits<_ForwardIter>::value_type>); + __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, + typename iterator_traits<_ForwardIter>::value_type>); + + for ( ; __first != __last; ++__first) + if (__pred(*__first)) + *__first = __new_value; + } + + template + _OutputIter + replace_copy(_InputIter __first, _InputIter __last, + _OutputIter __result, + const _Tp& __old_value, const _Tp& __new_value) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter>::value_type>); + __glibcpp_function_requires(_EqualOpConcept< + typename iterator_traits<_InputIter>::value_type, _Tp>); + + for ( ; __first != __last; ++__first, ++__result) + *__result = *__first == __old_value ? __new_value : *__first; + return __result; + } + + template + _OutputIter + replace_copy_if(_InputIter __first, _InputIter __last, + _OutputIter __result, + _Predicate __pred, const _Tp& __new_value) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter>::value_type>); + __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, + typename iterator_traits<_InputIter>::value_type>); + + for ( ; __first != __last; ++__first, ++__result) + *__result = __pred(*__first) ? __new_value : *__first; + return __result; + } + + // generate and generate_n + + template + void + generate(_ForwardIter __first, _ForwardIter __last, _Generator __gen) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_GeneratorConcept<_Generator, + typename iterator_traits<_ForwardIter>::value_type>); + + for ( ; __first != __last; ++__first) + *__first = __gen(); + } + + template + _OutputIter + generate_n(_OutputIter __first, _Size __n, _Generator __gen) + { + /* + // XXX concept requirements + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + "the return type of _Generator" ?? >); + */ + + for ( ; __n > 0; --__n, ++__first) + *__first = __gen(); + return __first; } - return __last; - } -} -// swap_ranges + // remove, remove_if, remove_copy, remove_copy_if + + template + _OutputIter + remove_copy(_InputIter __first, _InputIter __last, + _OutputIter __result, const _Tp& __value) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter>::value_type>); + __glibcpp_function_requires(_EqualOpConcept< + typename iterator_traits<_InputIter>::value_type, _Tp>); + + for ( ; __first != __last; ++__first) + if (!(*__first == __value)) { + *__result = *__first; + ++__result; + } + return __result; + } + + template + _OutputIter + remove_copy_if(_InputIter __first, _InputIter __last, + _OutputIter __result, _Predicate __pred) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter>::value_type>); + __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, + typename iterator_traits<_InputIter>::value_type>); + + for ( ; __first != __last; ++__first) + if (!__pred(*__first)) { + *__result = *__first; + ++__result; + } + return __result; + } + + template + _ForwardIter + remove(_ForwardIter __first, _ForwardIter __last, + const _Tp& __value) + { + // concept requirements + __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_ConvertibleConcept<_Tp, + typename iterator_traits<_ForwardIter>::value_type>); + __glibcpp_function_requires(_EqualOpConcept< + typename iterator_traits<_ForwardIter>::value_type, _Tp>); + + __first = find(__first, __last, __value); + _ForwardIter __i = __first; + return __first == __last ? __first + : remove_copy(++__i, __last, __first, __value); + } -template -_ForwardIter2 swap_ranges(_ForwardIter1 __first1, _ForwardIter1 __last1, - _ForwardIter2 __first2) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter1>); - __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter2>); - __glibcpp_function_requires(_ConvertibleConcept< - typename iterator_traits<_ForwardIter1>::value_type, - typename iterator_traits<_ForwardIter2>::value_type>); - __glibcpp_function_requires(_ConvertibleConcept< - typename iterator_traits<_ForwardIter2>::value_type, - typename iterator_traits<_ForwardIter1>::value_type>); - - for ( ; __first1 != __last1; ++__first1, ++__first2) - iter_swap(__first1, __first2); - return __first2; -} - -// transform - -template -_OutputIter transform(_InputIter __first, _InputIter __last, - _OutputIter __result, _UnaryOperation __unary_op) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); -/* XXX - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - // should be "the type returned by _UnaryOperation" - typename iterator_traits<_InputIter>::value_type>); -*/ - - for ( ; __first != __last; ++__first, ++__result) - *__result = __unary_op(*__first); - return __result; -} - -template -_OutputIter transform(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _OutputIter __result, - _BinaryOperation __binary_op) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); -/* XXX - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - // should be "the type returned by _BinaryOperation" - typename iterator_traits<_InputIter1>::value_type>); -*/ - - for ( ; __first1 != __last1; ++__first1, ++__first2, ++__result) - *__result = __binary_op(*__first1, *__first2); - return __result; -} - -// replace, replace_if, replace_copy, replace_copy_if - -template -void replace(_ForwardIter __first, _ForwardIter __last, - const _Tp& __old_value, const _Tp& __new_value) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_EqualOpConcept< - typename iterator_traits<_ForwardIter>::value_type, _Tp>); - __glibcpp_function_requires(_ConvertibleConcept<_Tp, - typename iterator_traits<_ForwardIter>::value_type>); - - for ( ; __first != __last; ++__first) - if (*__first == __old_value) - *__first = __new_value; -} - -template -void replace_if(_ForwardIter __first, _ForwardIter __last, - _Predicate __pred, const _Tp& __new_value) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_ConvertibleConcept<_Tp, - typename iterator_traits<_ForwardIter>::value_type>); - __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_ForwardIter>::value_type>); - - for ( ; __first != __last; ++__first) - if (__pred(*__first)) - *__first = __new_value; -} - -template -_OutputIter replace_copy(_InputIter __first, _InputIter __last, - _OutputIter __result, - const _Tp& __old_value, const _Tp& __new_value) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter>::value_type>); - __glibcpp_function_requires(_EqualOpConcept< - typename iterator_traits<_InputIter>::value_type, _Tp>); - - for ( ; __first != __last; ++__first, ++__result) - *__result = *__first == __old_value ? __new_value : *__first; - return __result; -} - -template -_OutputIter replace_copy_if(_InputIter __first, _InputIter __last, - _OutputIter __result, - _Predicate __pred, const _Tp& __new_value) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter>::value_type>); - __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_InputIter>::value_type>); - - for ( ; __first != __last; ++__first, ++__result) - *__result = __pred(*__first) ? __new_value : *__first; - return __result; -} - -// generate and generate_n - -template -void generate(_ForwardIter __first, _ForwardIter __last, _Generator __gen) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_GeneratorConcept<_Generator, - typename iterator_traits<_ForwardIter>::value_type>); + template + _ForwardIter + remove_if(_ForwardIter __first, _ForwardIter __last, + _Predicate __pred) + { + // concept requirements + __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, + typename iterator_traits<_ForwardIter>::value_type>); - for ( ; __first != __last; ++__first) - *__first = __gen(); -} + __first = find_if(__first, __last, __pred); + _ForwardIter __i = __first; + return __first == __last ? __first + : remove_copy_if(++__i, __last, __first, __pred); + } + + template + _OutputIter + __unique_copy(_InputIter __first, _InputIter __last, + _OutputIter __result, + output_iterator_tag) + { + // concept requirements -- taken care of in dispatching function + typename iterator_traits<_InputIter>::value_type __value = *__first; + *__result = __value; + while (++__first != __last) + if (!(__value == *__first)) { + __value = *__first; + *++__result = __value; + } + return ++__result; + } + + template + _ForwardIter + __unique_copy(_InputIter __first, _InputIter __last, + _ForwardIter __result, + forward_iterator_tag) + { + // concept requirements -- taken care of in dispatching function + *__result = *__first; + while (++__first != __last) + if (!(*__result == *__first)) + *++__result = *__first; + return ++__result; + } + + template + inline _OutputIter + unique_copy(_InputIter __first, _InputIter __last, + _OutputIter __result) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter>::value_type>); + __glibcpp_function_requires(_EqualityComparableConcept< + typename iterator_traits<_InputIter>::value_type>); + + typedef typename iterator_traits<_OutputIter>::iterator_catgeory _IterType; + + if (__first == __last) return __result; + return __unique_copy(__first, __last, __result, _IterType()); + } + + template + _OutputIter + __unique_copy(_InputIter __first, _InputIter __last, + _OutputIter __result, + _BinaryPredicate __binary_pred, + output_iterator_tag) + { + // concept requirements -- iterators already checked + __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate, + typename iterator_traits<_InputIter>::value_type, + typename iterator_traits<_InputIter>::value_type>); + + typename iterator_traits<_InputIter>::value_type __value = *__first; + *__result = __value; + while (++__first != __last) + if (!__binary_pred(__value, *__first)) { + __value = *__first; + *++__result = __value; + } + return ++__result; + } + + template + _ForwardIter + __unique_copy(_InputIter __first, _InputIter __last, + _ForwardIter __result, + _BinaryPredicate __binary_pred, + forward_iterator_tag) + { + // concept requirements -- iterators already checked + __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate, + typename iterator_traits<_ForwardIter>::value_type, + typename iterator_traits<_InputIter>::value_type>); + + *__result = *__first; + while (++__first != __last) + if (!__binary_pred(*__result, *__first)) *++__result = *__first; + return ++__result; + } + + template + inline _OutputIter + unique_copy(_InputIter __first, _InputIter __last, + _OutputIter __result, + _BinaryPredicate __binary_pred) + { + // concept requirements -- predicates checked later + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter>::value_type>); + + typedef typename iterator_traits<_OutputIter>::iterator_catgeory _IterType; + + if (__first == __last) return __result; + return __unique_copy(__first, __last, __result, __binary_pred, _IterType()); + } + + template + _ForwardIter + unique(_ForwardIter __first, _ForwardIter __last) + { + // concept requirements + __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_EqualityComparableConcept< + typename iterator_traits<_ForwardIter>::value_type>); + + __first = adjacent_find(__first, __last); + return unique_copy(__first, __last, __first); + } + + template + _ForwardIter + unique(_ForwardIter __first, _ForwardIter __last, + _BinaryPredicate __binary_pred) + { + // concept requirements + __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate, + typename iterator_traits<_ForwardIter>::value_type, + typename iterator_traits<_ForwardIter>::value_type>); + + __first = adjacent_find(__first, __last, __binary_pred); + return unique_copy(__first, __last, __first, __binary_pred); + } + + template + void + __reverse(_BidirectionalIter __first, _BidirectionalIter __last, + bidirectional_iterator_tag) + { + while (true) + if (__first == __last || __first == --__last) + return; + else + iter_swap(__first++, __last); + } + + template + void + __reverse(_RandomAccessIter __first, _RandomAccessIter __last, + random_access_iterator_tag) + { + while (__first < __last) + iter_swap(__first++, --__last); + } + + template + inline void + reverse(_BidirectionalIter __first, _BidirectionalIter __last) + { + // concept requirements + __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept< + _BidirectionalIter>); + __reverse(__first, __last, __iterator_category(__first)); + } + + template + _OutputIter + reverse_copy(_BidirectionalIter __first, _BidirectionalIter __last, + _OutputIter __result) + { + // concept requirements + __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_BidirectionalIter>::value_type>); + + while (__first != __last) { + --__last; + *__result = *__last; + ++__result; + } + return __result; + } -template -_OutputIter generate_n(_OutputIter __first, _Size __n, _Generator __gen) -{ -/* - // XXX concept requirements - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - "the return type of _Generator" ?? >); -*/ + /// This is a helper function for the rotate algorithm specialized on RAIs. - for ( ; __n > 0; --__n, ++__first) - *__first = __gen(); - return __first; -} + template + _EuclideanRingElement + __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n) + { + while (__n != 0) { + _EuclideanRingElement __t = __m % __n; + __m = __n; + __n = __t; + } + return __m; + } + + template + void + __rotate(_ForwardIter __first, + _ForwardIter __middle, + _ForwardIter __last, + forward_iterator_tag) + { + if ((__first == __middle) || (__last == __middle)) + return; + + _ForwardIter __first2 = __middle; + do { + swap(*__first++, *__first2++); + if (__first == __middle) + __middle = __first2; + } while (__first2 != __last); + + __first2 = __middle; + + while (__first2 != __last) { + swap(*__first++, *__first2++); + if (__first == __middle) + __middle = __first2; + else if (__first2 == __last) + __first2 = __middle; + } + } + + template + void + __rotate(_BidirectionalIter __first, + _BidirectionalIter __middle, + _BidirectionalIter __last, + bidirectional_iterator_tag) + { + // concept requirements + __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept< + _BidirectionalIter>); + + if ((__first == __middle) || (__last == __middle)) + return; + + __reverse(__first, __middle, bidirectional_iterator_tag()); + __reverse(__middle, __last, bidirectional_iterator_tag()); + + while (__first != __middle && __middle != __last) + swap (*__first++, *--__last); + + if (__first == __middle) { + __reverse(__middle, __last, bidirectional_iterator_tag()); + } + else { + __reverse(__first, __middle, bidirectional_iterator_tag()); + } + } + + template + void + __rotate(_RandomAccessIter __first, + _RandomAccessIter __middle, + _RandomAccessIter __last, + random_access_iterator_tag) + { + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIter>); + + if ((__first == __middle) || (__last == __middle)) + return; + + typedef typename iterator_traits<_RandomAccessIter>::difference_type _Distance; + typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType; + + _Distance __n = __last - __first; + _Distance __k = __middle - __first; + _Distance __l = __n - __k; + + if (__k == __l) { + swap_ranges(__first, __middle, __middle); + return; + } + + _Distance __d = __gcd(__n, __k); + + for (_Distance __i = 0; __i < __d; __i++) { + _ValueType __tmp = *__first; + _RandomAccessIter __p = __first; + + if (__k < __l) { + for (_Distance __j = 0; __j < __l/__d; __j++) { + if (__p > __first + __l) { + *__p = *(__p - __l); + __p -= __l; + } + + *__p = *(__p + __k); + __p += __k; + } + } + + else { + for (_Distance __j = 0; __j < __k/__d - 1; __j ++) { + if (__p < __last - __k) { + *__p = *(__p + __k); + __p += __k; + } + + *__p = * (__p - __l); + __p -= __l; + } + } + + *__p = __tmp; + ++__first; + } + } + + template + inline void + rotate(_ForwardIter __first, _ForwardIter __middle, _ForwardIter __last) + { + // concept requirements + __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); + + typedef typename iterator_traits<_ForwardIter>::iterator_category _IterType; + __rotate(__first, __middle, __last, _IterType()); + } + + template + _OutputIter + rotate_copy(_ForwardIter __first, _ForwardIter __middle, + _ForwardIter __last, _OutputIter __result) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_ForwardIter>::value_type>); + + return copy(__first, __middle, copy(__middle, __last, __result)); + } + + // 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 + inline _Distance + __random_number(_Distance __n) + { + #ifdef _GLIBCPP_HAVE_DRAND48 + return lrand48() % __n; + #else + return rand() % __n; + #endif + } + + /// 25.2.11 random_shuffle(). + + template + inline void + random_shuffle(_RandomAccessIter __first, _RandomAccessIter __last) + { + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIter>); + + if (__first == __last) return; + for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i) + iter_swap(__i, __first + __random_number((__i - __first) + 1)); + } + + template + void + random_shuffle(_RandomAccessIter __first, _RandomAccessIter __last, + _RandomNumberGenerator& __rand) + { + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIter>); + + if (__first == __last) return; + for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i) + iter_swap(__i, __first + __rand((__i - __first) + 1)); + } + + // random_sample and random_sample_n (extensions, not part of the standard). + + template + _OutputIter + random_sample_n(_ForwardIter __first, _ForwardIter __last, + _OutputIter __out, const _Distance __n) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_ForwardIter>::value_type>); + + _Distance __remaining = distance(__first, __last); + _Distance __m = min(__n, __remaining); + + while (__m > 0) { + if (__random_number(__remaining) < __m) { + *__out = *__first; + ++__out; + --__m; + } + + --__remaining; + ++__first; + } + return __out; + } + + template + _OutputIter + random_sample_n(_ForwardIter __first, _ForwardIter __last, + _OutputIter __out, const _Distance __n, + _RandomNumberGenerator& __rand) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_ForwardIter>::value_type>); + __glibcpp_function_requires(_UnaryFunctionConcept< + _RandomNumberGenerator, _Distance, _Distance>); + + _Distance __remaining = distance(__first, __last); + _Distance __m = min(__n, __remaining); + + while (__m > 0) { + if (__rand(__remaining) < __m) { + *__out = *__first; + ++__out; + --__m; + } + + --__remaining; + ++__first; + } + return __out; + } + + template + _RandomAccessIter + __random_sample(_InputIter __first, _InputIter __last, + _RandomAccessIter __out, + const _Distance __n) + { + _Distance __m = 0; + _Distance __t = __n; + for ( ; __first != __last && __m < __n; ++__m, ++__first) + __out[__m] = *__first; + + while (__first != __last) { + ++__t; + _Distance __M = __random_number(__t); + if (__M < __n) + __out[__M] = *__first; + ++__first; + } -// remove, remove_if, remove_copy, remove_copy_if + return __out + __m; + } + + template + _RandomAccessIter + __random_sample(_InputIter __first, _InputIter __last, + _RandomAccessIter __out, + _RandomNumberGenerator& __rand, + const _Distance __n) + { + // concept requirements + __glibcpp_function_requires(_UnaryFunctionConcept< + _RandomNumberGenerator, _Distance, _Distance>); + + _Distance __m = 0; + _Distance __t = __n; + for ( ; __first != __last && __m < __n; ++__m, ++__first) + __out[__m] = *__first; + + while (__first != __last) { + ++__t; + _Distance __M = __rand(__t); + if (__M < __n) + __out[__M] = *__first; + ++__first; + } -template -_OutputIter remove_copy(_InputIter __first, _InputIter __last, - _OutputIter __result, const _Tp& __value) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter>::value_type>); - __glibcpp_function_requires(_EqualOpConcept< - typename iterator_traits<_InputIter>::value_type, _Tp>); - - for ( ; __first != __last; ++__first) - if (!(*__first == __value)) { - *__result = *__first; - ++__result; + return __out + __m; } - return __result; -} -template -_OutputIter remove_copy_if(_InputIter __first, _InputIter __last, - _OutputIter __result, _Predicate __pred) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter>::value_type>); - __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_InputIter>::value_type>); - - for ( ; __first != __last; ++__first) - if (!__pred(*__first)) { - *__result = *__first; - ++__result; - } - return __result; -} + template + inline _RandomAccessIter + random_sample(_InputIter __first, _InputIter __last, + _RandomAccessIter __out_first, _RandomAccessIter __out_last) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIter>); -template -_ForwardIter remove(_ForwardIter __first, _ForwardIter __last, - const _Tp& __value) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_ConvertibleConcept<_Tp, - typename iterator_traits<_ForwardIter>::value_type>); - __glibcpp_function_requires(_EqualOpConcept< - typename iterator_traits<_ForwardIter>::value_type, _Tp>); - - __first = find(__first, __last, __value); - _ForwardIter __i = __first; - return __first == __last ? __first - : remove_copy(++__i, __last, __first, __value); -} - -template -_ForwardIter remove_if(_ForwardIter __first, _ForwardIter __last, - _Predicate __pred) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_ForwardIter>::value_type>); - - __first = find_if(__first, __last, __pred); - _ForwardIter __i = __first; - return __first == __last ? __first - : remove_copy_if(++__i, __last, __first, __pred); -} - -// unique and unique_copy - -template -_OutputIter __unique_copy(_InputIter __first, _InputIter __last, - _OutputIter __result, _Tp*) -{ - // concept requirements -- taken care of in dispatching function - _Tp __value = *__first; - *__result = __value; - while (++__first != __last) - if (!(__value == *__first)) { - __value = *__first; - *++__result = __value; - } - return ++__result; -} - -template -inline _OutputIter __unique_copy(_InputIter __first, _InputIter __last, - _OutputIter __result, - output_iterator_tag) -{ - // concept requirements -- taken care of in dispatching function - return __unique_copy(__first, __last, __result, __value_type(__first)); -} + return __random_sample(__first, __last, + __out_first, __out_last - __out_first); + } -template -_ForwardIter __unique_copy(_InputIter __first, _InputIter __last, - _ForwardIter __result, forward_iterator_tag) -{ - // concept requirements -- taken care of in dispatching function - *__result = *__first; - while (++__first != __last) - if (!(*__result == *__first)) - *++__result = *__first; - return ++__result; -} - -template -inline _OutputIter unique_copy(_InputIter __first, _InputIter __last, - _OutputIter __result) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter>::value_type>); - __glibcpp_function_requires(_EqualityComparableConcept< - typename iterator_traits<_InputIter>::value_type>); - - if (__first == __last) return __result; - return __unique_copy(__first, __last, __result, - __iterator_category(__result)); -} - -template -_OutputIter __unique_copy(_InputIter __first, _InputIter __last, - _OutputIter __result, - _BinaryPredicate __binary_pred, _Tp*) -{ - // concept requirements -- iterators already checked - __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate, _Tp, _Tp>); - - _Tp __value = *__first; - *__result = __value; - while (++__first != __last) - if (!__binary_pred(__value, *__first)) { - __value = *__first; - *++__result = __value; - } - return ++__result; -} - -template -inline _OutputIter __unique_copy(_InputIter __first, _InputIter __last, - _OutputIter __result, - _BinaryPredicate __binary_pred, - output_iterator_tag) -{ - // concept requirements -- taken care of in dispatching function - return __unique_copy(__first, __last, __result, __binary_pred, - __value_type(__first)); -} - -template -_ForwardIter __unique_copy(_InputIter __first, _InputIter __last, - _ForwardIter __result, - _BinaryPredicate __binary_pred, - forward_iterator_tag) -{ - // concept requirements -- iterators already checked - __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate, - typename iterator_traits<_ForwardIter>::value_type, - typename iterator_traits<_InputIter>::value_type>); - - *__result = *__first; - while (++__first != __last) - if (!__binary_pred(*__result, *__first)) *++__result = *__first; - return ++__result; -} - -template -inline _OutputIter unique_copy(_InputIter __first, _InputIter __last, - _OutputIter __result, - _BinaryPredicate __binary_pred) -{ - // concept requirements -- predicates checked later - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter>::value_type>); - - if (__first == __last) return __result; - return __unique_copy(__first, __last, __result, __binary_pred, - __iterator_category(__result)); -} - -template -_ForwardIter unique(_ForwardIter __first, _ForwardIter __last) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_EqualityComparableConcept< - typename iterator_traits<_ForwardIter>::value_type>); - - __first = adjacent_find(__first, __last); - return unique_copy(__first, __last, __first); -} - -template -_ForwardIter unique(_ForwardIter __first, _ForwardIter __last, - _BinaryPredicate __binary_pred) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate, - typename iterator_traits<_ForwardIter>::value_type, - typename iterator_traits<_ForwardIter>::value_type>); - - __first = adjacent_find(__first, __last, __binary_pred); - return unique_copy(__first, __last, __first, __binary_pred); -} - -// reverse and reverse_copy, and their auxiliary functions - -template -void __reverse(_BidirectionalIter __first, _BidirectionalIter __last, - bidirectional_iterator_tag) { - while (true) - if (__first == __last || __first == --__last) - return; - else - iter_swap(__first++, __last); -} - -template -void __reverse(_RandomAccessIter __first, _RandomAccessIter __last, - random_access_iterator_tag) { - while (__first < __last) - iter_swap(__first++, --__last); -} - -template -inline void reverse(_BidirectionalIter __first, _BidirectionalIter __last) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept< - _BidirectionalIter>); - __reverse(__first, __last, __iterator_category(__first)); -} - -template -_OutputIter reverse_copy(_BidirectionalIter __first, - _BidirectionalIter __last, - _OutputIter __result) -{ - // concept requirements - __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_BidirectionalIter>::value_type>); - - while (__first != __last) { - --__last; - *__result = *__last; - ++__result; - } - return __result; -} - -// rotate and rotate_copy, and their auxiliary functions - -template -_EuclideanRingElement __gcd(_EuclideanRingElement __m, - _EuclideanRingElement __n) -{ - while (__n != 0) { - _EuclideanRingElement __t = __m % __n; - __m = __n; - __n = __t; - } - return __m; -} - -template -_ForwardIter __rotate(_ForwardIter __first, - _ForwardIter __middle, - _ForwardIter __last, - _Distance*, - forward_iterator_tag) -{ - if (__first == __middle) - return __last; - if (__last == __middle) - return __first; - - _ForwardIter __first2 = __middle; - do { - swap(*__first++, *__first2++); - if (__first == __middle) - __middle = __first2; - } while (__first2 != __last); - - _ForwardIter __new_middle = __first; - - __first2 = __middle; - - while (__first2 != __last) { - swap (*__first++, *__first2++); - if (__first == __middle) - __middle = __first2; - else if (__first2 == __last) - __first2 = __middle; - } - return __new_middle; -} + template + inline _RandomAccessIter + random_sample(_InputIter __first, _InputIter __last, + _RandomAccessIter __out_first, _RandomAccessIter __out_last, + _RandomNumberGenerator& __rand) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIter>); + return __random_sample(__first, __last, + __out_first, __rand, + __out_last - __out_first); + } -template -_BidirectionalIter __rotate(_BidirectionalIter __first, - _BidirectionalIter __middle, - _BidirectionalIter __last, - _Distance*, - bidirectional_iterator_tag) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept< - _BidirectionalIter>); - - if (__first == __middle) - return __last; - if (__last == __middle) - return __first; - - __reverse(__first, __middle, bidirectional_iterator_tag()); - __reverse(__middle, __last, bidirectional_iterator_tag()); - - while (__first != __middle && __middle != __last) - swap (*__first++, *--__last); - - if (__first == __middle) { - __reverse(__middle, __last, bidirectional_iterator_tag()); - return __last; - } - else { - __reverse(__first, __middle, bidirectional_iterator_tag()); - return __first; - } -} - -template -_RandomAccessIter __rotate(_RandomAccessIter __first, - _RandomAccessIter __middle, - _RandomAccessIter __last, - _Distance *, _Tp *) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIter>); + // partition, stable_partition, and their auxiliary functions - _Distance __n = __last - __first; - _Distance __k = __middle - __first; - _Distance __l = __n - __k; - _RandomAccessIter __result = __first + (__last - __middle); + template + _ForwardIter + __partition(_ForwardIter __first, _ForwardIter __last, + _Predicate __pred, + forward_iterator_tag) + { + if (__first == __last) return __first; - if (__k == 0) - return __last; + while (__pred(*__first)) + if (++__first == __last) return __first; - else if (__k == __l) { - swap_ranges(__first, __middle, __middle); - return __result; - } + _ForwardIter __next = __first; - _Distance __d = __gcd(__n, __k); + while (++__next != __last) + if (__pred(*__next)) { + swap(*__first, *__next); + ++__first; + } - for (_Distance __i = 0; __i < __d; __i++) { - _Tp __tmp = *__first; - _RandomAccessIter __p = __first; + return __first; + } - if (__k < __l) { - for (_Distance __j = 0; __j < __l/__d; __j++) { - if (__p > __first + __l) { - *__p = *(__p - __l); - __p -= __l; - } + template + _BidirectionalIter + __partition(_BidirectionalIter __first, _BidirectionalIter __last, + _Predicate __pred, + bidirectional_iterator_tag) + { + while (true) { + while (true) + if (__first == __last) + return __first; + else if (__pred(*__first)) + ++__first; + else + break; + --__last; + while (true) + if (__first == __last) + return __first; + else if (!__pred(*__last)) + --__last; + else + break; + iter_swap(__first, __last); + ++__first; + } + } - *__p = *(__p + __k); - __p += __k; + template + inline _ForwardIter + partition(_ForwardIter __first, _ForwardIter __last, + _Predicate __pred) + { + // concept requirements + __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, + typename iterator_traits<_ForwardIter>::value_type>); + + return __partition(__first, __last, __pred, __iterator_category(__first)); + } + + + template + _ForwardIter + __inplace_stable_partition(_ForwardIter __first, _ForwardIter __last, + _Predicate __pred, _Distance __len) + { + if (__len == 1) + return __pred(*__first) ? __last : __first; + _ForwardIter __middle = __first; + advance(__middle, __len / 2); + _ForwardIter __begin = __inplace_stable_partition(__first, __middle, + __pred, + __len / 2); + _ForwardIter __end = __inplace_stable_partition(__middle, __last, + __pred, + __len - __len / 2); + rotate(__begin, __middle, __end); + advance(__begin, distance(__middle, __end)); + return __begin; + } + + template + _ForwardIter + __stable_partition_adaptive(_ForwardIter __first, _ForwardIter __last, + _Predicate __pred, _Distance __len, + _Pointer __buffer, + _Distance __buffer_size) + { + if (__len <= __buffer_size) { + _ForwardIter __result1 = __first; + _Pointer __result2 = __buffer; + for ( ; __first != __last ; ++__first) + if (__pred(*__first)) { + *__result1 = *__first; + ++__result1; + } + else { + *__result2 = *__first; + ++__result2; + } + copy(__buffer, __result2, __result1); + return __result1; + } + else { + _ForwardIter __middle = __first; + advance(__middle, __len / 2); + _ForwardIter __begin = __stable_partition_adaptive(__first, __middle, + __pred, + __len / 2, + __buffer, __buffer_size); + _ForwardIter __end = __stable_partition_adaptive( __middle, __last, + __pred, + __len - __len / 2, + __buffer, __buffer_size); + rotate(__begin, __middle, __end); + advance(__begin, distance(__middle, __end)); + return __begin; } } - else { - for (_Distance __j = 0; __j < __k/__d - 1; __j ++) { - if (__p < __last - __k) { - *__p = *(__p + __k); - __p += __k; - } + template + _ForwardIter + stable_partition(_ForwardIter __first, _ForwardIter __last, + _Predicate __pred) + { + // concept requirements + __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, + typename iterator_traits<_ForwardIter>::value_type>); + + if (__first == __last) + return __first; + else + { + typedef typename iterator_traits<_ForwardIter>::value_type _ValueType; + typedef typename iterator_traits<_ForwardIter>::difference_type _DistanceType; + + _Temporary_buffer<_ForwardIter, _ValueType> __buf(__first, __last); + if (__buf.size() > 0) + return __stable_partition_adaptive(__first, __last, __pred, + _DistanceType(__buf.requested_size()), + __buf.begin(), __buf.size()); + else + return __inplace_stable_partition(__first, __last, __pred, + _DistanceType(__buf.requested_size())); + } + } - *__p = * (__p - __l); - __p -= __l; + template + _RandomAccessIter + __unguarded_partition(_RandomAccessIter __first, _RandomAccessIter __last, + _Tp __pivot) + { + while (true) { + while (*__first < __pivot) + ++__first; + --__last; + while (__pivot < *__last) + --__last; + if (!(__first < __last)) + return __first; + iter_swap(__first, __last); + ++__first; + } + } + + template + _RandomAccessIter + __unguarded_partition(_RandomAccessIter __first, _RandomAccessIter __last, + _Tp __pivot, _Compare __comp) + { + while (true) { + while (__comp(*__first, __pivot)) + ++__first; + --__last; + while (__comp(__pivot, *__last)) + --__last; + if (!(__first < __last)) + return __first; + iter_swap(__first, __last); + ++__first; } } - *__p = __tmp; - ++__first; - } + const int __stl_threshold = 16; - return __result; -} + // sort() and its auxiliary functions. -template -inline _ForwardIter rotate(_ForwardIter __first, _ForwardIter __middle, - _ForwardIter __last) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); + template + void + __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val) + { + _RandomAccessIter __next = __last; + --__next; + while (__val < *__next) { + *__last = *__next; + __last = __next; + --__next; + } + *__last = __val; + } + + template + void + __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val, _Compare __comp) + { + _RandomAccessIter __next = __last; + --__next; + while (__comp(__val, *__next)) { + *__last = *__next; + __last = __next; + --__next; + } + *__last = __val; + } + + template + void + __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last) + { + if (__first == __last) return; + + for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i) + { + typename iterator_traits<_RandomAccessIter>::value_type __val = *__i; + if (__val < *__first) { + copy_backward(__first, __i, __i + 1); + *__first = __val; + } + else + __unguarded_linear_insert(__i, __val); + } + } - return __rotate(__first, __middle, __last, - __distance_type(__first), - __iterator_category(__first)); -} + template + void + __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, + _Compare __comp) + { + if (__first == __last) return; + + for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i) + { + typename iterator_traits<_RandomAccessIter>::value_type __val = *__i; + if (__comp(__val, *__first)) { + copy_backward(__first, __i, __i + 1); + *__first = __val; + } + else + __unguarded_linear_insert(__i, __val, __comp); + } + } -template -_OutputIter rotate_copy(_ForwardIter __first, _ForwardIter __middle, - _ForwardIter __last, _OutputIter __result) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_ForwardIter>::value_type>); - - return copy(__first, __middle, copy(__middle, __last, __result)); -} - -// 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 -inline _Distance __random_number(_Distance __n) { -#ifdef _GLIBCPP_HAVE_DRAND48 - return lrand48() % __n; -#else - return rand() % __n; -#endif -} - -// random_shuffle - -template -inline void random_shuffle(_RandomAccessIter __first, - _RandomAccessIter __last) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIter>); - - if (__first == __last) return; - for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i) - iter_swap(__i, __first + __random_number((__i - __first) + 1)); -} - -template -void random_shuffle(_RandomAccessIter __first, _RandomAccessIter __last, - _RandomNumberGenerator& __rand) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIter>); + template + inline void + __unguarded_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last) + { + typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType; + + for (_RandomAccessIter __i = __first; __i != __last; ++__i) + __unguarded_linear_insert(__i, _ValueType(*__i)); + } + + template + inline void + __unguarded_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, + _Compare __comp) + { + typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType; + + for (_RandomAccessIter __i = __first; __i != __last; ++__i) + __unguarded_linear_insert(__i, _ValueType(*__i), __comp); + } + + template + void + __final_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last) + { + if (__last - __first > __stl_threshold) { + __insertion_sort(__first, __first + __stl_threshold); + __unguarded_insertion_sort(__first + __stl_threshold, __last); + } + else + __insertion_sort(__first, __last); + } - if (__first == __last) return; - for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i) - iter_swap(__i, __first + __rand((__i - __first) + 1)); -} + template + void + __final_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, + _Compare __comp) + { + if (__last - __first > __stl_threshold) { + __insertion_sort(__first, __first + __stl_threshold, __comp); + __unguarded_insertion_sort(__first + __stl_threshold, __last, __comp); + } + else + __insertion_sort(__first, __last, __comp); + } + + template + inline _Size + __lg(_Size __n) + { + _Size __k; + for (__k = 0; __n != 1; __n >>= 1) ++__k; + return __k; + } + + template + void + __introsort_loop(_RandomAccessIter __first, _RandomAccessIter __last, + _Size __depth_limit) + { + typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType; + + while (__last - __first > __stl_threshold) { + if (__depth_limit == 0) { + partial_sort(__first, __last, __last); + return; + } + --__depth_limit; + _RandomAccessIter __cut = + __unguarded_partition(__first, __last, + _ValueType(__median(*__first, + *(__first + (__last - __first)/2), + *(__last - 1)))); + __introsort_loop(__cut, __last, __depth_limit); + __last = __cut; + } + } -// random_sample and random_sample_n (extensions, not part of the standard). + template + void + __introsort_loop(_RandomAccessIter __first, _RandomAccessIter __last, + _Size __depth_limit, _Compare __comp) + { + typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType; + + while (__last - __first > __stl_threshold) { + if (__depth_limit == 0) { + partial_sort(__first, __last, __last, __comp); + return; + } + --__depth_limit; + _RandomAccessIter __cut = + __unguarded_partition(__first, __last, + _ValueType(__median(*__first, + *(__first + (__last - __first)/2), + *(__last - 1), __comp)), + __comp); + __introsort_loop(__cut, __last, __depth_limit, __comp); + __last = __cut; + } + } -template -_OutputIter random_sample_n(_ForwardIter __first, _ForwardIter __last, - _OutputIter __out, const _Distance __n) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_ForwardIter>::value_type>); - - _Distance __remaining = 0; - distance(__first, __last, __remaining); - _Distance __m = min(__n, __remaining); - - while (__m > 0) { - if (__random_number(__remaining) < __m) { - *__out = *__first; - ++__out; - --__m; - } - - --__remaining; - ++__first; - } - return __out; -} - -template -_OutputIter random_sample_n(_ForwardIter __first, _ForwardIter __last, - _OutputIter __out, const _Distance __n, - _RandomNumberGenerator& __rand) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_ForwardIter>::value_type>); - __glibcpp_function_requires(_UnaryFunctionConcept< - _RandomNumberGenerator, _Distance, _Distance>); - - _Distance __remaining = 0; - distance(__first, __last, __remaining); - _Distance __m = min(__n, __remaining); - - while (__m > 0) { - if (__rand(__remaining) < __m) { - *__out = *__first; - ++__out; - --__m; - } - - --__remaining; - ++__first; - } - return __out; -} - -template -_RandomAccessIter __random_sample(_InputIter __first, _InputIter __last, - _RandomAccessIter __out, - const _Distance __n) -{ - _Distance __m = 0; - _Distance __t = __n; - for ( ; __first != __last && __m < __n; ++__m, ++__first) - __out[__m] = *__first; - - while (__first != __last) { - ++__t; - _Distance __M = __random_number(__t); - if (__M < __n) - __out[__M] = *__first; - ++__first; - } - - return __out + __m; -} - -template -_RandomAccessIter __random_sample(_InputIter __first, _InputIter __last, - _RandomAccessIter __out, - _RandomNumberGenerator& __rand, - const _Distance __n) -{ - // concept requirements - __glibcpp_function_requires(_UnaryFunctionConcept< - _RandomNumberGenerator, _Distance, _Distance>); - - _Distance __m = 0; - _Distance __t = __n; - for ( ; __first != __last && __m < __n; ++__m, ++__first) - __out[__m] = *__first; - - while (__first != __last) { - ++__t; - _Distance __M = __rand(__t); - if (__M < __n) - __out[__M] = *__first; - ++__first; - } - - return __out + __m; -} - -template -inline _RandomAccessIter -random_sample(_InputIter __first, _InputIter __last, - _RandomAccessIter __out_first, _RandomAccessIter __out_last) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIter>); - - return __random_sample(__first, __last, - __out_first, __out_last - __out_first); -} - - -template -inline _RandomAccessIter -random_sample(_InputIter __first, _InputIter __last, - _RandomAccessIter __out_first, _RandomAccessIter __out_last, - _RandomNumberGenerator& __rand) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIter>); - - return __random_sample(__first, __last, - __out_first, __rand, - __out_last - __out_first); -} - -// partition, stable_partition, and their auxiliary functions - -template -_ForwardIter __partition(_ForwardIter __first, - _ForwardIter __last, - _Predicate __pred, - forward_iterator_tag) -{ - if (__first == __last) return __first; + template + inline void + sort(_RandomAccessIter __first, _RandomAccessIter __last) + { + typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType; + + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIter>); + __glibcpp_function_requires(_LessThanComparableConcept<_ValueType>); + + if (__first != __last) { + __introsort_loop(__first, __last, __lg(__last - __first) * 2); + __final_insertion_sort(__first, __last); + } + } + + template + inline void + sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp) + { + typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType; + + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIter>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _ValueType, _ValueType>); + + if (__first != __last) { + __introsort_loop(__first, __last, __lg(__last - __first) * 2, __comp); + __final_insertion_sort(__first, __last, __comp); + } + } - while (__pred(*__first)) - if (++__first == __last) return __first; + // stable_sort() and its auxiliary functions. - _ForwardIter __next = __first; + template + void + __inplace_stable_sort(_RandomAccessIter __first, _RandomAccessIter __last) + { + if (__last - __first < 15) { + __insertion_sort(__first, __last); + return; + } + _RandomAccessIter __middle = __first + (__last - __first) / 2; + __inplace_stable_sort(__first, __middle); + __inplace_stable_sort(__middle, __last); + __merge_without_buffer(__first, __middle, __last, + __middle - __first, + __last - __middle); + } + + template + void + __inplace_stable_sort(_RandomAccessIter __first, _RandomAccessIter __last, + _Compare __comp) + { + if (__last - __first < 15) { + __insertion_sort(__first, __last, __comp); + return; + } + _RandomAccessIter __middle = __first + (__last - __first) / 2; + __inplace_stable_sort(__first, __middle, __comp); + __inplace_stable_sort(__middle, __last, __comp); + __merge_without_buffer(__first, __middle, __last, + __middle - __first, + __last - __middle, + __comp); + } + + template + void + __merge_sort_loop(_RandomAccessIter1 __first, _RandomAccessIter1 __last, + _RandomAccessIter2 __result, _Distance __step_size) + { + _Distance __two_step = 2 * __step_size; + + while (__last - __first >= __two_step) { + __result = merge(__first, __first + __step_size, + __first + __step_size, __first + __two_step, + __result); + __first += __two_step; + } - while (++__next != __last) - if (__pred(*__next)) { - swap(*__first, *__next); - ++__first; + __step_size = min(_Distance(__last - __first), __step_size); + merge(__first, __first + __step_size, __first + __step_size, __last, + __result); + } + + template + void + __merge_sort_loop(_RandomAccessIter1 __first, _RandomAccessIter1 __last, + _RandomAccessIter2 __result, _Distance __step_size, + _Compare __comp) + { + _Distance __two_step = 2 * __step_size; + + while (__last - __first >= __two_step) { + __result = merge(__first, __first + __step_size, + __first + __step_size, __first + __two_step, + __result, + __comp); + __first += __two_step; + } + __step_size = min(_Distance(__last - __first), __step_size); + + merge(__first, __first + __step_size, + __first + __step_size, __last, + __result, + __comp); + } + + const int __stl_chunk_size = 7; + + template + void + __chunk_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, + _Distance __chunk_size) + { + while (__last - __first >= __chunk_size) { + __insertion_sort(__first, __first + __chunk_size); + __first += __chunk_size; + } + __insertion_sort(__first, __last); } - return __first; -} + template + void + __chunk_insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last, + _Distance __chunk_size, _Compare __comp) + { + while (__last - __first >= __chunk_size) { + __insertion_sort(__first, __first + __chunk_size, __comp); + __first += __chunk_size; + } + __insertion_sort(__first, __last, __comp); + } -template -_BidirectionalIter __partition(_BidirectionalIter __first, - _BidirectionalIter __last, - _Predicate __pred, - bidirectional_iterator_tag) -{ - while (true) { - while (true) - if (__first == __last) - return __first; - else if (__pred(*__first)) - ++__first; - else - break; - --__last; - while (true) - if (__first == __last) - return __first; - else if (!__pred(*__last)) - --__last; - else - break; - iter_swap(__first, __last); - ++__first; - } -} - -template -inline _ForwardIter partition(_ForwardIter __first, - _ForwardIter __last, - _Predicate __pred) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_ForwardIter>::value_type>); + template + void + __merge_sort_with_buffer(_RandomAccessIter __first, _RandomAccessIter __last, + _Pointer __buffer) + { + typedef typename iterator_traits<_RandomAccessIter>::difference_type _Distance; - return __partition(__first, __last, __pred, __iterator_category(__first)); -} + _Distance __len = __last - __first; + _Pointer __buffer_last = __buffer + __len; + _Distance __step_size = __stl_chunk_size; + __chunk_insertion_sort(__first, __last, __step_size); -template -_ForwardIter __inplace_stable_partition(_ForwardIter __first, - _ForwardIter __last, - _Predicate __pred, _Distance __len) -{ - if (__len == 1) - return __pred(*__first) ? __last : __first; - _ForwardIter __middle = __first; - advance(__middle, __len / 2); - return rotate(__inplace_stable_partition(__first, __middle, __pred, - __len / 2), - __middle, - __inplace_stable_partition(__middle, __last, __pred, - __len - __len / 2)); -} - -template -_ForwardIter __stable_partition_adaptive(_ForwardIter __first, - _ForwardIter __last, - _Predicate __pred, _Distance __len, - _Pointer __buffer, - _Distance __buffer_size) -{ - if (__len <= __buffer_size) { - _ForwardIter __result1 = __first; - _Pointer __result2 = __buffer; - for ( ; __first != __last ; ++__first) - if (__pred(*__first)) { - *__result1 = *__first; - ++__result1; + while (__step_size < __len) { + __merge_sort_loop(__first, __last, __buffer, __step_size); + __step_size *= 2; + __merge_sort_loop(__buffer, __buffer_last, __first, __step_size); + __step_size *= 2; } - else { - *__result2 = *__first; - ++__result2; - } - copy(__buffer, __result2, __result1); - return __result1; - } - else { - _ForwardIter __middle = __first; - advance(__middle, __len / 2); - return rotate(__stable_partition_adaptive( - __first, __middle, __pred, - __len / 2, __buffer, __buffer_size), - __middle, - __stable_partition_adaptive( - __middle, __last, __pred, - __len - __len / 2, __buffer, __buffer_size)); - } -} - -template -inline _ForwardIter -__stable_partition_aux(_ForwardIter __first, _ForwardIter __last, - _Predicate __pred, _Tp*, _Distance*) -{ - _Temporary_buffer<_ForwardIter, _Tp> __buf(__first, __last); - if (__buf.size() > 0) - return __stable_partition_adaptive(__first, __last, __pred, - _Distance(__buf.requested_size()), - __buf.begin(), __buf.size()); - else - return __inplace_stable_partition(__first, __last, __pred, - _Distance(__buf.requested_size())); -} - -template -inline _ForwardIter stable_partition(_ForwardIter __first, - _ForwardIter __last, - _Predicate __pred) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_UnaryPredicateConcept<_Predicate, - typename iterator_traits<_ForwardIter>::value_type>); - - if (__first == __last) - return __first; - else - return __stable_partition_aux(__first, __last, __pred, - __value_type(__first), - __distance_type(__first)); -} - -template -_RandomAccessIter __unguarded_partition(_RandomAccessIter __first, - _RandomAccessIter __last, - _Tp __pivot) -{ - while (true) { - while (*__first < __pivot) - ++__first; - --__last; - while (__pivot < *__last) - --__last; - if (!(__first < __last)) - return __first; - iter_swap(__first, __last); - ++__first; - } -} - -template -_RandomAccessIter __unguarded_partition(_RandomAccessIter __first, - _RandomAccessIter __last, - _Tp __pivot, _Compare __comp) -{ - while (true) { - while (__comp(*__first, __pivot)) - ++__first; - --__last; - while (__comp(__pivot, *__last)) - --__last; - if (!(__first < __last)) - return __first; - iter_swap(__first, __last); - ++__first; - } -} + } -const int __stl_threshold = 16; + template + void + __merge_sort_with_buffer(_RandomAccessIter __first, _RandomAccessIter __last, + _Pointer __buffer, _Compare __comp) + { + typedef typename iterator_traits<_RandomAccessIter>::difference_type _Distance; -// sort() and its auxiliary functions. + _Distance __len = __last - __first; + _Pointer __buffer_last = __buffer + __len; -template -void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val) -{ - _RandomAccessIter __next = __last; - --__next; - while (__val < *__next) { - *__last = *__next; - __last = __next; - --__next; - } - *__last = __val; -} - -template -void __unguarded_linear_insert(_RandomAccessIter __last, _Tp __val, - _Compare __comp) -{ - _RandomAccessIter __next = __last; - --__next; - while (__comp(__val, *__next)) { - *__last = *__next; - __last = __next; - --__next; - } - *__last = __val; -} - -template -inline void __linear_insert(_RandomAccessIter __first, - _RandomAccessIter __last, _Tp*) -{ - _Tp __val = *__last; - if (__val < *__first) { - copy_backward(__first, __last, __last + 1); - *__first = __val; - } - else - __unguarded_linear_insert(__last, __val); -} - -template -inline void __linear_insert(_RandomAccessIter __first, - _RandomAccessIter __last, _Tp*, _Compare __comp) -{ - _Tp __val = *__last; - if (__comp(__val, *__first)) { - copy_backward(__first, __last, __last + 1); - *__first = __val; - } - else - __unguarded_linear_insert(__last, __val, __comp); -} - -template -void __insertion_sort(_RandomAccessIter __first, _RandomAccessIter __last) -{ - if (__first == __last) return; - for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i) - __linear_insert(__first, __i, __value_type(__first)); -} - -template -void __insertion_sort(_RandomAccessIter __first, - _RandomAccessIter __last, _Compare __comp) -{ - if (__first == __last) return; - for (_RandomAccessIter __i = __first + 1; __i != __last; ++__i) - __linear_insert(__first, __i, __value_type(__first), __comp); -} - -template -void __unguarded_insertion_sort_aux(_RandomAccessIter __first, - _RandomAccessIter __last, _Tp*) -{ - for (_RandomAccessIter __i = __first; __i != __last; ++__i) - __unguarded_linear_insert(__i, _Tp(*__i)); -} - -template -inline void __unguarded_insertion_sort(_RandomAccessIter __first, - _RandomAccessIter __last) { - __unguarded_insertion_sort_aux(__first, __last, __value_type(__first)); -} - -template -void __unguarded_insertion_sort_aux(_RandomAccessIter __first, - _RandomAccessIter __last, - _Tp*, _Compare __comp) -{ - for (_RandomAccessIter __i = __first; __i != __last; ++__i) - __unguarded_linear_insert(__i, _Tp(*__i), __comp); -} - -template -inline void __unguarded_insertion_sort(_RandomAccessIter __first, - _RandomAccessIter __last, - _Compare __comp) -{ - __unguarded_insertion_sort_aux(__first, __last, __value_type(__first), - __comp); -} + _Distance __step_size = __stl_chunk_size; + __chunk_insertion_sort(__first, __last, __step_size, __comp); -template -void __final_insertion_sort(_RandomAccessIter __first, - _RandomAccessIter __last) -{ - if (__last - __first > __stl_threshold) { - __insertion_sort(__first, __first + __stl_threshold); - __unguarded_insertion_sort(__first + __stl_threshold, __last); - } - else - __insertion_sort(__first, __last); -} - -template -void __final_insertion_sort(_RandomAccessIter __first, - _RandomAccessIter __last, _Compare __comp) -{ - if (__last - __first > __stl_threshold) { - __insertion_sort(__first, __first + __stl_threshold, __comp); - __unguarded_insertion_sort(__first + __stl_threshold, __last, __comp); - } - else - __insertion_sort(__first, __last, __comp); -} - -template -inline _Size __lg(_Size __n) -{ - _Size __k; - for (__k = 0; __n != 1; __n >>= 1) ++__k; - return __k; -} - -template -void __introsort_loop(_RandomAccessIter __first, - _RandomAccessIter __last, _Tp*, - _Size __depth_limit) -{ - while (__last - __first > __stl_threshold) { - if (__depth_limit == 0) { - partial_sort(__first, __last, __last); - return; - } - --__depth_limit; - _RandomAccessIter __cut = - __unguarded_partition(__first, __last, - _Tp(__median(*__first, - *(__first + (__last - __first)/2), - *(__last - 1)))); - __introsort_loop(__cut, __last, (_Tp*) 0, __depth_limit); - __last = __cut; - } -} - -template -void __introsort_loop(_RandomAccessIter __first, - _RandomAccessIter __last, _Tp*, - _Size __depth_limit, _Compare __comp) -{ - while (__last - __first > __stl_threshold) { - if (__depth_limit == 0) { - partial_sort(__first, __last, __last, __comp); - return; - } - --__depth_limit; - _RandomAccessIter __cut = - __unguarded_partition(__first, __last, - _Tp(__median(*__first, - *(__first + (__last - __first)/2), - *(__last - 1), __comp)), - __comp); - __introsort_loop(__cut, __last, (_Tp*) 0, __depth_limit, __comp); - __last = __cut; - } -} - -template -inline void sort(_RandomAccessIter __first, _RandomAccessIter __last) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIter>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_RandomAccessIter>::value_type>); - - if (__first != __last) { - __introsort_loop(__first, __last, - __value_type(__first), - __lg(__last - __first) * 2); - __final_insertion_sort(__first, __last); - } -} - -template -inline void sort(_RandomAccessIter __first, _RandomAccessIter __last, - _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIter>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_RandomAccessIter>::value_type, - typename iterator_traits<_RandomAccessIter>::value_type>); - - if (__first != __last) { - __introsort_loop(__first, __last, - __value_type(__first), - __lg(__last - __first) * 2, - __comp); - __final_insertion_sort(__first, __last, __comp); - } -} - -// stable_sort() and its auxiliary functions. - -template -void __inplace_stable_sort(_RandomAccessIter __first, - _RandomAccessIter __last) -{ - if (__last - __first < 15) { - __insertion_sort(__first, __last); - return; - } - _RandomAccessIter __middle = __first + (__last - __first) / 2; - __inplace_stable_sort(__first, __middle); - __inplace_stable_sort(__middle, __last); - __merge_without_buffer(__first, __middle, __last, - __middle - __first, - __last - __middle); -} - -template -void __inplace_stable_sort(_RandomAccessIter __first, - _RandomAccessIter __last, _Compare __comp) -{ - if (__last - __first < 15) { - __insertion_sort(__first, __last, __comp); - return; - } - _RandomAccessIter __middle = __first + (__last - __first) / 2; - __inplace_stable_sort(__first, __middle, __comp); - __inplace_stable_sort(__middle, __last, __comp); - __merge_without_buffer(__first, __middle, __last, - __middle - __first, - __last - __middle, - __comp); -} - -template -void __merge_sort_loop(_RandomAccessIter1 __first, - _RandomAccessIter1 __last, - _RandomAccessIter2 __result, _Distance __step_size) -{ - _Distance __two_step = 2 * __step_size; - - while (__last - __first >= __two_step) { - __result = merge(__first, __first + __step_size, - __first + __step_size, __first + __two_step, - __result); - __first += __two_step; - } - - __step_size = min(_Distance(__last - __first), __step_size); - merge(__first, __first + __step_size, __first + __step_size, __last, - __result); -} - -template -void __merge_sort_loop(_RandomAccessIter1 __first, - _RandomAccessIter1 __last, - _RandomAccessIter2 __result, _Distance __step_size, - _Compare __comp) -{ - _Distance __two_step = 2 * __step_size; - - while (__last - __first >= __two_step) { - __result = merge(__first, __first + __step_size, - __first + __step_size, __first + __two_step, - __result, - __comp); - __first += __two_step; - } - __step_size = min(_Distance(__last - __first), __step_size); - - merge(__first, __first + __step_size, - __first + __step_size, __last, - __result, - __comp); -} - -const int __stl_chunk_size = 7; - -template -void __chunk_insertion_sort(_RandomAccessIter __first, - _RandomAccessIter __last, _Distance __chunk_size) -{ - while (__last - __first >= __chunk_size) { - __insertion_sort(__first, __first + __chunk_size); - __first += __chunk_size; - } - __insertion_sort(__first, __last); -} - -template -void __chunk_insertion_sort(_RandomAccessIter __first, - _RandomAccessIter __last, - _Distance __chunk_size, _Compare __comp) -{ - while (__last - __first >= __chunk_size) { - __insertion_sort(__first, __first + __chunk_size, __comp); - __first += __chunk_size; - } - __insertion_sort(__first, __last, __comp); -} - -template -void __merge_sort_with_buffer(_RandomAccessIter __first, - _RandomAccessIter __last, - _Pointer __buffer, _Distance*) -{ - _Distance __len = __last - __first; - _Pointer __buffer_last = __buffer + __len; - - _Distance __step_size = __stl_chunk_size; - __chunk_insertion_sort(__first, __last, __step_size); - - while (__step_size < __len) { - __merge_sort_loop(__first, __last, __buffer, __step_size); - __step_size *= 2; - __merge_sort_loop(__buffer, __buffer_last, __first, __step_size); - __step_size *= 2; - } -} - -template -void __merge_sort_with_buffer(_RandomAccessIter __first, - _RandomAccessIter __last, _Pointer __buffer, - _Distance*, _Compare __comp) -{ - _Distance __len = __last - __first; - _Pointer __buffer_last = __buffer + __len; - - _Distance __step_size = __stl_chunk_size; - __chunk_insertion_sort(__first, __last, __step_size, __comp); - - while (__step_size < __len) { - __merge_sort_loop(__first, __last, __buffer, __step_size, __comp); - __step_size *= 2; - __merge_sort_loop(__buffer, __buffer_last, __first, __step_size, __comp); - __step_size *= 2; - } -} - -template -void __stable_sort_adaptive(_RandomAccessIter __first, - _RandomAccessIter __last, _Pointer __buffer, - _Distance __buffer_size) -{ - _Distance __len = (__last - __first + 1) / 2; - _RandomAccessIter __middle = __first + __len; - if (__len > __buffer_size) { - __stable_sort_adaptive(__first, __middle, __buffer, __buffer_size); - __stable_sort_adaptive(__middle, __last, __buffer, __buffer_size); - } - else { - __merge_sort_with_buffer(__first, __middle, __buffer, (_Distance*)0); - __merge_sort_with_buffer(__middle, __last, __buffer, (_Distance*)0); - } - __merge_adaptive(__first, __middle, __last, _Distance(__middle - __first), - _Distance(__last - __middle), __buffer, __buffer_size); -} - -template -void __stable_sort_adaptive(_RandomAccessIter __first, - _RandomAccessIter __last, _Pointer __buffer, - _Distance __buffer_size, _Compare __comp) -{ - _Distance __len = (__last - __first + 1) / 2; - _RandomAccessIter __middle = __first + __len; - if (__len > __buffer_size) { - __stable_sort_adaptive(__first, __middle, __buffer, __buffer_size, - __comp); - __stable_sort_adaptive(__middle, __last, __buffer, __buffer_size, - __comp); - } - else { - __merge_sort_with_buffer(__first, __middle, __buffer, (_Distance*)0, + while (__step_size < __len) { + __merge_sort_loop(__first, __last, __buffer, __step_size, __comp); + __step_size *= 2; + __merge_sort_loop(__buffer, __buffer_last, __first, __step_size, __comp); + __step_size *= 2; + } + } + + template + void + __stable_sort_adaptive(_RandomAccessIter __first, _RandomAccessIter __last, + _Pointer __buffer, _Distance __buffer_size) + { + _Distance __len = (__last - __first + 1) / 2; + _RandomAccessIter __middle = __first + __len; + if (__len > __buffer_size) { + __stable_sort_adaptive(__first, __middle, __buffer, __buffer_size); + __stable_sort_adaptive(__middle, __last, __buffer, __buffer_size); + } + else { + __merge_sort_with_buffer(__first, __middle, __buffer); + __merge_sort_with_buffer(__middle, __last, __buffer); + } + __merge_adaptive(__first, __middle, __last, _Distance(__middle - __first), + _Distance(__last - __middle), __buffer, __buffer_size); + } + + template + void + __stable_sort_adaptive(_RandomAccessIter __first, _RandomAccessIter __last, + _Pointer __buffer, _Distance __buffer_size, + _Compare __comp) + { + _Distance __len = (__last - __first + 1) / 2; + _RandomAccessIter __middle = __first + __len; + if (__len > __buffer_size) { + __stable_sort_adaptive(__first, __middle, __buffer, __buffer_size, __comp); - __merge_sort_with_buffer(__middle, __last, __buffer, (_Distance*)0, + __stable_sort_adaptive(__middle, __last, __buffer, __buffer_size, __comp); - } - __merge_adaptive(__first, __middle, __last, _Distance(__middle - __first), - _Distance(__last - __middle), __buffer, __buffer_size, - __comp); -} - -template -inline void __stable_sort_aux(_RandomAccessIter __first, - _RandomAccessIter __last, _Tp*, _Distance*) -{ - _Temporary_buffer<_RandomAccessIter, _Tp> buf(__first, __last); - if (buf.begin() == 0) - __inplace_stable_sort(__first, __last); - else - __stable_sort_adaptive(__first, __last, buf.begin(), - _Distance(buf.size())); -} - -template -inline void __stable_sort_aux(_RandomAccessIter __first, - _RandomAccessIter __last, _Tp*, _Distance*, - _Compare __comp) -{ - _Temporary_buffer<_RandomAccessIter, _Tp> buf(__first, __last); - if (buf.begin() == 0) - __inplace_stable_sort(__first, __last, __comp); - else - __stable_sort_adaptive(__first, __last, buf.begin(), - _Distance(buf.size()), - __comp); -} - -template -inline void stable_sort(_RandomAccessIter __first, - _RandomAccessIter __last) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIter>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_RandomAccessIter>::value_type>); - - __stable_sort_aux(__first, __last, - __value_type(__first), - __distance_type(__first)); -} - -template -inline void stable_sort(_RandomAccessIter __first, - _RandomAccessIter __last, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIter>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_RandomAccessIter>::value_type, - typename iterator_traits<_RandomAccessIter>::value_type>); - - __stable_sort_aux(__first, __last, - __value_type(__first), - __distance_type(__first), - __comp); -} - -// partial_sort, partial_sort_copy, and auxiliary functions. - -template -void __partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle, - _RandomAccessIter __last, _Tp*) -{ - make_heap(__first, __middle); - for (_RandomAccessIter __i = __middle; __i < __last; ++__i) - if (*__i < *__first) - __pop_heap(__first, __middle, __i, _Tp(*__i), - __distance_type(__first)); - sort_heap(__first, __middle); -} - -template -inline void partial_sort(_RandomAccessIter __first, - _RandomAccessIter __middle, - _RandomAccessIter __last) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIter>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_RandomAccessIter>::value_type>); - - __partial_sort(__first, __middle, __last, __value_type(__first)); -} - -template -void __partial_sort(_RandomAccessIter __first, _RandomAccessIter __middle, - _RandomAccessIter __last, _Tp*, _Compare __comp) -{ - make_heap(__first, __middle, __comp); - for (_RandomAccessIter __i = __middle; __i < __last; ++__i) - if (__comp(*__i, *__first)) - __pop_heap(__first, __middle, __i, _Tp(*__i), __comp, - __distance_type(__first)); - sort_heap(__first, __middle, __comp); -} - -template -inline void partial_sort(_RandomAccessIter __first, - _RandomAccessIter __middle, - _RandomAccessIter __last, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIter>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_RandomAccessIter>::value_type, - typename iterator_traits<_RandomAccessIter>::value_type>); - - __partial_sort(__first, __middle, __last, __value_type(__first), __comp); -} - -template -_RandomAccessIter __partial_sort_copy(_InputIter __first, - _InputIter __last, - _RandomAccessIter __result_first, - _RandomAccessIter __result_last, - _Distance*, _Tp*) -{ - if (__result_first == __result_last) return __result_last; - _RandomAccessIter __result_real_last = __result_first; - while(__first != __last && __result_real_last != __result_last) { - *__result_real_last = *__first; - ++__result_real_last; - ++__first; - } - make_heap(__result_first, __result_real_last); - while (__first != __last) { - if (*__first < *__result_first) - __adjust_heap(__result_first, _Distance(0), - _Distance(__result_real_last - __result_first), - _Tp(*__first)); - ++__first; - } - sort_heap(__result_first, __result_real_last); - return __result_real_last; -} - -template -inline _RandomAccessIter -partial_sort_copy(_InputIter __first, _InputIter __last, - _RandomAccessIter __result_first, - _RandomAccessIter __result_last) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_ConvertibleConcept< - typename iterator_traits<_InputIter>::value_type, - typename iterator_traits<_RandomAccessIter>::value_type>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_RandomAccessIter>::value_type>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIter>::value_type>); - - return __partial_sort_copy(__first, __last, __result_first, __result_last, - __distance_type(__result_first), - __value_type(__first)); -} - -template -_RandomAccessIter __partial_sort_copy(_InputIter __first, - _InputIter __last, - _RandomAccessIter __result_first, - _RandomAccessIter __result_last, - _Compare __comp, _Distance*, _Tp*) -{ - if (__result_first == __result_last) return __result_last; - _RandomAccessIter __result_real_last = __result_first; - while(__first != __last && __result_real_last != __result_last) { - *__result_real_last = *__first; - ++__result_real_last; - ++__first; - } - make_heap(__result_first, __result_real_last, __comp); - while (__first != __last) { - if (__comp(*__first, *__result_first)) - __adjust_heap(__result_first, _Distance(0), - _Distance(__result_real_last - __result_first), - _Tp(*__first), - __comp); - ++__first; - } - sort_heap(__result_first, __result_real_last, __comp); - return __result_real_last; -} - -template -inline _RandomAccessIter -partial_sort_copy(_InputIter __first, _InputIter __last, - _RandomAccessIter __result_first, - _RandomAccessIter __result_last, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIter>); - __glibcpp_function_requires(_ConvertibleConcept< - typename iterator_traits<_InputIter>::value_type, - typename iterator_traits<_RandomAccessIter>::value_type>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_RandomAccessIter>::value_type, - typename iterator_traits<_RandomAccessIter>::value_type>); - - return __partial_sort_copy(__first, __last, __result_first, __result_last, - __comp, - __distance_type(__result_first), - __value_type(__first)); -} - -// nth_element() and its auxiliary functions. - -template -void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth, - _RandomAccessIter __last, _Tp*) -{ - while (__last - __first > 3) { - _RandomAccessIter __cut = - __unguarded_partition(__first, __last, - _Tp(__median(*__first, - *(__first + (__last - __first)/2), - *(__last - 1)))); - if (__cut <= __nth) - __first = __cut; - else - __last = __cut; - } - __insertion_sort(__first, __last); -} - -template -inline void nth_element(_RandomAccessIter __first, _RandomAccessIter __nth, - _RandomAccessIter __last) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIter>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_RandomAccessIter>::value_type>); - - __nth_element(__first, __nth, __last, __value_type(__first)); -} - -template -void __nth_element(_RandomAccessIter __first, _RandomAccessIter __nth, - _RandomAccessIter __last, _Tp*, _Compare __comp) -{ - while (__last - __first > 3) { - _RandomAccessIter __cut = - __unguarded_partition(__first, __last, - _Tp(__median(*__first, - *(__first + (__last - __first)/2), - *(__last - 1), - __comp)), - __comp); - if (__cut <= __nth) - __first = __cut; - else - __last = __cut; - } - __insertion_sort(__first, __last, __comp); -} - -template -inline void nth_element(_RandomAccessIter __first, _RandomAccessIter __nth, - _RandomAccessIter __last, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIter>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_RandomAccessIter>::value_type, - typename iterator_traits<_RandomAccessIter>::value_type>); - - __nth_element(__first, __nth, __last, __value_type(__first), __comp); -} + } + else { + __merge_sort_with_buffer(__first, __middle, __buffer, __comp); + __merge_sort_with_buffer(__middle, __last, __buffer, __comp); + } + __merge_adaptive(__first, __middle, __last, _Distance(__middle - __first), + _Distance(__last - __middle), __buffer, __buffer_size, + __comp); + } + + template + inline void + stable_sort(_RandomAccessIter __first, _RandomAccessIter __last) + { + typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType; + typedef typename iterator_traits<_RandomAccessIter>::difference_type _DistanceType; + + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIter>); + __glibcpp_function_requires(_LessThanComparableConcept<_ValueType>); + + _Temporary_buffer<_RandomAccessIter, _ValueType> buf(__first, __last); + if (buf.begin() == 0) + __inplace_stable_sort(__first, __last); + else + __stable_sort_adaptive(__first, __last, buf.begin(), _DistanceType(buf.size())); + } + + template + inline void + stable_sort(_RandomAccessIter __first, _RandomAccessIter __last, _Compare __comp) + { + typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType; + typedef typename iterator_traits<_RandomAccessIter>::difference_type _DistanceType; + + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIter>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType, _ValueType>); + + _Temporary_buffer<_RandomAccessIter, _ValueType> buf(__first, __last); + if (buf.begin() == 0) + __inplace_stable_sort(__first, __last, __comp); + else + __stable_sort_adaptive(__first, __last, buf.begin(), _DistanceType(buf.size()), + __comp); + } + + template + void + partial_sort(_RandomAccessIter __first, + _RandomAccessIter __middle, + _RandomAccessIter __last) + { + typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType; + + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIter>); + __glibcpp_function_requires(_LessThanComparableConcept<_ValueType); + + make_heap(__first, __middle); + for (_RandomAccessIter __i = __middle; __i < __last; ++__i) + if (*__i < *__first) + __pop_heap(__first, __middle, __i, _ValueType(*__i)); + sort_heap(__first, __middle); + } + + template + void + partial_sort(_RandomAccessIter __first, + _RandomAccessIter __middle, + _RandomAccessIter __last, + _Compare __comp) + { + typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType; + + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIter>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType, _ValueType>); + + make_heap(__first, __middle, __comp); + for (_RandomAccessIter __i = __middle; __i < __last; ++__i) + if (__comp(*__i, *__first)) + __pop_heap(__first, __middle, __i, _ValueType(*__i), __comp); + sort_heap(__first, __middle, __comp); + } + + template + _RandomAccessIter + partial_sort_copy(_InputIter __first, _InputIter __last, + _RandomAccessIter __result_first, + _RandomAccessIter __result_last) + { + typedef typename iterator_traits<_InputIter>::value_type _InputValueType; + typedef typename iterator_traits<_RandomAccessIter>::value_type _OutputValueType; + typedef typename iterator_traits<_RandomAccessIter>::difference_type _DistanceType; + + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_ConvertibleConcept<_InputValueType, _OutputValueType>); + __glibcpp_function_requires(_LessThanComparableConcept<_OutputValueType>); + __glibcpp_function_requires(_LessThanComparableConcept<_InputValueType>); + + if (__result_first == __result_last) return __result_last; + _RandomAccessIter __result_real_last = __result_first; + while(__first != __last && __result_real_last != __result_last) { + *__result_real_last = *__first; + ++__result_real_last; + ++__first; + } + make_heap(__result_first, __result_real_last); + while (__first != __last) { + if (*__first < *__result_first) + __adjust_heap(__result_first, _DistanceType(0), + _DistanceType(__result_real_last - __result_first), + _InputValueType(*__first)); + ++__first; + } + sort_heap(__result_first, __result_real_last); + return __result_real_last; + } + + template + _RandomAccessIter + partial_sort_copy(_InputIter __first, _InputIter __last, + _RandomAccessIter __result_first, + _RandomAccessIter __result_last, + _Compare __comp) + { + typedef typename iterator_traits<_InputIter>::value_type _InputValueType; + typedef typename iterator_traits<_RandomAccessIter>::value_type _OutputValueType; + typedef typename iterator_traits<_RandomAccessIter>::difference_type _DistanceType; + + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<_RandomAccessIter>); + __glibcpp_function_requires(_ConvertibleConcept<_InputValueType, _OutputValueType>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, + _OutputValueType, _OutputValueType>); + + if (__result_first == __result_last) return __result_last; + _RandomAccessIter __result_real_last = __result_first; + while(__first != __last && __result_real_last != __result_last) { + *__result_real_last = *__first; + ++__result_real_last; + ++__first; + } + make_heap(__result_first, __result_real_last, __comp); + while (__first != __last) { + if (__comp(*__first, *__result_first)) + __adjust_heap(__result_first, _DistanceType(0), + _DistanceType(__result_real_last - __result_first), + _InputValueType(*__first), + __comp); + ++__first; + } + sort_heap(__result_first, __result_real_last, __comp); + return __result_real_last; + } + + template + void + nth_element(_RandomAccessIter __first, + _RandomAccessIter __nth, + _RandomAccessIter __last) + { + typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType; + + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<_RandomAccessIter>); + __glibcpp_function_requires(_LessThanComparableConcept<_ValueType>); + + while (__last - __first > 3) { + _RandomAccessIter __cut = + __unguarded_partition(__first, __last, + _ValueType(__median(*__first, + *(__first + (__last - __first)/2), + *(__last - 1)))); + if (__cut <= __nth) + __first = __cut; + else + __last = __cut; + } + __insertion_sort(__first, __last); + } + + template + void + nth_element(_RandomAccessIter __first, + _RandomAccessIter __nth, + _RandomAccessIter __last, + _Compare __comp) + { + typedef typename iterator_traits<_RandomAccessIter>::value_type _ValueType; + + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept<_RandomAccessIter>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType, _ValueType>); + + while (__last - __first > 3) { + _RandomAccessIter __cut = + __unguarded_partition(__first, __last, + _ValueType(__median(*__first, + *(__first + (__last - __first)/2), + *(__last - 1), + __comp)), + __comp); + if (__cut <= __nth) + __first = __cut; + else + __last = __cut; + } + __insertion_sort(__first, __last, __comp); + } + + + // Binary search (lower_bound, upper_bound, equal_range, binary_search). + + template + _ForwardIter + lower_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val) + { + typedef typename iterator_traits<_ForwardIter>::value_type _ValueType; + typedef typename iterator_traits<_ForwardIter>::difference_type _DistanceType; + + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_SameTypeConcept<_Tp, _ValueType>); + __glibcpp_function_requires(_LessThanComparableConcept<_Tp>); + + _DistanceType __len = distance(__first, __last); + _DistanceType __half; + _ForwardIter __middle; + + while (__len > 0) { + __half = __len >> 1; + __middle = __first; + advance(__middle, __half); + if (*__middle < __val) { + __first = __middle; + ++__first; + __len = __len - __half - 1; + } + else + __len = __half; + } + return __first; + } + template + _ForwardIter + lower_bound(_ForwardIter __first, _ForwardIter __last, + const _Tp& __val, _Compare __comp) + { + typedef typename iterator_traits<_ForwardIter>::value_type _ValueType; + typedef typename iterator_traits<_ForwardIter>::difference_type _DistanceType; + + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_SameTypeConcept<_Tp, _ValueType>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>); + + _DistanceType __len = distance(__first, __last); + _DistanceType __half; + _ForwardIter __middle; + + while (__len > 0) { + __half = __len >> 1; + __middle = __first; + advance(__middle, __half); + if (__comp(*__middle, __val)) { + __first = __middle; + ++__first; + __len = __len - __half - 1; + } + else + __len = __half; + } + return __first; + } -// Binary search (lower_bound, upper_bound, equal_range, binary_search). + template + _ForwardIter + upper_bound(_ForwardIter __first, _ForwardIter __last, const _Tp& __val) + { + typedef typename iterator_traits<_ForwardIter>::value_type _ValueType; + typedef typename iterator_traits<_ForwardIter>::difference_type _DistanceType; + + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_SameTypeConcept<_Tp, _ValueType>); + __glibcpp_function_requires(_LessThanComparableConcept<_Tp>); + + _DistanceType __len = distance(__first, __last); + _DistanceType __half; + _ForwardIter __middle; + + while (__len > 0) { + __half = __len >> 1; + __middle = __first; + advance(__middle, __half); + if (__val < *__middle) + __len = __half; + else { + __first = __middle; + ++__first; + __len = __len - __half - 1; + } + } + return __first; + } + + template + _ForwardIter + upper_bound(_ForwardIter __first, _ForwardIter __last, + const _Tp& __val, _Compare __comp) + { + typedef typename iterator_traits<_ForwardIter>::value_type _ValueType; + typedef typename iterator_traits<_ForwardIter>::difference_type _DistanceType; + + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_SameTypeConcept<_Tp, _ValueType>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>); + + _DistanceType __len = distance(__first, __last); + _DistanceType __half; + _ForwardIter __middle; + + while (__len > 0) { + __half = __len >> 1; + __middle = __first; + advance(__middle, __half); + if (__comp(__val, *__middle)) + __len = __half; + else { + __first = __middle; + ++__first; + __len = __len - __half - 1; + } + } + return __first; + } + + template + pair<_ForwardIter, _ForwardIter> + equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val) + { + typedef typename iterator_traits<_ForwardIter>::value_type _ValueType; + typedef typename iterator_traits<_ForwardIter>::difference_type _DistanceType; + + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_SameTypeConcept<_Tp, _ValueType>); + __glibcpp_function_requires(_LessThanComparableConcept<_Tp>); + + _DistanceType __len = distance(__first, __last); + _DistanceType __half; + _ForwardIter __middle, __left, __right; + + while (__len > 0) { + __half = __len >> 1; + __middle = __first; + advance(__middle, __half); + if (*__middle < __val) { + __first = __middle; + ++__first; + __len = __len - __half - 1; + } + else if (__val < *__middle) + __len = __half; + else { + __left = lower_bound(__first, __middle, __val); + advance(__first, __len); + __right = upper_bound(++__middle, __first, __val); + return pair<_ForwardIter, _ForwardIter>(__left, __right); + } + } + return pair<_ForwardIter, _ForwardIter>(__first, __first); + } + + template + pair<_ForwardIter, _ForwardIter> + equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, + _Compare __comp) + { + typedef typename iterator_traits<_ForwardIter>::value_type _ValueType; + typedef typename iterator_traits<_ForwardIter>::difference_type _DistanceType; + + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_SameTypeConcept<_Tp, _ValueType>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>); + + _DistanceType __len = distance(__first, __last); + _DistanceType __half; + _ForwardIter __middle, __left, __right; + + while (__len > 0) { + __half = __len >> 1; + __middle = __first; + advance(__middle, __half); + if (__comp(*__middle, __val)) { + __first = __middle; + ++__first; + __len = __len - __half - 1; + } + else if (__comp(__val, *__middle)) + __len = __half; + else { + __left = lower_bound(__first, __middle, __val, __comp); + advance(__first, __len); + __right = upper_bound(++__middle, __first, __val, __comp); + return pair<_ForwardIter, _ForwardIter>(__left, __right); + } + } + return pair<_ForwardIter, _ForwardIter>(__first, __first); + } + + template + bool + binary_search(_ForwardIter __first, _ForwardIter __last, + const _Tp& __val) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_SameTypeConcept<_Tp, + typename iterator_traits<_ForwardIter>::value_type>); + __glibcpp_function_requires(_LessThanComparableConcept<_Tp>); + + _ForwardIter __i = lower_bound(__first, __last, __val); + return __i != __last && !(__val < *__i); + } + + template + bool + binary_search(_ForwardIter __first, _ForwardIter __last, + const _Tp& __val, _Compare __comp) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_SameTypeConcept<_Tp, + typename iterator_traits<_ForwardIter>::value_type>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>); + + _ForwardIter __i = lower_bound(__first, __last, __val, __comp); + return __i != __last && !__comp(__val, *__i); + } + + // merge, with and without an explicitly supplied comparison function. + + template + _OutputIter + merge(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2, + _OutputIter __result) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter1>::value_type>); + __glibcpp_function_requires(_SameTypeConcept< + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_InputIter1>::value_type>); + + while (__first1 != __last1 && __first2 != __last2) { + if (*__first2 < *__first1) { + *__result = *__first2; + ++__first2; + } + else { + *__result = *__first1; + ++__first1; + } + ++__result; + } + return copy(__first2, __last2, copy(__first1, __last1, __result)); + } + + template + _OutputIter + merge(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2, + _OutputIter __result, _Compare __comp) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_SameTypeConcept< + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter1>::value_type>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + + while (__first1 != __last1 && __first2 != __last2) { + if (__comp(*__first2, *__first1)) { + *__result = *__first2; + ++__first2; + } + else { + *__result = *__first1; + ++__first1; + } + ++__result; + } + return copy(__first2, __last2, copy(__first1, __last1, __result)); + } + + // inplace_merge and its auxiliary functions. + + template + void + __merge_without_buffer(_BidirectionalIter __first, + _BidirectionalIter __middle, + _BidirectionalIter __last, + _Distance __len1, _Distance __len2) + { + if (__len1 == 0 || __len2 == 0) + return; + if (__len1 + __len2 == 2) { + if (*__middle < *__first) + iter_swap(__first, __middle); + return; + } + _BidirectionalIter __first_cut = __first; + _BidirectionalIter __second_cut = __middle; + _Distance __len11 = 0; + _Distance __len22 = 0; + if (__len1 > __len2) { + __len11 = __len1 / 2; + advance(__first_cut, __len11); + __second_cut = lower_bound(__middle, __last, *__first_cut); + __len22 = distance(__middle, __second_cut); + } + else { + __len22 = __len2 / 2; + advance(__second_cut, __len22); + __first_cut = upper_bound(__first, __middle, *__second_cut); + __len11 = distance(__first, __first_cut); + } + rotate(__first_cut, __middle, __second_cut); + _BidirectionalIter __new_middle = __first_cut; + advance(__new_middle, distance(__middle, __second_cut)); + __merge_without_buffer(__first, __first_cut, __new_middle, + __len11, __len22); + __merge_without_buffer(__new_middle, __second_cut, __last, + __len1 - __len11, __len2 - __len22); + } + + template + void + __merge_without_buffer(_BidirectionalIter __first, + _BidirectionalIter __middle, + _BidirectionalIter __last, + _Distance __len1, _Distance __len2, + _Compare __comp) + { + if (__len1 == 0 || __len2 == 0) + return; + if (__len1 + __len2 == 2) { + if (__comp(*__middle, *__first)) + iter_swap(__first, __middle); + return; + } + _BidirectionalIter __first_cut = __first; + _BidirectionalIter __second_cut = __middle; + _Distance __len11 = 0; + _Distance __len22 = 0; + if (__len1 > __len2) { + __len11 = __len1 / 2; + advance(__first_cut, __len11); + __second_cut = lower_bound(__middle, __last, *__first_cut, __comp); + __len22 = distance(__middle, __second_cut); + } + else { + __len22 = __len2 / 2; + advance(__second_cut, __len22); + __first_cut = upper_bound(__first, __middle, *__second_cut, __comp); + __len11 = distance(__first, __first_cut); + } + rotate(__first_cut, __middle, __second_cut); + _BidirectionalIter __new_middle = __first_cut; + advance(__new_middle, distance(__middle, __second_cut)); + __merge_without_buffer(__first, __first_cut, __new_middle, + __len11, __len22, __comp); + __merge_without_buffer(__new_middle, __second_cut, __last, + __len1 - __len11, __len2 - __len22, __comp); + } + + template + _BidirectionalIter1 + __rotate_adaptive(_BidirectionalIter1 __first, + _BidirectionalIter1 __middle, + _BidirectionalIter1 __last, + _Distance __len1, _Distance __len2, + _BidirectionalIter2 __buffer, + _Distance __buffer_size) + { + _BidirectionalIter2 __buffer_end; + if (__len1 > __len2 && __len2 <= __buffer_size) { + __buffer_end = copy(__middle, __last, __buffer); + copy_backward(__first, __middle, __last); + return copy(__buffer, __buffer_end, __first); + } + else if (__len1 <= __buffer_size) { + __buffer_end = copy(__first, __middle, __buffer); + copy(__middle, __last, __first); + return copy_backward(__buffer, __buffer_end, __last); + } + else { + rotate(__first, __middle, __last); + advance(__first, distance(__middle, __last)); + return __first; + } + } -template -_ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last, - const _Tp& __val, _Distance*) -{ - _Distance __len = 0; - distance(__first, __last, __len); - _Distance __half; - _ForwardIter __middle; - - while (__len > 0) { - __half = __len >> 1; - __middle = __first; - advance(__middle, __half); - if (*__middle < __val) { - __first = __middle; - ++__first; - __len = __len - __half - 1; - } - else - __len = __half; - } - return __first; -} - -template -inline _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last, - const _Tp& __val) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_SameTypeConcept<_Tp, - typename iterator_traits<_ForwardIter>::value_type>); - __glibcpp_function_requires(_LessThanComparableConcept<_Tp>); - - return __lower_bound(__first, __last, __val, - __distance_type(__first)); -} - -template -_ForwardIter __lower_bound(_ForwardIter __first, _ForwardIter __last, - const _Tp& __val, _Compare __comp, _Distance*) -{ - _Distance __len = 0; - distance(__first, __last, __len); - _Distance __half; - _ForwardIter __middle; - - while (__len > 0) { - __half = __len >> 1; - __middle = __first; - advance(__middle, __half); - if (__comp(*__middle, __val)) { - __first = __middle; - ++__first; - __len = __len - __half - 1; - } - else - __len = __half; - } - return __first; -} - -template -inline _ForwardIter lower_bound(_ForwardIter __first, _ForwardIter __last, - const _Tp& __val, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_SameTypeConcept<_Tp, - typename iterator_traits<_ForwardIter>::value_type>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>); - - return __lower_bound(__first, __last, __val, __comp, - __distance_type(__first)); -} - -template -_ForwardIter __upper_bound(_ForwardIter __first, _ForwardIter __last, - const _Tp& __val, _Distance*) -{ - _Distance __len = 0; - distance(__first, __last, __len); - _Distance __half; - _ForwardIter __middle; - - while (__len > 0) { - __half = __len >> 1; - __middle = __first; - advance(__middle, __half); - if (__val < *__middle) - __len = __half; - else { - __first = __middle; - ++__first; - __len = __len - __half - 1; - } - } - return __first; -} - -template -inline _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last, - const _Tp& __val) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_SameTypeConcept<_Tp, - typename iterator_traits<_ForwardIter>::value_type>); - __glibcpp_function_requires(_LessThanComparableConcept<_Tp>); - - return __upper_bound(__first, __last, __val, - __distance_type(__first)); -} - -template -_ForwardIter __upper_bound(_ForwardIter __first, _ForwardIter __last, - const _Tp& __val, _Compare __comp, _Distance*) -{ - _Distance __len = 0; - distance(__first, __last, __len); - _Distance __half; - _ForwardIter __middle; - - while (__len > 0) { - __half = __len >> 1; - __middle = __first; - advance(__middle, __half); - if (__comp(__val, *__middle)) - __len = __half; - else { - __first = __middle; - ++__first; - __len = __len - __half - 1; - } - } - return __first; -} - -template -inline _ForwardIter upper_bound(_ForwardIter __first, _ForwardIter __last, - const _Tp& __val, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_SameTypeConcept<_Tp, - typename iterator_traits<_ForwardIter>::value_type>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>); - - return __upper_bound(__first, __last, __val, __comp, - __distance_type(__first)); -} - -template -pair<_ForwardIter, _ForwardIter> -__equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, - _Distance*) -{ - _Distance __len = 0; - distance(__first, __last, __len); - _Distance __half; - _ForwardIter __middle, __left, __right; - - while (__len > 0) { - __half = __len >> 1; - __middle = __first; - advance(__middle, __half); - if (*__middle < __val) { - __first = __middle; - ++__first; - __len = __len - __half - 1; - } - else if (__val < *__middle) - __len = __half; - else { - __left = lower_bound(__first, __middle, __val); - advance(__first, __len); - __right = upper_bound(++__middle, __first, __val); - return pair<_ForwardIter, _ForwardIter>(__left, __right); - } - } - return pair<_ForwardIter, _ForwardIter>(__first, __first); -} - -template -inline pair<_ForwardIter, _ForwardIter> -equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_SameTypeConcept<_Tp, - typename iterator_traits<_ForwardIter>::value_type>); - __glibcpp_function_requires(_LessThanComparableConcept<_Tp>); - - return __equal_range(__first, __last, __val, - __distance_type(__first)); -} - -template -pair<_ForwardIter, _ForwardIter> -__equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, - _Compare __comp, _Distance*) -{ - _Distance __len = 0; - distance(__first, __last, __len); - _Distance __half; - _ForwardIter __middle, __left, __right; - - while (__len > 0) { - __half = __len >> 1; - __middle = __first; - advance(__middle, __half); - if (__comp(*__middle, __val)) { - __first = __middle; - ++__first; - __len = __len - __half - 1; - } - else if (__comp(__val, *__middle)) - __len = __half; - else { - __left = lower_bound(__first, __middle, __val, __comp); - advance(__first, __len); - __right = upper_bound(++__middle, __first, __val, __comp); - return pair<_ForwardIter, _ForwardIter>(__left, __right); - } - } - return pair<_ForwardIter, _ForwardIter>(__first, __first); -} - -template -inline pair<_ForwardIter, _ForwardIter> -equal_range(_ForwardIter __first, _ForwardIter __last, const _Tp& __val, - _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_SameTypeConcept<_Tp, - typename iterator_traits<_ForwardIter>::value_type>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>); - - return __equal_range(__first, __last, __val, __comp, - __distance_type(__first)); -} - -template -bool binary_search(_ForwardIter __first, _ForwardIter __last, - const _Tp& __val) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_SameTypeConcept<_Tp, - typename iterator_traits<_ForwardIter>::value_type>); - __glibcpp_function_requires(_LessThanComparableConcept<_Tp>); - - _ForwardIter __i = lower_bound(__first, __last, __val); - return __i != __last && !(__val < *__i); -} - -template -bool binary_search(_ForwardIter __first, _ForwardIter __last, - const _Tp& __val, - _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_SameTypeConcept<_Tp, - typename iterator_traits<_ForwardIter>::value_type>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _Tp>); - - _ForwardIter __i = lower_bound(__first, __last, __val, __comp); - return __i != __last && !__comp(__val, *__i); -} - -// merge, with and without an explicitly supplied comparison function. - -template -_OutputIter merge(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2, - _OutputIter __result) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter1>::value_type>); - __glibcpp_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIter1>::value_type>); - - while (__first1 != __last1 && __first2 != __last2) { - if (*__first2 < *__first1) { - *__result = *__first2; - ++__first2; - } - else { - *__result = *__first1; - ++__first1; - } - ++__result; - } - return copy(__first2, __last2, copy(__first1, __last1, __result)); -} - -template -_OutputIter merge(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2, - _OutputIter __result, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter1>::value_type>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - - while (__first1 != __last1 && __first2 != __last2) { - if (__comp(*__first2, *__first1)) { - *__result = *__first2; - ++__first2; - } - else { - *__result = *__first1; - ++__first1; - } - ++__result; - } - return copy(__first2, __last2, copy(__first1, __last1, __result)); -} - -// inplace_merge and its auxiliary functions. - -template -void __merge_without_buffer(_BidirectionalIter __first, - _BidirectionalIter __middle, - _BidirectionalIter __last, - _Distance __len1, _Distance __len2) -{ - if (__len1 == 0 || __len2 == 0) - return; - if (__len1 + __len2 == 2) { - if (*__middle < *__first) - iter_swap(__first, __middle); - return; - } - _BidirectionalIter __first_cut = __first; - _BidirectionalIter __second_cut = __middle; - _Distance __len11 = 0; - _Distance __len22 = 0; - if (__len1 > __len2) { - __len11 = __len1 / 2; - advance(__first_cut, __len11); - __second_cut = lower_bound(__middle, __last, *__first_cut); - distance(__middle, __second_cut, __len22); - } - else { - __len22 = __len2 / 2; - advance(__second_cut, __len22); - __first_cut = upper_bound(__first, __middle, *__second_cut); - distance(__first, __first_cut, __len11); - } - _BidirectionalIter __new_middle - = rotate(__first_cut, __middle, __second_cut); - __merge_without_buffer(__first, __first_cut, __new_middle, - __len11, __len22); - __merge_without_buffer(__new_middle, __second_cut, __last, __len1 - __len11, - __len2 - __len22); -} - -template -void __merge_without_buffer(_BidirectionalIter __first, - _BidirectionalIter __middle, - _BidirectionalIter __last, - _Distance __len1, _Distance __len2, - _Compare __comp) -{ - if (__len1 == 0 || __len2 == 0) - return; - if (__len1 + __len2 == 2) { - if (__comp(*__middle, *__first)) - iter_swap(__first, __middle); - return; - } - _BidirectionalIter __first_cut = __first; - _BidirectionalIter __second_cut = __middle; - _Distance __len11 = 0; - _Distance __len22 = 0; - if (__len1 > __len2) { - __len11 = __len1 / 2; - advance(__first_cut, __len11); - __second_cut = lower_bound(__middle, __last, *__first_cut, __comp); - distance(__middle, __second_cut, __len22); - } - else { - __len22 = __len2 / 2; - advance(__second_cut, __len22); - __first_cut = upper_bound(__first, __middle, *__second_cut, __comp); - distance(__first, __first_cut, __len11); - } - _BidirectionalIter __new_middle - = rotate(__first_cut, __middle, __second_cut); - __merge_without_buffer(__first, __first_cut, __new_middle, __len11, __len22, - __comp); - __merge_without_buffer(__new_middle, __second_cut, __last, __len1 - __len11, - __len2 - __len22, __comp); -} - -template -_BidirectionalIter1 __rotate_adaptive(_BidirectionalIter1 __first, - _BidirectionalIter1 __middle, - _BidirectionalIter1 __last, - _Distance __len1, _Distance __len2, - _BidirectionalIter2 __buffer, - _Distance __buffer_size) -{ - _BidirectionalIter2 __buffer_end; - if (__len1 > __len2 && __len2 <= __buffer_size) { - __buffer_end = copy(__middle, __last, __buffer); - copy_backward(__first, __middle, __last); - return copy(__buffer, __buffer_end, __first); - } - else if (__len1 <= __buffer_size) { - __buffer_end = copy(__first, __middle, __buffer); - copy(__middle, __last, __first); - return copy_backward(__buffer, __buffer_end, __last); - } - else - return rotate(__first, __middle, __last); -} - -template -_BidirectionalIter3 __merge_backward(_BidirectionalIter1 __first1, - _BidirectionalIter1 __last1, - _BidirectionalIter2 __first2, - _BidirectionalIter2 __last2, - _BidirectionalIter3 __result) -{ - if (__first1 == __last1) - return copy_backward(__first2, __last2, __result); - if (__first2 == __last2) - return copy_backward(__first1, __last1, __result); - --__last1; - --__last2; - while (true) { - if (*__last2 < *__last1) { - *--__result = *__last1; + template + _BidirectionalIter3 + __merge_backward(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, + _BidirectionalIter2 __first2, _BidirectionalIter2 __last2, + _BidirectionalIter3 __result) + { if (__first1 == __last1) - return copy_backward(__first2, ++__last2, __result); - --__last1; - } - else { - *--__result = *__last2; + return copy_backward(__first2, __last2, __result); if (__first2 == __last2) - return copy_backward(__first1, ++__last1, __result); + return copy_backward(__first1, __last1, __result); + --__last1; --__last2; + while (true) { + if (*__last2 < *__last1) { + *--__result = *__last1; + if (__first1 == __last1) + return copy_backward(__first2, ++__last2, __result); + --__last1; + } + else { + *--__result = *__last2; + if (__first2 == __last2) + return copy_backward(__first1, ++__last1, __result); + --__last2; + } + } } - } -} - -template -_BidirectionalIter3 __merge_backward(_BidirectionalIter1 __first1, - _BidirectionalIter1 __last1, - _BidirectionalIter2 __first2, - _BidirectionalIter2 __last2, - _BidirectionalIter3 __result, - _Compare __comp) -{ - if (__first1 == __last1) - return copy_backward(__first2, __last2, __result); - if (__first2 == __last2) - return copy_backward(__first1, __last1, __result); - --__last1; - --__last2; - while (true) { - if (__comp(*__last2, *__last1)) { - *--__result = *__last1; + + template + _BidirectionalIter3 + __merge_backward(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, + _BidirectionalIter2 __first2, _BidirectionalIter2 __last2, + _BidirectionalIter3 __result, + _Compare __comp) + { if (__first1 == __last1) - return copy_backward(__first2, ++__last2, __result); - --__last1; - } - else { - *--__result = *__last2; + return copy_backward(__first2, __last2, __result); if (__first2 == __last2) - return copy_backward(__first1, ++__last1, __result); + return copy_backward(__first1, __last1, __result); + --__last1; --__last2; + while (true) { + if (__comp(*__last2, *__last1)) { + *--__result = *__last1; + if (__first1 == __last1) + return copy_backward(__first2, ++__last2, __result); + --__last1; + } + else { + *--__result = *__last2; + if (__first2 == __last2) + return copy_backward(__first1, ++__last1, __result); + --__last2; + } + } } - } -} -template -void __merge_adaptive(_BidirectionalIter __first, - _BidirectionalIter __middle, - _BidirectionalIter __last, - _Distance __len1, _Distance __len2, - _Pointer __buffer, _Distance __buffer_size) -{ - if (__len1 <= __len2 && __len1 <= __buffer_size) { - _Pointer __buffer_end = copy(__first, __middle, __buffer); - merge(__buffer, __buffer_end, __middle, __last, __first); - } - else if (__len2 <= __buffer_size) { - _Pointer __buffer_end = copy(__middle, __last, __buffer); - __merge_backward(__first, __middle, __buffer, __buffer_end, __last); - } - else { - _BidirectionalIter __first_cut = __first; - _BidirectionalIter __second_cut = __middle; - _Distance __len11 = 0; - _Distance __len22 = 0; - if (__len1 > __len2) { - __len11 = __len1 / 2; - advance(__first_cut, __len11); - __second_cut = lower_bound(__middle, __last, *__first_cut); - distance(__middle, __second_cut, __len22); - } - else { - __len22 = __len2 / 2; - advance(__second_cut, __len22); - __first_cut = upper_bound(__first, __middle, *__second_cut); - distance(__first, __first_cut, __len11); - } - _BidirectionalIter __new_middle = - __rotate_adaptive(__first_cut, __middle, __second_cut, __len1 - __len11, - __len22, __buffer, __buffer_size); - __merge_adaptive(__first, __first_cut, __new_middle, __len11, - __len22, __buffer, __buffer_size); - __merge_adaptive(__new_middle, __second_cut, __last, __len1 - __len11, - __len2 - __len22, __buffer, __buffer_size); - } -} - -template -void __merge_adaptive(_BidirectionalIter __first, - _BidirectionalIter __middle, - _BidirectionalIter __last, - _Distance __len1, _Distance __len2, - _Pointer __buffer, _Distance __buffer_size, - _Compare __comp) -{ - if (__len1 <= __len2 && __len1 <= __buffer_size) { - _Pointer __buffer_end = copy(__first, __middle, __buffer); - merge(__buffer, __buffer_end, __middle, __last, __first, __comp); - } - else if (__len2 <= __buffer_size) { - _Pointer __buffer_end = copy(__middle, __last, __buffer); - __merge_backward(__first, __middle, __buffer, __buffer_end, __last, - __comp); - } - else { - _BidirectionalIter __first_cut = __first; - _BidirectionalIter __second_cut = __middle; - _Distance __len11 = 0; - _Distance __len22 = 0; - if (__len1 > __len2) { - __len11 = __len1 / 2; - advance(__first_cut, __len11); - __second_cut = lower_bound(__middle, __last, *__first_cut, __comp); - distance(__middle, __second_cut, __len22); - } - else { - __len22 = __len2 / 2; - advance(__second_cut, __len22); - __first_cut = upper_bound(__first, __middle, *__second_cut, __comp); - distance(__first, __first_cut, __len11); - } - _BidirectionalIter __new_middle = - __rotate_adaptive(__first_cut, __middle, __second_cut, __len1 - __len11, - __len22, __buffer, __buffer_size); - __merge_adaptive(__first, __first_cut, __new_middle, __len11, - __len22, __buffer, __buffer_size, __comp); - __merge_adaptive(__new_middle, __second_cut, __last, __len1 - __len11, - __len2 - __len22, __buffer, __buffer_size, __comp); - } -} - -template -inline void __inplace_merge_aux(_BidirectionalIter __first, - _BidirectionalIter __middle, - _BidirectionalIter __last, _Tp*, _Distance*) -{ - _Distance __len1 = 0; - distance(__first, __middle, __len1); - _Distance __len2 = 0; - distance(__middle, __last, __len2); - - _Temporary_buffer<_BidirectionalIter, _Tp> __buf(__first, __last); - if (__buf.begin() == 0) - __merge_without_buffer(__first, __middle, __last, __len1, __len2); - else - __merge_adaptive(__first, __middle, __last, __len1, __len2, - __buf.begin(), _Distance(__buf.size())); -} - -template -inline void __inplace_merge_aux(_BidirectionalIter __first, - _BidirectionalIter __middle, - _BidirectionalIter __last, _Tp*, _Distance*, - _Compare __comp) -{ - _Distance __len1 = 0; - distance(__first, __middle, __len1); - _Distance __len2 = 0; - distance(__middle, __last, __len2); - - _Temporary_buffer<_BidirectionalIter, _Tp> __buf(__first, __last); - if (__buf.begin() == 0) - __merge_without_buffer(__first, __middle, __last, __len1, __len2, __comp); - else - __merge_adaptive(__first, __middle, __last, __len1, __len2, - __buf.begin(), _Distance(__buf.size()), - __comp); -} - -template -inline void inplace_merge(_BidirectionalIter __first, - _BidirectionalIter __middle, - _BidirectionalIter __last) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept< - _BidirectionalIter>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_BidirectionalIter>::value_type>); - - if (__first == __middle || __middle == __last) - return; - __inplace_merge_aux(__first, __middle, __last, - __value_type(__first), __distance_type(__first)); -} - -template -inline void inplace_merge(_BidirectionalIter __first, - _BidirectionalIter __middle, - _BidirectionalIter __last, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept< - _BidirectionalIter>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_BidirectionalIter>::value_type, - typename iterator_traits<_BidirectionalIter>::value_type>); - - if (__first == __middle || __middle == __last) - return; - __inplace_merge_aux(__first, __middle, __last, - __value_type(__first), __distance_type(__first), - __comp); -} - -// Set algorithms: includes, set_union, set_intersection, set_difference, -// set_symmetric_difference. All of these algorithms have the precondition -// that their input ranges are sorted and the postcondition that their output -// ranges are sorted. - -template -bool includes(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIter1>::value_type>); - - while (__first1 != __last1 && __first2 != __last2) - if (*__first2 < *__first1) - return false; - else if(*__first1 < *__first2) - ++__first1; - else - ++__first1, ++__first2; - - return __first2 == __last2; -} - -template -bool includes(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - - while (__first1 != __last1 && __first2 != __last2) - if (__comp(*__first2, *__first1)) - return false; - else if(__comp(*__first1, *__first2)) - ++__first1; - else - ++__first1, ++__first2; - - return __first2 == __last2; -} - -template -_OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2, - _OutputIter __result) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter1>::value_type>); - __glibcpp_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIter1>::value_type>); - - while (__first1 != __last1 && __first2 != __last2) { - if (*__first1 < *__first2) { - *__result = *__first1; - ++__first1; - } - else if (*__first2 < *__first1) { - *__result = *__first2; - ++__first2; - } - else { - *__result = *__first1; - ++__first1; - ++__first2; - } - ++__result; - } - return copy(__first2, __last2, copy(__first1, __last1, __result)); -} - -template -_OutputIter set_union(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2, - _OutputIter __result, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter1>::value_type>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - - while (__first1 != __last1 && __first2 != __last2) { - if (__comp(*__first1, *__first2)) { - *__result = *__first1; - ++__first1; - } - else if (__comp(*__first2, *__first1)) { - *__result = *__first2; - ++__first2; - } - else { - *__result = *__first1; - ++__first1; - ++__first2; - } - ++__result; - } - return copy(__first2, __last2, copy(__first1, __last1, __result)); -} - -template -_OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2, - _OutputIter __result) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter1>::value_type>); - __glibcpp_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIter1>::value_type>); - - while (__first1 != __last1 && __first2 != __last2) - if (*__first1 < *__first2) - ++__first1; - else if (*__first2 < *__first1) - ++__first2; - else { - *__result = *__first1; - ++__first1; - ++__first2; - ++__result; - } - return __result; -} - -template -_OutputIter set_intersection(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2, - _OutputIter __result, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter1>::value_type>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - - while (__first1 != __last1 && __first2 != __last2) - if (__comp(*__first1, *__first2)) - ++__first1; - else if (__comp(*__first2, *__first1)) - ++__first2; - else { - *__result = *__first1; - ++__first1; - ++__first2; - ++__result; - } - return __result; -} - -template -_OutputIter set_difference(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2, - _OutputIter __result) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter1>::value_type>); - __glibcpp_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIter1>::value_type>); - - while (__first1 != __last1 && __first2 != __last2) - if (*__first1 < *__first2) { - *__result = *__first1; - ++__first1; - ++__result; - } - else if (*__first2 < *__first1) - ++__first2; - else { - ++__first1; - ++__first2; - } - return copy(__first1, __last1, __result); -} - -template -_OutputIter set_difference(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2, - _OutputIter __result, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter1>::value_type>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - - while (__first1 != __last1 && __first2 != __last2) - if (__comp(*__first1, *__first2)) { - *__result = *__first1; - ++__first1; - ++__result; - } - else if (__comp(*__first2, *__first1)) - ++__first2; - else { - ++__first1; - ++__first2; - } - return copy(__first1, __last1, __result); -} - -template -_OutputIter -set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2, - _OutputIter __result) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter1>::value_type>); - __glibcpp_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIter1>::value_type>); - - while (__first1 != __last1 && __first2 != __last2) - if (*__first1 < *__first2) { - *__result = *__first1; - ++__first1; - ++__result; - } - else if (*__first2 < *__first1) { - *__result = *__first2; - ++__first2; - ++__result; - } - else { - ++__first1; - ++__first2; - } - return copy(__first2, __last2, copy(__first1, __last1, __result)); -} - -template -_OutputIter -set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2, - _OutputIter __result, - _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_SameTypeConcept< - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter1>::value_type>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - - while (__first1 != __last1 && __first2 != __last2) - if (__comp(*__first1, *__first2)) { - *__result = *__first1; - ++__first1; - ++__result; - } - else if (__comp(*__first2, *__first1)) { - *__result = *__first2; - ++__first2; - ++__result; - } - else { - ++__first1; - ++__first2; - } - return copy(__first2, __last2, copy(__first1, __last1, __result)); -} - -// min_element and max_element, with and without an explicitly supplied -// comparison function. - -template -_ForwardIter max_element(_ForwardIter __first, _ForwardIter __last) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_ForwardIter>::value_type>); - - if (__first == __last) return __first; - _ForwardIter __result = __first; - while (++__first != __last) - if (*__result < *__first) - __result = __first; - return __result; -} - -template -_ForwardIter max_element(_ForwardIter __first, _ForwardIter __last, - _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_ForwardIter>::value_type, - typename iterator_traits<_ForwardIter>::value_type>); - - if (__first == __last) return __first; - _ForwardIter __result = __first; - while (++__first != __last) - if (__comp(*__result, *__first)) __result = __first; - return __result; -} - -template -_ForwardIter min_element(_ForwardIter __first, _ForwardIter __last) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_ForwardIter>::value_type>); - - if (__first == __last) return __first; - _ForwardIter __result = __first; - while (++__first != __last) - if (*__first < *__result) - __result = __first; - return __result; -} - -template -_ForwardIter min_element(_ForwardIter __first, _ForwardIter __last, - _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_ForwardIter>::value_type, - typename iterator_traits<_ForwardIter>::value_type>); - - if (__first == __last) return __first; - _ForwardIter __result = __first; - while (++__first != __last) - if (__comp(*__first, *__result)) - __result = __first; - return __result; -} - -// next_permutation and prev_permutation, with and without an explicitly -// supplied comparison function. - -template -bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last) -{ - // concept requirements - __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_BidirectionalIter>::value_type>); - - if (__first == __last) - return false; - _BidirectionalIter __i = __first; - ++__i; - if (__i == __last) - return false; - __i = __last; - --__i; - - for(;;) { - _BidirectionalIter __ii = __i; - --__i; - if (*__i < *__ii) { - _BidirectionalIter __j = __last; - while (!(*__i < *--__j)) - {} - iter_swap(__i, __j); - reverse(__ii, __last); - return true; + template + void + __merge_adaptive(_BidirectionalIter __first, + _BidirectionalIter __middle, + _BidirectionalIter __last, + _Distance __len1, _Distance __len2, + _Pointer __buffer, _Distance __buffer_size) + { + if (__len1 <= __len2 && __len1 <= __buffer_size) { + _Pointer __buffer_end = copy(__first, __middle, __buffer); + merge(__buffer, __buffer_end, __middle, __last, __first); + } + else if (__len2 <= __buffer_size) { + _Pointer __buffer_end = copy(__middle, __last, __buffer); + __merge_backward(__first, __middle, __buffer, __buffer_end, __last); + } + else { + _BidirectionalIter __first_cut = __first; + _BidirectionalIter __second_cut = __middle; + _Distance __len11 = 0; + _Distance __len22 = 0; + if (__len1 > __len2) { + __len11 = __len1 / 2; + advance(__first_cut, __len11); + __second_cut = lower_bound(__middle, __last, *__first_cut); + __len22 = distance(__middle, __second_cut); + } + else { + __len22 = __len2 / 2; + advance(__second_cut, __len22); + __first_cut = upper_bound(__first, __middle, *__second_cut); + __len11 = distance(__first, __first_cut); + } + _BidirectionalIter __new_middle = + __rotate_adaptive(__first_cut, __middle, __second_cut, + __len1 - __len11, __len22, __buffer, + __buffer_size); + __merge_adaptive(__first, __first_cut, __new_middle, __len11, + __len22, __buffer, __buffer_size); + __merge_adaptive(__new_middle, __second_cut, __last, __len1 - __len11, + __len2 - __len22, __buffer, __buffer_size); + } + } + + template + void + __merge_adaptive(_BidirectionalIter __first, + _BidirectionalIter __middle, + _BidirectionalIter __last, + _Distance __len1, _Distance __len2, + _Pointer __buffer, _Distance __buffer_size, + _Compare __comp) + { + if (__len1 <= __len2 && __len1 <= __buffer_size) { + _Pointer __buffer_end = copy(__first, __middle, __buffer); + merge(__buffer, __buffer_end, __middle, __last, __first, __comp); + } + else if (__len2 <= __buffer_size) { + _Pointer __buffer_end = copy(__middle, __last, __buffer); + __merge_backward(__first, __middle, __buffer, __buffer_end, __last, + __comp); + } + else { + _BidirectionalIter __first_cut = __first; + _BidirectionalIter __second_cut = __middle; + _Distance __len11 = 0; + _Distance __len22 = 0; + if (__len1 > __len2) { + __len11 = __len1 / 2; + advance(__first_cut, __len11); + __second_cut = lower_bound(__middle, __last, *__first_cut, __comp); + __len22 = distance(__middle, __second_cut); + } + else { + __len22 = __len2 / 2; + advance(__second_cut, __len22); + __first_cut = upper_bound(__first, __middle, *__second_cut, __comp); + __len11 = distance(__first, __first_cut); + } + _BidirectionalIter __new_middle = + __rotate_adaptive(__first_cut, __middle, __second_cut, + __len1 - __len11, __len22, __buffer, + __buffer_size); + __merge_adaptive(__first, __first_cut, __new_middle, __len11, + __len22, __buffer, __buffer_size, __comp); + __merge_adaptive(__new_middle, __second_cut, __last, __len1 - __len11, + __len2 - __len22, __buffer, __buffer_size, __comp); + } + } + + template + void + inplace_merge(_BidirectionalIter __first, + _BidirectionalIter __middle, + _BidirectionalIter __last) + { + typedef typename iterator_traits<_BidirectionalIter>::value_type + _ValueType; + typedef typename iterator_traits<_BidirectionalIter>::difference_type + _DistanceType; + + // concept requirements + __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept< + _BidirectionalIter>); + __glibcpp_function_requires(_LessThanComparableConcept<_ValueType>); + + if (__first == __middle || __middle == __last) + return; + + _DistanceType __len1 = distance(__first, __middle); + _DistanceType __len2 = distance(__middle, __last); + + _Temporary_buffer<_BidirectionalIter, _ValueType> __buf(__first, __last); + if (__buf.begin() == 0) + __merge_without_buffer(__first, __middle, __last, __len1, __len2); + else + __merge_adaptive(__first, __middle, __last, __len1, __len2, + __buf.begin(), _DistanceType(__buf.size())); + } + + template + void + inplace_merge(_BidirectionalIter __first, + _BidirectionalIter __middle, + _BidirectionalIter __last, + _Compare __comp) + { + typedef typename iterator_traits<_BidirectionalIter>::value_type + _ValueType; + typedef typename iterator_traits<_BidirectionalIter>::difference_type + _DistanceType; + + // concept requirements + __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept< + _BidirectionalIter>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, + _ValueType, _ValueType>); + + if (__first == __middle || __middle == __last) + return; + + _DistanceType __len1 = distance(__first, __middle); + _DistanceType __len2 = distance(__middle, __last); + + _Temporary_buffer<_BidirectionalIter, _ValueType> __buf(__first, __last); + if (__buf.begin() == 0) + __merge_without_buffer(__first, __middle, __last, __len1, __len2, __comp); + else + __merge_adaptive(__first, __middle, __last, __len1, __len2, + __buf.begin(), _DistanceType(__buf.size()), + __comp); + } + + // Set algorithms: includes, set_union, set_intersection, set_difference, + // set_symmetric_difference. All of these algorithms have the precondition + // that their input ranges are sorted and the postcondition that their output + // ranges are sorted. + + template + bool + includes(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_SameTypeConcept< + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_InputIter1>::value_type>); + + while (__first1 != __last1 && __first2 != __last2) + if (*__first2 < *__first1) + return false; + else if(*__first1 < *__first2) + ++__first1; + else + ++__first1, ++__first2; + + return __first2 == __last2; + } + + template + bool + includes(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2, _Compare __comp) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_SameTypeConcept< + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + + while (__first1 != __last1 && __first2 != __last2) + if (__comp(*__first2, *__first1)) + return false; + else if(__comp(*__first1, *__first2)) + ++__first1; + else + ++__first1, ++__first2; + + return __first2 == __last2; + } + + template + _OutputIter + set_union(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2, + _OutputIter __result) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter1>::value_type>); + __glibcpp_function_requires(_SameTypeConcept< + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_InputIter1>::value_type>); + + while (__first1 != __last1 && __first2 != __last2) { + if (*__first1 < *__first2) { + *__result = *__first1; + ++__first1; + } + else if (*__first2 < *__first1) { + *__result = *__first2; + ++__first2; + } + else { + *__result = *__first1; + ++__first1; + ++__first2; + } + ++__result; + } + return copy(__first2, __last2, copy(__first1, __last1, __result)); + } + + template + _OutputIter + set_union(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2, + _OutputIter __result, _Compare __comp) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_SameTypeConcept< + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter1>::value_type>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + + while (__first1 != __last1 && __first2 != __last2) { + if (__comp(*__first1, *__first2)) { + *__result = *__first1; + ++__first1; + } + else if (__comp(*__first2, *__first1)) { + *__result = *__first2; + ++__first2; + } + else { + *__result = *__first1; + ++__first1; + ++__first2; + } + ++__result; + } + return copy(__first2, __last2, copy(__first1, __last1, __result)); + } + + template + _OutputIter + set_intersection(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2, + _OutputIter __result) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter1>::value_type>); + __glibcpp_function_requires(_SameTypeConcept< + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_InputIter1>::value_type>); + + while (__first1 != __last1 && __first2 != __last2) + if (*__first1 < *__first2) + ++__first1; + else if (*__first2 < *__first1) + ++__first2; + else { + *__result = *__first1; + ++__first1; + ++__first2; + ++__result; + } + return __result; + } + + template + _OutputIter + set_intersection(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2, + _OutputIter __result, _Compare __comp) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_SameTypeConcept< + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter1>::value_type>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + + while (__first1 != __last1 && __first2 != __last2) + if (__comp(*__first1, *__first2)) + ++__first1; + else if (__comp(*__first2, *__first1)) + ++__first2; + else { + *__result = *__first1; + ++__first1; + ++__first2; + ++__result; + } + return __result; + } + + template + _OutputIter + set_difference(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2, + _OutputIter __result) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter1>::value_type>); + __glibcpp_function_requires(_SameTypeConcept< + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_InputIter1>::value_type>); + + while (__first1 != __last1 && __first2 != __last2) + if (*__first1 < *__first2) { + *__result = *__first1; + ++__first1; + ++__result; + } + else if (*__first2 < *__first1) + ++__first2; + else { + ++__first1; + ++__first2; + } + return copy(__first1, __last1, __result); + } + + template + _OutputIter + set_difference(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2, + _OutputIter __result, _Compare __comp) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_SameTypeConcept< + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter1>::value_type>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + + while (__first1 != __last1 && __first2 != __last2) + if (__comp(*__first1, *__first2)) { + *__result = *__first1; + ++__first1; + ++__result; + } + else if (__comp(*__first2, *__first1)) + ++__first2; + else { + ++__first1; + ++__first2; + } + return copy(__first1, __last1, __result); + } + + template + _OutputIter + set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2, + _OutputIter __result) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter1>::value_type>); + __glibcpp_function_requires(_SameTypeConcept< + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_InputIter1>::value_type>); + + while (__first1 != __last1 && __first2 != __last2) + if (*__first1 < *__first2) { + *__result = *__first1; + ++__first1; + ++__result; + } + else if (*__first2 < *__first1) { + *__result = *__first2; + ++__first2; + ++__result; + } + else { + ++__first1; + ++__first2; + } + return copy(__first2, __last2, copy(__first1, __last1, __result)); + } + + template + _OutputIter + set_symmetric_difference(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2, + _OutputIter __result, + _Compare __comp) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_SameTypeConcept< + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter1>::value_type>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + + while (__first1 != __last1 && __first2 != __last2) + if (__comp(*__first1, *__first2)) { + *__result = *__first1; + ++__first1; + ++__result; + } + else if (__comp(*__first2, *__first1)) { + *__result = *__first2; + ++__first2; + ++__result; + } + else { + ++__first1; + ++__first2; + } + return copy(__first2, __last2, copy(__first1, __last1, __result)); + } + + // min_element and max_element, with and without an explicitly supplied + // comparison function. + + template + _ForwardIter + max_element(_ForwardIter __first, _ForwardIter __last) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_ForwardIter>::value_type>); + + if (__first == __last) return __first; + _ForwardIter __result = __first; + while (++__first != __last) + if (*__result < *__first) + __result = __first; + return __result; + } + + template + _ForwardIter + max_element(_ForwardIter __first, _ForwardIter __last, + _Compare __comp) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, + typename iterator_traits<_ForwardIter>::value_type, + typename iterator_traits<_ForwardIter>::value_type>); + + if (__first == __last) return __first; + _ForwardIter __result = __first; + while (++__first != __last) + if (__comp(*__result, *__first)) __result = __first; + return __result; + } + + template + _ForwardIter + min_element(_ForwardIter __first, _ForwardIter __last) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_ForwardIter>::value_type>); + + if (__first == __last) return __first; + _ForwardIter __result = __first; + while (++__first != __last) + if (*__first < *__result) + __result = __first; + return __result; + } + + template + _ForwardIter + min_element(_ForwardIter __first, _ForwardIter __last, + _Compare __comp) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, + typename iterator_traits<_ForwardIter>::value_type, + typename iterator_traits<_ForwardIter>::value_type>); + + if (__first == __last) return __first; + _ForwardIter __result = __first; + while (++__first != __last) + if (__comp(*__first, *__result)) + __result = __first; + return __result; + } + + // next_permutation and prev_permutation, with and without an explicitly + // supplied comparison function. + + template + bool + next_permutation(_BidirectionalIter __first, _BidirectionalIter __last) + { + // concept requirements + __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_BidirectionalIter>::value_type>); + + if (__first == __last) + return false; + _BidirectionalIter __i = __first; + ++__i; + if (__i == __last) + return false; + __i = __last; + --__i; + + for(;;) { + _BidirectionalIter __ii = __i; + --__i; + if (*__i < *__ii) { + _BidirectionalIter __j = __last; + while (!(*__i < *--__j)) + {} + iter_swap(__i, __j); + reverse(__ii, __last); + return true; + } + if (__i == __first) { + reverse(__first, __last); + return false; + } + } } - if (__i == __first) { - reverse(__first, __last); - return false; + + template + bool + next_permutation(_BidirectionalIter __first, _BidirectionalIter __last, + _Compare __comp) + { + // concept requirements + __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, + typename iterator_traits<_BidirectionalIter>::value_type, + typename iterator_traits<_BidirectionalIter>::value_type>); + + if (__first == __last) + return false; + _BidirectionalIter __i = __first; + ++__i; + if (__i == __last) + return false; + __i = __last; + --__i; + + for(;;) { + _BidirectionalIter __ii = __i; + --__i; + if (__comp(*__i, *__ii)) { + _BidirectionalIter __j = __last; + while (!__comp(*__i, *--__j)) + {} + iter_swap(__i, __j); + reverse(__ii, __last); + return true; + } + if (__i == __first) { + reverse(__first, __last); + return false; + } + } } - } -} -template -bool next_permutation(_BidirectionalIter __first, _BidirectionalIter __last, - _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_BidirectionalIter>::value_type, - typename iterator_traits<_BidirectionalIter>::value_type>); - - if (__first == __last) - return false; - _BidirectionalIter __i = __first; - ++__i; - if (__i == __last) - return false; - __i = __last; - --__i; - - for(;;) { - _BidirectionalIter __ii = __i; - --__i; - if (__comp(*__i, *__ii)) { - _BidirectionalIter __j = __last; - while (!__comp(*__i, *--__j)) - {} - iter_swap(__i, __j); - reverse(__ii, __last); - return true; + template + bool + prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last) + { + // concept requirements + __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_BidirectionalIter>::value_type>); + + if (__first == __last) + return false; + _BidirectionalIter __i = __first; + ++__i; + if (__i == __last) + return false; + __i = __last; + --__i; + + for(;;) { + _BidirectionalIter __ii = __i; + --__i; + if (*__ii < *__i) { + _BidirectionalIter __j = __last; + while (!(*--__j < *__i)) + {} + iter_swap(__i, __j); + reverse(__ii, __last); + return true; + } + if (__i == __first) { + reverse(__first, __last); + return false; + } + } } - if (__i == __first) { - reverse(__first, __last); - return false; + + template + bool + prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last, + _Compare __comp) + { + // concept requirements + __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>); + __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, + typename iterator_traits<_BidirectionalIter>::value_type, + typename iterator_traits<_BidirectionalIter>::value_type>); + + if (__first == __last) + return false; + _BidirectionalIter __i = __first; + ++__i; + if (__i == __last) + return false; + __i = __last; + --__i; + + for(;;) { + _BidirectionalIter __ii = __i; + --__i; + if (__comp(*__ii, *__i)) { + _BidirectionalIter __j = __last; + while (!__comp(*--__j, *__i)) + {} + iter_swap(__i, __j); + reverse(__ii, __last); + return true; + } + if (__i == __first) { + reverse(__first, __last); + return false; + } + } } - } -} -template -bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last) -{ - // concept requirements - __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_BidirectionalIter>::value_type>); - - if (__first == __last) - return false; - _BidirectionalIter __i = __first; - ++__i; - if (__i == __last) - return false; - __i = __last; - --__i; - - for(;;) { - _BidirectionalIter __ii = __i; - --__i; - if (*__ii < *__i) { - _BidirectionalIter __j = __last; - while (!(*--__j < *__i)) - {} - iter_swap(__i, __j); - reverse(__ii, __last); - return true; + // find_first_of, with and without an explicitly supplied comparison function. + + template + _InputIter + find_first_of(_InputIter __first1, _InputIter __last1, + _ForwardIter __first2, _ForwardIter __last2) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_EqualOpConcept< + typename iterator_traits<_InputIter>::value_type, + typename iterator_traits<_ForwardIter>::value_type>); + + for ( ; __first1 != __last1; ++__first1) + for (_ForwardIter __iter = __first2; __iter != __last2; ++__iter) + if (*__first1 == *__iter) + return __first1; + return __last1; } - if (__i == __first) { - reverse(__first, __last); - return false; + + template + _InputIter + find_first_of(_InputIter __first1, _InputIter __last1, + _ForwardIter __first2, _ForwardIter __last2, + _BinaryPredicate __comp) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_EqualOpConcept< + typename iterator_traits<_InputIter>::value_type, + typename iterator_traits<_ForwardIter>::value_type>); + __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate, + typename iterator_traits<_InputIter>::value_type, + typename iterator_traits<_ForwardIter>::value_type>); + + for ( ; __first1 != __last1; ++__first1) + for (_ForwardIter __iter = __first2; __iter != __last2; ++__iter) + if (__comp(*__first1, *__iter)) + return __first1; + return __last1; } - } -} -template -bool prev_permutation(_BidirectionalIter __first, _BidirectionalIter __last, - _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter>); - __glibcpp_function_requires(_BinaryPredicateConcept<_Compare, - typename iterator_traits<_BidirectionalIter>::value_type, - typename iterator_traits<_BidirectionalIter>::value_type>); - - if (__first == __last) - return false; - _BidirectionalIter __i = __first; - ++__i; - if (__i == __last) - return false; - __i = __last; - --__i; - - for(;;) { - _BidirectionalIter __ii = __i; - --__i; - if (__comp(*__ii, *__i)) { - _BidirectionalIter __j = __last; - while (!__comp(*--__j, *__i)) - {} - iter_swap(__i, __j); - reverse(__ii, __last); - return true; + + // find_end, with and without an explicitly supplied comparison function. + // Search [first2, last2) as a subsequence in [first1, last1), and return + // the *last* possible match. Note that find_end for bidirectional iterators + // is much faster than for forward iterators. + + // find_end for forward iterators. + template + _ForwardIter1 + __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, + _ForwardIter2 __first2, _ForwardIter2 __last2, + forward_iterator_tag, forward_iterator_tag) + { + if (__first2 == __last2) + return __last1; + else { + _ForwardIter1 __result = __last1; + while (1) { + _ForwardIter1 __new_result + = search(__first1, __last1, __first2, __last2); + if (__new_result == __last1) + return __result; + else { + __result = __new_result; + __first1 = __new_result; + ++__first1; + } + } + } } - if (__i == __first) { - reverse(__first, __last); - return false; + + template + _ForwardIter1 + __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, + _ForwardIter2 __first2, _ForwardIter2 __last2, + forward_iterator_tag, forward_iterator_tag, + _BinaryPredicate __comp) + { + if (__first2 == __last2) + return __last1; + else { + _ForwardIter1 __result = __last1; + while (1) { + _ForwardIter1 __new_result + = search(__first1, __last1, __first2, __last2, __comp); + if (__new_result == __last1) + return __result; + else { + __result = __new_result; + __first1 = __new_result; + ++__first1; + } + } + } } - } -} -// find_first_of, with and without an explicitly supplied comparison function. + // find_end for bidirectional iterators. Requires partial specialization. + template + _BidirectionalIter1 + __find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, + _BidirectionalIter2 __first2, _BidirectionalIter2 __last2, + bidirectional_iterator_tag, bidirectional_iterator_tag) + { + // concept requirements + __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter1>); + __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter2>); -template -_InputIter find_first_of(_InputIter __first1, _InputIter __last1, - _ForwardIter __first2, _ForwardIter __last2) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_EqualOpConcept< - typename iterator_traits<_InputIter>::value_type, - typename iterator_traits<_ForwardIter>::value_type>); - - for ( ; __first1 != __last1; ++__first1) - for (_ForwardIter __iter = __first2; __iter != __last2; ++__iter) - if (*__first1 == *__iter) - return __first1; - return __last1; -} - -template -_InputIter find_first_of(_InputIter __first1, _InputIter __last1, - _ForwardIter __first2, _ForwardIter __last2, - _BinaryPredicate __comp) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_EqualOpConcept< - typename iterator_traits<_InputIter>::value_type, - typename iterator_traits<_ForwardIter>::value_type>); - __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate, - typename iterator_traits<_InputIter>::value_type, - typename iterator_traits<_ForwardIter>::value_type>); - - for ( ; __first1 != __last1; ++__first1) - for (_ForwardIter __iter = __first2; __iter != __last2; ++__iter) - if (__comp(*__first1, *__iter)) - return __first1; - return __last1; -} - - -// find_end, with and without an explicitly supplied comparison function. -// Search [first2, last2) as a subsequence in [first1, last1), and return -// the *last* possible match. Note that find_end for bidirectional iterators -// is much faster than for forward iterators. - -// find_end for forward iterators. -template -_ForwardIter1 __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, - _ForwardIter2 __first2, _ForwardIter2 __last2, - forward_iterator_tag, forward_iterator_tag) -{ - if (__first2 == __last2) - return __last1; - else { - _ForwardIter1 __result = __last1; - while (1) { - _ForwardIter1 __new_result - = search(__first1, __last1, __first2, __last2); - if (__new_result == __last1) - return __result; + typedef reverse_iterator<_BidirectionalIter1> _RevIter1; + typedef reverse_iterator<_BidirectionalIter2> _RevIter2; + + _RevIter1 __rlast1(__first1); + _RevIter2 __rlast2(__first2); + _RevIter1 __rresult = search(_RevIter1(__last1), __rlast1, + _RevIter2(__last2), __rlast2); + + if (__rresult == __rlast1) + return __last1; else { - __result = __new_result; - __first1 = __new_result; - ++__first1; + _BidirectionalIter1 __result = __rresult.base(); + advance(__result, -distance(__first2, __last2)); + return __result; } } - } -} -template -_ForwardIter1 __find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, - _ForwardIter2 __first2, _ForwardIter2 __last2, - forward_iterator_tag, forward_iterator_tag, - _BinaryPredicate __comp) -{ - if (__first2 == __last2) - return __last1; - else { - _ForwardIter1 __result = __last1; - while (1) { - _ForwardIter1 __new_result - = search(__first1, __last1, __first2, __last2, __comp); - if (__new_result == __last1) - return __result; + template + _BidirectionalIter1 + __find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, + _BidirectionalIter2 __first2, _BidirectionalIter2 __last2, + bidirectional_iterator_tag, bidirectional_iterator_tag, + _BinaryPredicate __comp) + { + // concept requirements + __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter1>); + __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter2>); + + typedef reverse_iterator<_BidirectionalIter1> _RevIter1; + typedef reverse_iterator<_BidirectionalIter2> _RevIter2; + + _RevIter1 __rlast1(__first1); + _RevIter2 __rlast2(__first2); + _RevIter1 __rresult = search(_RevIter1(__last1), __rlast1, + _RevIter2(__last2), __rlast2, + __comp); + + if (__rresult == __rlast1) + return __last1; else { - __result = __new_result; - __first1 = __new_result; - ++__first1; + _BidirectionalIter1 __result = __rresult.base(); + advance(__result, -distance(__first2, __last2)); + return __result; } } - } -} -// find_end for bidirectional iterators. Requires partial specialization. -template -_BidirectionalIter1 -__find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, - _BidirectionalIter2 __first2, _BidirectionalIter2 __last2, - bidirectional_iterator_tag, bidirectional_iterator_tag) -{ - // concept requirements - __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter1>); - __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter2>); - - typedef reverse_iterator<_BidirectionalIter1> _RevIter1; - typedef reverse_iterator<_BidirectionalIter2> _RevIter2; - - _RevIter1 __rlast1(__first1); - _RevIter2 __rlast2(__first2); - _RevIter1 __rresult = search(_RevIter1(__last1), __rlast1, - _RevIter2(__last2), __rlast2); - - if (__rresult == __rlast1) - return __last1; - else { - _BidirectionalIter1 __result = __rresult.base(); - advance(__result, -distance(__first2, __last2)); - return __result; - } -} - -template -_BidirectionalIter1 -__find_end(_BidirectionalIter1 __first1, _BidirectionalIter1 __last1, - _BidirectionalIter2 __first2, _BidirectionalIter2 __last2, - bidirectional_iterator_tag, bidirectional_iterator_tag, - _BinaryPredicate __comp) -{ - // concept requirements - __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter1>); - __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIter2>); + // Dispatching functions for find_end. + + template + inline _ForwardIter1 + find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, + _ForwardIter2 __first2, _ForwardIter2 __last2) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>); + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>); + __glibcpp_function_requires(_EqualOpConcept< + typename iterator_traits<_ForwardIter1>::value_type, + typename iterator_traits<_ForwardIter2>::value_type>); + + return __find_end(__first1, __last1, __first2, __last2, + __iterator_category(__first1), + __iterator_category(__first2)); + } + + template + inline _ForwardIter1 + find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, + _ForwardIter2 __first2, _ForwardIter2 __last2, + _BinaryPredicate __comp) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>); + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>); + __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate, + typename iterator_traits<_ForwardIter1>::value_type, + typename iterator_traits<_ForwardIter2>::value_type>); + + return __find_end(__first1, __last1, __first2, __last2, + __iterator_category(__first1), + __iterator_category(__first2), + __comp); + } + + // is_heap, a predicate testing whether or not a range is + // a heap. This function is an extension, not part of the C++ + // standard. + + template + bool + __is_heap(_RandomAccessIter __first, _Distance __n) + { + _Distance __parent = 0; + for (_Distance __child = 1; __child < __n; ++__child) { + if (__first[__parent] < __first[__child]) + return false; + if ((__child & 1) == 0) + ++__parent; + } + return true; + } - typedef reverse_iterator<_BidirectionalIter1> _RevIter1; - typedef reverse_iterator<_BidirectionalIter2> _RevIter2; + template + bool + __is_heap(_RandomAccessIter __first, _StrictWeakOrdering __comp, + _Distance __n) + { + _Distance __parent = 0; + for (_Distance __child = 1; __child < __n; ++__child) { + if (__comp(__first[__parent], __first[__child])) + return false; + if ((__child & 1) == 0) + ++__parent; + } + return true; + } - _RevIter1 __rlast1(__first1); - _RevIter2 __rlast2(__first2); - _RevIter1 __rresult = search(_RevIter1(__last1), __rlast1, - _RevIter2(__last2), __rlast2, - __comp); + template + inline bool + is_heap(_RandomAccessIter __first, _RandomAccessIter __last) + { + // concept requirements + __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIter>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_RandomAccessIter>::value_type>); - if (__rresult == __rlast1) - return __last1; - else { - _BidirectionalIter1 __result = __rresult.base(); - advance(__result, -distance(__first2, __last2)); - return __result; - } -} - -// Dispatching functions for find_end. - -template -inline _ForwardIter1 -find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, - _ForwardIter2 __first2, _ForwardIter2 __last2) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>); - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>); - __glibcpp_function_requires(_EqualOpConcept< - typename iterator_traits<_ForwardIter1>::value_type, - typename iterator_traits<_ForwardIter2>::value_type>); - - return __find_end(__first1, __last1, __first2, __last2, - __iterator_category(__first1), - __iterator_category(__first2)); -} - -template -inline _ForwardIter1 -find_end(_ForwardIter1 __first1, _ForwardIter1 __last1, - _ForwardIter2 __first2, _ForwardIter2 __last2, - _BinaryPredicate __comp) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter1>); - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter2>); - __glibcpp_function_requires(_BinaryPredicateConcept<_BinaryPredicate, - typename iterator_traits<_ForwardIter1>::value_type, - typename iterator_traits<_ForwardIter2>::value_type>); - - return __find_end(__first1, __last1, __first2, __last2, - __iterator_category(__first1), - __iterator_category(__first2), - __comp); -} - -// is_heap, a predicate testing whether or not a range is -// a heap. This function is an extension, not part of the C++ -// standard. - -template -bool __is_heap(_RandomAccessIter __first, _Distance __n) -{ - _Distance __parent = 0; - for (_Distance __child = 1; __child < __n; ++__child) { - if (__first[__parent] < __first[__child]) - return false; - if ((__child & 1) == 0) - ++__parent; - } - return true; -} - -template -bool __is_heap(_RandomAccessIter __first, _StrictWeakOrdering __comp, - _Distance __n) -{ - _Distance __parent = 0; - for (_Distance __child = 1; __child < __n; ++__child) { - if (__comp(__first[__parent], __first[__child])) - return false; - if ((__child & 1) == 0) - ++__parent; - } - return true; -} - -template -inline bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last) -{ - // concept requirements - __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIter>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_RandomAccessIter>::value_type>); + return __is_heap(__first, __last - __first); + } - return __is_heap(__first, __last - __first); -} + template + inline bool + is_heap(_RandomAccessIter __first, _RandomAccessIter __last, + _StrictWeakOrdering __comp) + { + // concept requirements + __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIter>); + __glibcpp_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering, + typename iterator_traits<_RandomAccessIter>::value_type, + typename iterator_traits<_RandomAccessIter>::value_type>); -template -inline bool is_heap(_RandomAccessIter __first, _RandomAccessIter __last, - _StrictWeakOrdering __comp) -{ - // concept requirements - __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIter>); - __glibcpp_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering, - typename iterator_traits<_RandomAccessIter>::value_type, - typename iterator_traits<_RandomAccessIter>::value_type>); + return __is_heap(__first, __comp, __last - __first); + } - return __is_heap(__first, __comp, __last - __first); -} + // is_sorted, a predicated testing whether a range is sorted in + // nondescending order. This is an extension, not part of the C++ + // standard. -// is_sorted, a predicated testing whether a range is sorted in -// nondescending order. This is an extension, not part of the C++ -// standard. + template + bool + is_sorted(_ForwardIter __first, _ForwardIter __last) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_ForwardIter>::value_type>); -template -bool is_sorted(_ForwardIter __first, _ForwardIter __last) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_ForwardIter>::value_type>); - - if (__first == __last) - return true; - - _ForwardIter __next = __first; - for (++__next; __next != __last; __first = __next, ++__next) { - if (*__next < *__first) - return false; - } - - return true; -} - -template -bool is_sorted(_ForwardIter __first, _ForwardIter __last, - _StrictWeakOrdering __comp) -{ - // concept requirements - __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering, - typename iterator_traits<_ForwardIter>::value_type, - typename iterator_traits<_ForwardIter>::value_type>); - - if (__first == __last) - return true; - - _ForwardIter __next = __first; - for (++__next; __next != __last; __first = __next, ++__next) { - if (__comp(*__next, *__first)) - return false; - } - - return true; -} + if (__first == __last) + return true; + + _ForwardIter __next = __first; + for (++__next; __next != __last; __first = __next, ++__next) { + if (*__next < *__first) + return false; + } + + return true; + } + + template + bool + is_sorted(_ForwardIter __first, _ForwardIter __last, _StrictWeakOrdering __comp) + { + // concept requirements + __glibcpp_function_requires(_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering, + typename iterator_traits<_ForwardIter>::value_type, + typename iterator_traits<_ForwardIter>::value_type>); + + if (__first == __last) + return true; + + _ForwardIter __next = __first; + for (++__next; __next != __last; __first = __next, ++__next) { + if (__comp(*__next, *__first)) + return false; + } + + return true; + } } // namespace std diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index 23679d08120..bd8c62502ae 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -62,12 +62,8 @@ #define __SGI_STL_INTERNAL_ALGOBASE_H #include -#ifndef __SGI_STL_INTERNAL_PAIR_H #include -#endif -#ifndef _CPP_BITS_TYPE_TRAITS_H #include -#endif #include #include #include @@ -83,648 +79,663 @@ namespace std { -// swap and iter_swap - -template -inline void __iter_swap(_ForwardIter1 __a, _ForwardIter2 __b, _Tp*) -{ - _Tp __tmp = *__a; - *__a = *__b; - *__b = __tmp; -} - -template -inline void iter_swap(_ForwardIter1 __a, _ForwardIter2 __b) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter1>); - __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter2>); - __glibcpp_function_requires(_ConvertibleConcept< - typename iterator_traits<_ForwardIter1>::value_type, - typename iterator_traits<_ForwardIter2>::value_type>); - __glibcpp_function_requires(_ConvertibleConcept< - typename iterator_traits<_ForwardIter2>::value_type, - typename iterator_traits<_ForwardIter1>::value_type>); - - __iter_swap(__a, __b, __value_type(__a)); -} - -template -inline void swap(_Tp& __a, _Tp& __b) -{ - // concept requirements - __glibcpp_function_requires(_SGIAssignableConcept<_Tp>); - - _Tp __tmp = __a; - __a = __b; - __b = __tmp; -} - -//-------------------------------------------------- -// min and max - -#undef min -#undef max - -template -inline const _Tp& min(const _Tp& __a, const _Tp& __b) { - // concept requirements - __glibcpp_function_requires(_LessThanComparableConcept<_Tp>); - //return __b < __a ? __b : __a; - if (__b < __a) return __b; return __a; -} - -template -inline const _Tp& max(const _Tp& __a, const _Tp& __b) { - // concept requirements - __glibcpp_function_requires(_LessThanComparableConcept<_Tp>); - //return __a < __b ? __b : __a; - if (__a < __b) return __b; return __a; -} - -template -inline const _Tp& min(const _Tp& __a, const _Tp& __b, _Compare __comp) { - //return __comp(__b, __a) ? __b : __a; - if (__comp(__b, __a)) return __b; return __a; -} - -template -inline const _Tp& max(const _Tp& __a, const _Tp& __b, _Compare __comp) { - //return __comp(__a, __b) ? __b : __a; - if (__comp(__a, __b)) return __b; return __a; -} - -//-------------------------------------------------- -// copy - -// All of these auxiliary functions serve two purposes. (1) Replace -// calls to copy with memmove whenever possible. (Memmove, not memcpy, -// because the input and output ranges are permitted to overlap.) -// (2) If we're using random access iterators, then write the loop as -// a for loop with an explicit count. - -template -inline _OutputIter __copy(_InputIter __first, _InputIter __last, - _OutputIter __result, - input_iterator_tag, _Distance*) -{ - for ( ; __first != __last; ++__result, ++__first) - *__result = *__first; - return __result; -} - -template -inline _OutputIter -__copy(_RandomAccessIter __first, _RandomAccessIter __last, - _OutputIter __result, random_access_iterator_tag, _Distance*) -{ - for (_Distance __n = __last - __first; __n > 0; --__n) { - *__result = *__first; - ++__first; - ++__result; - } - return __result; -} - -template -inline _Tp* -__copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result) -{ - memmove(__result, __first, sizeof(_Tp) * (__last - __first)); - return __result + (__last - __first); -} - - -template -inline _OutputIter __copy_aux2(_InputIter __first, _InputIter __last, - _OutputIter __result, __false_type) -{ - return __copy(__first, __last, __result, - __iterator_category(__first), - __distance_type(__first)); -} - -template -inline _OutputIter __copy_aux2(_InputIter __first, _InputIter __last, - _OutputIter __result, __true_type) -{ - return __copy(__first, __last, __result, - __iterator_category(__first), - __distance_type(__first)); -} - -template -inline _Tp* __copy_aux2(_Tp* __first, _Tp* __last, _Tp* __result, - __true_type) -{ - return __copy_trivial(__first, __last, __result); -} - -template -inline _Tp* __copy_aux2(const _Tp* __first, const _Tp* __last, _Tp* __result, - __true_type) -{ - return __copy_trivial(__first, __last, __result); -} - - -template -inline _OutputIter __copy_aux(_InputIter __first, _InputIter __last, - _OutputIter __result, _Tp*) -{ - typedef typename __type_traits<_Tp>::has_trivial_assignment_operator - _Trivial; - return __copy_aux2(__first, __last, __result, _Trivial()); -} - -template -inline _OutputIter __copy_ni2(_InputIter __first, _InputIter __last, - _OutputIter __result, __true_type) -{ - return _OutputIter(__copy_aux(__first, __last, __result.base(), - __value_type(__first))); -} - -template -inline _OutputIter __copy_ni2(_InputIter __first, _InputIter __last, - _OutputIter __result, __false_type) -{ - return __copy_aux(__first, __last, __result, __value_type(__first)); -} - -template -inline _OutputIter __copy_ni1(_InputIter __first, _InputIter __last, - _OutputIter __result, __true_type) -{ - typedef typename _Is_normal_iterator<_OutputIter>::_Normal __Normal; - return __copy_ni2(__first.base(), __last.base(), __result, __Normal()); -} - -template -inline _OutputIter __copy_ni1(_InputIter __first, _InputIter __last, - _OutputIter __result, __false_type) -{ - typedef typename _Is_normal_iterator<_OutputIter>::_Normal __Normal; - return __copy_ni2(__first, __last, __result, __Normal()); -} - -template -inline _OutputIter copy(_InputIter __first, _InputIter __last, - _OutputIter __result) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter>::value_type>); - - typedef typename _Is_normal_iterator<_InputIter>::_Normal __Normal; - return __copy_ni1(__first, __last, __result, __Normal()); -} - -//-------------------------------------------------- -// copy_backward - -template -inline _BidirectionalIter2 __copy_backward(_BidirectionalIter1 __first, - _BidirectionalIter1 __last, - _BidirectionalIter2 __result, - bidirectional_iterator_tag, - _Distance*) -{ - while (__first != __last) - *--__result = *--__last; - return __result; -} - -template -inline _BidirectionalIter __copy_backward(_RandomAccessIter __first, - _RandomAccessIter __last, - _BidirectionalIter __result, - random_access_iterator_tag, - _Distance*) -{ - for (_Distance __n = __last - __first; __n > 0; --__n) - *--__result = *--__last; - return __result; -} - - -// This dispatch class is a workaround for compilers that do not -// have partial ordering of function templates. All we're doing is -// creating a specialization so that we can turn a call to copy_backward -// into a memmove whenever possible. - -template -struct __copy_backward_dispatch -{ - typedef typename iterator_traits<_BidirectionalIter1>::iterator_category - _Cat; - typedef typename iterator_traits<_BidirectionalIter1>::difference_type + // swap and iter_swap + + template + inline void + iter_swap(_ForwardIter1 __a, _ForwardIter2 __b) + { + typedef typename iterator_traits<_ForwardIter1>::value_type _ValueType1; + typedef typename iterator_traits<_ForwardIter2>::value_type _ValueType2; + + // concept requirements + __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter1>); + __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter2>); + __glibcpp_function_requires(_ConvertibleConcept<_ValueType1, _ValueType2>); + __glibcpp_function_requires(_ConvertibleConcept<_ValueType2, _ValueType1>); + + _ValueType1 __tmp = *__a; + *__a = *__b; + *__b = __tmp; + } + + template + inline void + swap(_Tp& __a, _Tp& __b) + { + // concept requirements + __glibcpp_function_requires(_SGIAssignableConcept<_Tp>); + + _Tp __tmp = __a; + __a = __b; + __b = __tmp; + } + + //-------------------------------------------------- + // min and max + + #undef min + #undef max + + template + inline const _Tp& + min(const _Tp& __a, const _Tp& __b) + { + // concept requirements + __glibcpp_function_requires(_LessThanComparableConcept<_Tp>); + //return __b < __a ? __b : __a; + if (__b < __a) return __b; return __a; + } + + template + inline const _Tp& + max(const _Tp& __a, const _Tp& __b) + { + // concept requirements + __glibcpp_function_requires(_LessThanComparableConcept<_Tp>); + //return __a < __b ? __b : __a; + if (__a < __b) return __b; return __a; + } + + template + inline const _Tp& + min(const _Tp& __a, const _Tp& __b, _Compare __comp) + { + //return __comp(__b, __a) ? __b : __a; + if (__comp(__b, __a)) return __b; return __a; + } + + template + inline const _Tp& + max(const _Tp& __a, const _Tp& __b, _Compare __comp) + { + //return __comp(__a, __b) ? __b : __a; + if (__comp(__a, __b)) return __b; return __a; + } + + //-------------------------------------------------- + // copy + + // All of these auxiliary functions serve two purposes. (1) Replace + // calls to copy with memmove whenever possible. (Memmove, not memcpy, + // because the input and output ranges are permitted to overlap.) + // (2) If we're using random access iterators, then write the loop as + // a for loop with an explicit count. + + template + inline _OutputIter + __copy(_InputIter __first, _InputIter __last, + _OutputIter __result, + input_iterator_tag) + { + for ( ; __first != __last; ++__result, ++__first) + *__result = *__first; + return __result; + } + + template + inline _OutputIter + __copy(_RandomAccessIter __first, _RandomAccessIter __last, + _OutputIter __result, + random_access_iterator_tag) + { + typedef typename iterator_traits<_RandomAccessIter>::difference_type _Distance; - - static _BidirectionalIter2 copy(_BidirectionalIter1 __first, - _BidirectionalIter1 __last, - _BidirectionalIter2 __result) { - return __copy_backward(__first, __last, __result, _Cat(), (_Distance*) 0); - } -}; - -template -struct __copy_backward_dispatch<_Tp*, _Tp*, __true_type> -{ - static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) { - const ptrdiff_t _Num = __last - __first; - memmove(__result - _Num, __first, sizeof(_Tp) * _Num); - return __result - _Num; - } -}; - -template -struct __copy_backward_dispatch -{ - static _Tp* copy(const _Tp* __first, const _Tp* __last, _Tp* __result) { - return __copy_backward_dispatch<_Tp*, _Tp*, __true_type> - ::copy(__first, __last, __result); - } -}; - -template -inline _BI2 __copy_backward_aux(_BI1 __first, _BI1 __last, _BI2 __result) { - typedef typename __type_traits::value_type> - ::has_trivial_assignment_operator + for (_Distance __n = __last - __first; __n > 0; --__n) { + *__result = *__first; + ++__first; + ++__result; + } + return __result; + } + + template + inline _Tp* + __copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result) + { + memmove(__result, __first, sizeof(_Tp) * (__last - __first)); + return __result + (__last - __first); + } + + template + inline _OutputIter + __copy_aux2(_InputIter __first, _InputIter __last, + _OutputIter __result, __false_type) + { return __copy(__first, __last, __result, __iterator_category(__first)); } + + template + inline _OutputIter + __copy_aux2(_InputIter __first, _InputIter __last, + _OutputIter __result, __true_type) + { return __copy(__first, __last, __result, __iterator_category(__first)); } + + template + inline _Tp* + __copy_aux2(_Tp* __first, _Tp* __last, + _Tp* __result, __true_type) + { return __copy_trivial(__first, __last, __result); } + + template + inline _Tp* + __copy_aux2(const _Tp* __first, const _Tp* __last, + _Tp* __result, __true_type) + { return __copy_trivial(__first, __last, __result); } + + template + inline _OutputIter + __copy_ni2(_InputIter __first, _InputIter __last, + _OutputIter __result, __true_type) + { + typedef typename iterator_traits<_InputIter>::value_type + _ValueType; + typedef typename __type_traits<_ValueType>::has_trivial_assignment_operator + _Trivial; + return _OutputIter(__copy_aux2(__first, __last, + __result.base(), + _Trivial())); + } + + template + inline _OutputIter + __copy_ni2(_InputIter __first, _InputIter __last, + _OutputIter __result, __false_type) + { + typedef typename iterator_traits<_InputIter>::value_type + _ValueType; + typedef typename __type_traits<_ValueType>::has_trivial_assignment_operator _Trivial; - return __copy_backward_dispatch<_BI1, _BI2, _Trivial> - ::copy(__first, __last, __result); -} - -template -inline _BI2 __copy_backward_output_normal_iterator(_BI1 __first, _BI1 __last, - _BI2 __result, __true_type) { - return _BI2(__copy_backward_aux(__first, __last, __result.base())); -} - -template -inline _BI2 __copy_backward_output_normal_iterator(_BI1 __first, _BI1 __last, - _BI2 __result, __false_type){ - return __copy_backward_aux(__first, __last, __result); -} - -template -inline _BI2 __copy_backward_input_normal_iterator(_BI1 __first, _BI1 __last, - _BI2 __result, __true_type) { - typedef typename _Is_normal_iterator<_BI2>::_Normal __Normal; - return __copy_backward_output_normal_iterator(__first.base(), __last.base(), - __result, __Normal()); -} - -template -inline _BI2 __copy_backward_input_normal_iterator(_BI1 __first, _BI1 __last, - _BI2 __result, __false_type) { - typedef typename _Is_normal_iterator<_BI2>::_Normal __Normal; - return __copy_backward_output_normal_iterator(__first, __last, __result, - __Normal()); -} - -template -inline _BI2 copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) -{ - // concept requirements - __glibcpp_function_requires(_BidirectionalIteratorConcept<_BI1>); - __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>); - __glibcpp_function_requires(_ConvertibleConcept< - typename iterator_traits<_BI1>::value_type, - typename iterator_traits<_BI2>::value_type>); - - typedef typename _Is_normal_iterator<_BI1>::_Normal __Normal; - return __copy_backward_input_normal_iterator(__first, __last, __result, - __Normal()); -} - -//-------------------------------------------------- -// copy_n (not part of the C++ standard) - -template -pair<_InputIter, _OutputIter> __copy_n(_InputIter __first, _Size __count, - _OutputIter __result, - input_iterator_tag) { - for ( ; __count > 0; --__count) { - *__result = *__first; - ++__first; - ++__result; + return __copy_aux2(__first, __last, + __result, + _Trivial()); + } + + template + inline _OutputIter + __copy_ni1(_InputIter __first, _InputIter __last, + _OutputIter __result, __true_type) + { + typedef typename _Is_normal_iterator<_OutputIter>::_Normal __Normal; + return __copy_ni2(__first.base(), __last.base(), __result, __Normal()); + } + + template + inline _OutputIter + __copy_ni1(_InputIter __first, _InputIter __last, + _OutputIter __result, __false_type) + { + typedef typename _Is_normal_iterator<_OutputIter>::_Normal __Normal; + return __copy_ni2(__first, __last, __result, __Normal()); + } + + template + inline _OutputIter + copy(_InputIter __first, _InputIter __last, _OutputIter __result) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter>::value_type>); + + typedef typename _Is_normal_iterator<_InputIter>::_Normal __Normal; + return __copy_ni1(__first, __last, __result, __Normal()); + } + + //-------------------------------------------------- + // copy_backward + + template + inline _BidirectionalIter2 + __copy_backward(_BidirectionalIter1 __first, _BidirectionalIter1 __last, + _BidirectionalIter2 __result, + bidirectional_iterator_tag) + { + while (__first != __last) + *--__result = *--__last; + return __result; + } + + template + inline _BidirectionalIter + __copy_backward(_RandomAccessIter __first, _RandomAccessIter __last, + _BidirectionalIter __result, + random_access_iterator_tag) + { + typename iterator_traits<_RandomAccessIter>::difference_type __n; + for (__n = __last - __first; __n > 0; --__n) + *--__result = *--__last; + return __result; + } + + + // This dispatch class is a workaround for compilers that do not + // have partial ordering of function templates. All we're doing is + // creating a specialization so that we can turn a call to copy_backward + // into a memmove whenever possible. + + template + struct __copy_backward_dispatch + { + static _BidirectionalIter2 + copy(_BidirectionalIter1 __first, _BidirectionalIter1 __last, + _BidirectionalIter2 __result) + { + return __copy_backward(__first, __last, + __result, + __iterator_category(__first)); + } + }; + + template + struct __copy_backward_dispatch<_Tp*, _Tp*, __true_type> + { + static _Tp* + copy(const _Tp* __first, const _Tp* __last, _Tp* __result) + { + const ptrdiff_t _Num = __last - __first; + memmove(__result - _Num, __first, sizeof(_Tp) * _Num); + return __result - _Num; + } + }; + + template + struct __copy_backward_dispatch + { + static _Tp* + copy(const _Tp* __first, const _Tp* __last, _Tp* __result) + { + return __copy_backward_dispatch<_Tp*, _Tp*, __true_type> + ::copy(__first, __last, __result); + } + }; + + template + inline _BI2 + __copy_backward_aux(_BI1 __first, _BI1 __last, _BI2 __result) + { + typedef typename __type_traits::value_type> + ::has_trivial_assignment_operator _Trivial; + return __copy_backward_dispatch<_BI1, _BI2, _Trivial> + ::copy(__first, __last, __result); + } + + template + inline _BI2 + __copy_backward_output_normal_iterator(_BI1 __first, _BI1 __last, + _BI2 __result, __true_type) + { return _BI2(__copy_backward_aux(__first, __last, __result.base())); } + + template + inline _BI2 + __copy_backward_output_normal_iterator(_BI1 __first, _BI1 __last, + _BI2 __result, __false_type) + { return __copy_backward_aux(__first, __last, __result); } + + template + inline _BI2 + __copy_backward_input_normal_iterator(_BI1 __first, _BI1 __last, + _BI2 __result, __true_type) + { + typedef typename _Is_normal_iterator<_BI2>::_Normal __Normal; + return __copy_backward_output_normal_iterator(__first.base(), __last.base(), + __result, __Normal()); + } + + template + inline _BI2 + __copy_backward_input_normal_iterator(_BI1 __first, _BI1 __last, + _BI2 __result, __false_type) + { + typedef typename _Is_normal_iterator<_BI2>::_Normal __Normal; + return __copy_backward_output_normal_iterator(__first, __last, __result, + __Normal()); + } + + template + inline _BI2 + copy_backward(_BI1 __first, _BI1 __last, _BI2 __result) + { + // concept requirements + __glibcpp_function_requires(_BidirectionalIteratorConcept<_BI1>); + __glibcpp_function_requires(_Mutable_BidirectionalIteratorConcept<_BI2>); + __glibcpp_function_requires(_ConvertibleConcept< + typename iterator_traits<_BI1>::value_type, + typename iterator_traits<_BI2>::value_type>); + + typedef typename _Is_normal_iterator<_BI1>::_Normal __Normal; + return __copy_backward_input_normal_iterator(__first, __last, __result, + __Normal()); + } + + //-------------------------------------------------- + // copy_n (not part of the C++ standard) + + template + pair<_InputIter, _OutputIter> + __copy_n(_InputIter __first, _Size __count, + _OutputIter __result, + input_iterator_tag) + { + for ( ; __count > 0; --__count) { + *__result = *__first; + ++__first; + ++__result; + } + return pair<_InputIter, _OutputIter>(__first, __result); + } + + template + inline pair<_RAIter, _OutputIter> + __copy_n(_RAIter __first, _Size __count, + _OutputIter __result, + random_access_iterator_tag) + { + _RAIter __last = __first + __count; + return pair<_RAIter, _OutputIter>(__last, copy(__first, __last, __result)); + } + + template + inline pair<_InputIter, _OutputIter> + copy_n(_InputIter __first, _Size __count, _OutputIter __result) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, + typename iterator_traits<_InputIter>::value_type>); + + return __copy_n(__first, __count, __result, __iterator_category(__first)); + } + + //-------------------------------------------------- + // fill and fill_n + + + template + void + fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __value) + { + // concept requirements + __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); + + for ( ; __first != __last; ++__first) + *__first = __value; + } + + template + _OutputIter + fill_n(_OutputIter __first, _Size __n, const _Tp& __value) + { + // concept requirements + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,_Tp>); + + for ( ; __n > 0; --__n, ++__first) + *__first = __value; + return __first; + } + + // Specialization: for one-byte types we can use memset. + + inline void + fill(unsigned char* __first, unsigned char* __last, const unsigned char& __c) + { + unsigned char __tmp = __c; + memset(__first, __tmp, __last - __first); } - return pair<_InputIter, _OutputIter>(__first, __result); -} - -template -inline pair<_RAIter, _OutputIter> -__copy_n(_RAIter __first, _Size __count, - _OutputIter __result, - random_access_iterator_tag) { - _RAIter __last = __first + __count; - return pair<_RAIter, _OutputIter>(__last, copy(__first, __last, __result)); -} - -template -inline pair<_InputIter, _OutputIter> -__copy_n(_InputIter __first, _Size __count, _OutputIter __result) { - return __copy_n(__first, __count, __result, - __iterator_category(__first)); -} - -template -inline pair<_InputIter, _OutputIter> -copy_n(_InputIter __first, _Size __count, _OutputIter __result) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter, - typename iterator_traits<_InputIter>::value_type>); - - return __copy_n(__first, __count, __result); -} - -//-------------------------------------------------- -// fill and fill_n - - -template -void fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __value) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); - - for ( ; __first != __last; ++__first) - *__first = __value; -} - -template -_OutputIter fill_n(_OutputIter __first, _Size __n, const _Tp& __value) -{ - // concept requirements - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,_Tp>); - - for ( ; __n > 0; --__n, ++__first) - *__first = __value; - return __first; -} -// Specialization: for one-byte types we can use memset. - -inline void fill(unsigned char* __first, unsigned char* __last, - const unsigned char& __c) -{ - unsigned char __tmp = __c; - memset(__first, __tmp, __last - __first); -} - -inline void fill(signed char* __first, signed char* __last, - const signed char& __c) -{ - signed char __tmp = __c; - memset(__first, static_cast(__tmp), __last - __first); -} - -inline void fill(char* __first, char* __last, const char& __c) -{ - char __tmp = __c; - memset(__first, static_cast(__tmp), __last - __first); -} - -template -inline unsigned char* fill_n(unsigned char* __first, _Size __n, - const unsigned char& __c) -{ - fill(__first, __first + __n, __c); - return __first + __n; -} - -template -inline signed char* fill_n(char* __first, _Size __n, - const signed char& __c) -{ - fill(__first, __first + __n, __c); - return __first + __n; -} - -template -inline char* fill_n(char* __first, _Size __n, const char& __c) -{ - fill(__first, __first + __n, __c); - return __first + __n; -} - - -//-------------------------------------------------- -// equal and mismatch - -template -pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1, - _InputIter1 __last1, - _InputIter2 __first2) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_EqualityComparableConcept< - typename iterator_traits<_InputIter1>::value_type>); - __glibcpp_function_requires(_EqualityComparableConcept< - typename iterator_traits<_InputIter2>::value_type>); - - while (__first1 != __last1 && *__first1 == *__first2) { - ++__first1; - ++__first2; + inline void + fill(signed char* __first, signed char* __last, const signed char& __c) + { + signed char __tmp = __c; + memset(__first, static_cast(__tmp), __last - __first); } - return pair<_InputIter1, _InputIter2>(__first1, __first2); -} - -template -pair<_InputIter1, _InputIter2> mismatch(_InputIter1 __first1, - _InputIter1 __last1, - _InputIter2 __first2, - _BinaryPredicate __binary_pred) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - while (__first1 != __last1 && __binary_pred(*__first1, *__first2)) { - ++__first1; - ++__first2; + inline void + fill(char* __first, char* __last, const char& __c) + { + char __tmp = __c; + memset(__first, static_cast(__tmp), __last - __first); } - return pair<_InputIter1, _InputIter2>(__first1, __first2); -} -template -inline bool equal(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_EqualOpConcept< - typename iterator_traits<_InputIter1>::value_type, - typename iterator_traits<_InputIter2>::value_type>); - - for ( ; __first1 != __last1; ++__first1, ++__first2) - if (!(*__first1 == *__first2)) - return false; - return true; -} - -template -inline bool equal(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _BinaryPredicate __binary_pred) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - - for ( ; __first1 != __last1; ++__first1, ++__first2) - if (!__binary_pred(*__first1, *__first2)) - return false; - return true; -} - -//-------------------------------------------------- -// lexicographical_compare and lexicographical_compare_3way. -// (the latter is not part of the C++ standard.) - -template -bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIter1>::value_type>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIter2>::value_type>); - - for ( ; __first1 != __last1 && __first2 != __last2 - ; ++__first1, ++__first2) { - if (*__first1 < *__first2) + template + inline unsigned char* + fill_n(unsigned char* __first, _Size __n, const unsigned char& __c) + { + fill(__first, __first + __n, __c); + return __first + __n; + } + + template + inline signed char* + fill_n(char* __first, _Size __n, const signed char& __c) + { + fill(__first, __first + __n, __c); + return __first + __n; + } + + template + inline char* + fill_n(char* __first, _Size __n, const char& __c) + { + fill(__first, __first + __n, __c); + return __first + __n; + } + + + //-------------------------------------------------- + // equal and mismatch + + template + pair<_InputIter1, _InputIter2> + mismatch(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_EqualityComparableConcept< + typename iterator_traits<_InputIter1>::value_type>); + __glibcpp_function_requires(_EqualityComparableConcept< + typename iterator_traits<_InputIter2>::value_type>); + + while (__first1 != __last1 && *__first1 == *__first2) { + ++__first1; + ++__first2; + } + return pair<_InputIter1, _InputIter2>(__first1, __first2); + } + + template + pair<_InputIter1, _InputIter2> + mismatch(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, + _BinaryPredicate __binary_pred) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + + while (__first1 != __last1 && __binary_pred(*__first1, *__first2)) { + ++__first1; + ++__first2; + } + return pair<_InputIter1, _InputIter2>(__first1, __first2); + } + + template + inline bool + equal(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_EqualOpConcept< + typename iterator_traits<_InputIter1>::value_type, + typename iterator_traits<_InputIter2>::value_type>); + + for ( ; __first1 != __last1; ++__first1, ++__first2) + if (!(*__first1 == *__first2)) + return false; return true; - if (*__first2 < *__first1) - return false; - } - return __first1 == __last1 && __first2 != __last2; -} - -template -bool lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2, - _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - - for ( ; __first1 != __last1 && __first2 != __last2 - ; ++__first1, ++__first2) { - if (__comp(*__first1, *__first2)) + } + + template + inline bool + equal(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, + _BinaryPredicate __binary_pred) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + + for ( ; __first1 != __last1; ++__first1, ++__first2) + if (!__binary_pred(*__first1, *__first2)) + return false; return true; - if (__comp(*__first2, *__first1)) - return false; + } + + //-------------------------------------------------- + // lexicographical_compare and lexicographical_compare_3way. + // (the latter is not part of the C++ standard.) + + template + bool + lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_InputIter1>::value_type>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_InputIter2>::value_type>); + + for ( ; __first1 != __last1 && __first2 != __last2 + ; ++__first1, ++__first2) { + if (*__first1 < *__first2) + return true; + if (*__first2 < *__first1) + return false; + } + return __first1 == __last1 && __first2 != __last2; + } + + template + bool + lexicographical_compare(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2, + _Compare __comp) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + + for ( ; __first1 != __last1 && __first2 != __last2 + ; ++__first1, ++__first2) { + if (__comp(*__first1, *__first2)) + return true; + if (__comp(*__first2, *__first1)) + return false; + } + return __first1 == __last1 && __first2 != __last2; + } + + inline bool + lexicographical_compare(const unsigned char* __first1, const unsigned char* __last1, + const unsigned char* __first2, const unsigned char* __last2) + { + const size_t __len1 = __last1 - __first1; + const size_t __len2 = __last2 - __first2; + const int __result = memcmp(__first1, __first2, min(__len1, __len2)); + return __result != 0 ? __result < 0 : __len1 < __len2; } - return __first1 == __last1 && __first2 != __last2; -} - -inline bool -lexicographical_compare(const unsigned char* __first1, - const unsigned char* __last1, - const unsigned char* __first2, - const unsigned char* __last2) -{ - const size_t __len1 = __last1 - __first1; - const size_t __len2 = __last2 - __first2; - const int __result = memcmp(__first1, __first2, min(__len1, __len2)); - return __result != 0 ? __result < 0 : __len1 < __len2; -} - -inline bool lexicographical_compare(const char* __first1, const char* __last1, - const char* __first2, const char* __last2) -{ + + inline bool + lexicographical_compare(const char* __first1, const char* __last1, + const char* __first2, const char* __last2) + { #if CHAR_MAX == SCHAR_MAX - return lexicographical_compare((const signed char*) __first1, - (const signed char*) __last1, - (const signed char*) __first2, - (const signed char*) __last2); + return lexicographical_compare((const signed char*) __first1, + (const signed char*) __last1, + (const signed char*) __first2, + (const signed char*) __last2); #else /* CHAR_MAX == SCHAR_MAX */ - return lexicographical_compare((const unsigned char*) __first1, - (const unsigned char*) __last1, - (const unsigned char*) __first2, - (const unsigned char*) __last2); + return lexicographical_compare((const unsigned char*) __first1, + (const unsigned char*) __last1, + (const unsigned char*) __first2, + (const unsigned char*) __last2); #endif /* CHAR_MAX == SCHAR_MAX */ -} - -template -int __lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2) -{ - while (__first1 != __last1 && __first2 != __last2) { - if (*__first1 < *__first2) - return -1; - if (*__first2 < *__first1) - return 1; - ++__first1; - ++__first2; - } - if (__first2 == __last2) { - return !(__first1 == __last1); } - else { - return -1; + + template + int + __lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2) + { + while (__first1 != __last1 && __first2 != __last2) { + if (*__first1 < *__first2) + return -1; + if (*__first2 < *__first1) + return 1; + ++__first1; + ++__first2; + } + if (__first2 == __last2) { + return !(__first1 == __last1); + } + else { + return -1; + } + } + + inline int + __lexicographical_compare_3way(const unsigned char* __first1, + const unsigned char* __last1, + const unsigned char* __first2, + const unsigned char* __last2) + { + const ptrdiff_t __len1 = __last1 - __first1; + const ptrdiff_t __len2 = __last2 - __first2; + const int __result = memcmp(__first1, __first2, min(__len1, __len2)); + return __result != 0 ? __result + : (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1)); } -} -inline int -__lexicographical_compare_3way(const unsigned char* __first1, - const unsigned char* __last1, - const unsigned char* __first2, - const unsigned char* __last2) -{ - const ptrdiff_t __len1 = __last1 - __first1; - const ptrdiff_t __len2 = __last2 - __first2; - const int __result = memcmp(__first1, __first2, min(__len1, __len2)); - return __result != 0 ? __result - : (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1)); -} - -inline int -__lexicographical_compare_3way(const char* __first1, const char* __last1, - const char* __first2, const char* __last2) -{ + inline int + __lexicographical_compare_3way(const char* __first1, const char* __last1, + const char* __first2, const char* __last2) + { #if CHAR_MAX == SCHAR_MAX - return __lexicographical_compare_3way( - (const signed char*) __first1, - (const signed char*) __last1, - (const signed char*) __first2, - (const signed char*) __last2); + return __lexicographical_compare_3way( + (const signed char*) __first1, + (const signed char*) __last1, + (const signed char*) __first2, + (const signed char*) __last2); #else - return __lexicographical_compare_3way((const unsigned char*) __first1, - (const unsigned char*) __last1, - (const unsigned char*) __first2, - (const unsigned char*) __last2); + return __lexicographical_compare_3way((const unsigned char*) __first1, + (const unsigned char*) __last1, + (const unsigned char*) __first2, + (const unsigned char*) __last2); #endif -} + } -template -int lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIter1>::value_type>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_InputIter2>::value_type>); - - return __lexicographical_compare_3way(__first1, __last1, __first2, __last2); -} + template + int + lexicographical_compare_3way(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIter2>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_InputIter1>::value_type>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_InputIter2>::value_type>); + + return __lexicographical_compare_3way(__first1, __last1, __first2, __last2); + } } // namespace std diff --git a/libstdc++-v3/include/bits/stl_heap.h b/libstdc++-v3/include/bits/stl_heap.h index 20d0f000d1a..eebf2ca3b7e 100644 --- a/libstdc++-v3/include/bits/stl_heap.h +++ b/libstdc++-v3/include/bits/stl_heap.h @@ -62,277 +62,241 @@ namespace std { -// Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap. - -template -void -__push_heap(_RandomAccessIterator __first, - _Distance __holeIndex, _Distance __topIndex, _Tp __value) -{ - _Distance __parent = (__holeIndex - 1) / 2; - while (__holeIndex > __topIndex && *(__first + __parent) < __value) { - *(__first + __holeIndex) = *(__first + __parent); - __holeIndex = __parent; - __parent = (__holeIndex - 1) / 2; - } - *(__first + __holeIndex) = __value; -} - -template -inline void -__push_heap_aux(_RandomAccessIterator __first, - _RandomAccessIterator __last, _Distance*, _Tp*) -{ - __push_heap(__first, _Distance((__last - __first) - 1), _Distance(0), - _Tp(*(__last - 1))); -} - -template -inline void -push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_RandomAccessIterator>::value_type>); - - __push_heap_aux(__first, __last, - __distance_type(__first), __value_type(__first)); -} - -template -void -__push_heap(_RandomAccessIterator __first, _Distance __holeIndex, - _Distance __topIndex, _Tp __value, _Compare __comp) -{ - _Distance __parent = (__holeIndex - 1) / 2; - while (__holeIndex > __topIndex && __comp(*(__first + __parent), __value)) { - *(__first + __holeIndex) = *(__first + __parent); - __holeIndex = __parent; - __parent = (__holeIndex - 1) / 2; - } - *(__first + __holeIndex) = __value; -} - -template -inline void -__push_heap_aux(_RandomAccessIterator __first, - _RandomAccessIterator __last, _Compare __comp, - _Distance*, _Tp*) -{ - __push_heap(__first, _Distance((__last - __first) - 1), _Distance(0), - _Tp(*(__last - 1)), __comp); -} - -template -inline void -push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, - _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>); - - __push_heap_aux(__first, __last, __comp, - __distance_type(__first), __value_type(__first)); -} - -template -void -__adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex, - _Distance __len, _Tp __value) -{ - _Distance __topIndex = __holeIndex; - _Distance __secondChild = 2 * __holeIndex + 2; - while (__secondChild < __len) { - if (*(__first + __secondChild) < *(__first + (__secondChild - 1))) - __secondChild--; - *(__first + __holeIndex) = *(__first + __secondChild); - __holeIndex = __secondChild; - __secondChild = 2 * (__secondChild + 1); - } - if (__secondChild == __len) { - *(__first + __holeIndex) = *(__first + (__secondChild - 1)); - __holeIndex = __secondChild - 1; - } - __push_heap(__first, __holeIndex, __topIndex, __value); -} - -template -inline void -__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, - _RandomAccessIterator __result, _Tp __value, _Distance*) -{ - *__result = *__first; - __adjust_heap(__first, _Distance(0), _Distance(__last - __first), __value); -} - -template -inline void -__pop_heap_aux(_RandomAccessIterator __first, _RandomAccessIterator __last, - _Tp*) -{ - __pop_heap(__first, __last - 1, __last - 1, - _Tp(*(__last - 1)), __distance_type(__first)); -} - -template -inline void pop_heap(_RandomAccessIterator __first, - _RandomAccessIterator __last) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_RandomAccessIterator>::value_type>); - - __pop_heap_aux(__first, __last, __value_type(__first)); -} - -template -void -__adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex, - _Distance __len, _Tp __value, _Compare __comp) -{ - _Distance __topIndex = __holeIndex; - _Distance __secondChild = 2 * __holeIndex + 2; - while (__secondChild < __len) { - if (__comp(*(__first + __secondChild), *(__first + (__secondChild - 1)))) - __secondChild--; - *(__first + __holeIndex) = *(__first + __secondChild); - __holeIndex = __secondChild; - __secondChild = 2 * (__secondChild + 1); - } - if (__secondChild == __len) { - *(__first + __holeIndex) = *(__first + (__secondChild - 1)); - __holeIndex = __secondChild - 1; - } - __push_heap(__first, __holeIndex, __topIndex, __value, __comp); -} - -template -inline void -__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, - _RandomAccessIterator __result, _Tp __value, _Compare __comp, - _Distance*) -{ - *__result = *__first; - __adjust_heap(__first, _Distance(0), _Distance(__last - __first), - __value, __comp); -} - -template -inline void -__pop_heap_aux(_RandomAccessIterator __first, - _RandomAccessIterator __last, _Tp*, _Compare __comp) -{ - __pop_heap(__first, __last - 1, __last - 1, _Tp(*(__last - 1)), __comp, - __distance_type(__first)); -} - -template -inline void -pop_heap(_RandomAccessIterator __first, - _RandomAccessIterator __last, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>); - - __pop_heap_aux(__first, __last, __value_type(__first), __comp); -} - -template -void -__make_heap(_RandomAccessIterator __first, - _RandomAccessIterator __last, _Tp*, _Distance*) -{ - if (__last - __first < 2) return; - _Distance __len = __last - __first; - _Distance __parent = (__len - 2)/2; - - while (true) { - __adjust_heap(__first, __parent, __len, _Tp(*(__first + __parent))); - if (__parent == 0) return; - __parent--; - } -} - -template -inline void -make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_RandomAccessIterator>::value_type>); - - __make_heap(__first, __last, - __value_type(__first), __distance_type(__first)); -} - -template -void -__make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, - _Compare __comp, _Tp*, _Distance*) -{ - if (__last - __first < 2) return; - _Distance __len = __last - __first; - _Distance __parent = (__len - 2)/2; - - while (true) { - __adjust_heap(__first, __parent, __len, _Tp(*(__first + __parent)), - __comp); - if (__parent == 0) return; - __parent--; - } -} - -template -inline void -make_heap(_RandomAccessIterator __first, - _RandomAccessIterator __last, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>); - - __make_heap(__first, __last, __comp, - __value_type(__first), __distance_type(__first)); -} - -template -void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>); - __glibcpp_function_requires(_LessThanComparableConcept< - typename iterator_traits<_RandomAccessIterator>::value_type>); - - while (__last - __first > 1) - pop_heap(__first, __last--); -} - -template -void -sort_heap(_RandomAccessIterator __first, - _RandomAccessIterator __last, _Compare __comp) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< - _RandomAccessIterator>); - - while (__last - __first > 1) - pop_heap(__first, __last--, __comp); -} + // Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap. + + template + void + __push_heap(_RandomAccessIterator __first, + _Distance __holeIndex, _Distance __topIndex, _Tp __value) + { + _Distance __parent = (__holeIndex - 1) / 2; + while (__holeIndex > __topIndex && *(__first + __parent) < __value) { + *(__first + __holeIndex) = *(__first + __parent); + __holeIndex = __parent; + __parent = (__holeIndex - 1) / 2; + } + *(__first + __holeIndex) = __value; + } + + template + inline void + push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) + { + typedef typename iterator_traits<_RandomAccessIterator>::value_type + _ValueType; + typedef typename iterator_traits<_RandomAccessIterator>::difference_type + _DistanceType; + + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIterator>); + __glibcpp_function_requires(_LessThanComparableConcept<_ValueType>); + + __push_heap(__first, _DistanceType((__last - __first) - 1), _DistanceType(0), + _ValueType(*(__last - 1))); + } + + template + void + __push_heap(_RandomAccessIterator __first, _Distance __holeIndex, + _Distance __topIndex, _Tp __value, _Compare __comp) + { + _Distance __parent = (__holeIndex - 1) / 2; + while (__holeIndex > __topIndex && __comp(*(__first + __parent), __value)) { + *(__first + __holeIndex) = *(__first + __parent); + __holeIndex = __parent; + __parent = (__holeIndex - 1) / 2; + } + *(__first + __holeIndex) = __value; + } + + template + inline void + push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, + _Compare __comp) + { + typedef typename iterator_traits<_RandomAccessIterator>::value_type + _ValueType; + typedef typename iterator_traits<_RandomAccessIterator>::difference_type + _DistanceType; + + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIterator>); + + __push_heap(__first, _DistanceType((__last - __first) - 1), _DistanceType(0), + _ValueType(*(__last - 1)), __comp); + } + + template + void + __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex, + _Distance __len, _Tp __value) + { + _Distance __topIndex = __holeIndex; + _Distance __secondChild = 2 * __holeIndex + 2; + while (__secondChild < __len) { + if (*(__first + __secondChild) < *(__first + (__secondChild - 1))) + __secondChild--; + *(__first + __holeIndex) = *(__first + __secondChild); + __holeIndex = __secondChild; + __secondChild = 2 * (__secondChild + 1); + } + if (__secondChild == __len) { + *(__first + __holeIndex) = *(__first + (__secondChild - 1)); + __holeIndex = __secondChild - 1; + } + __push_heap(__first, __holeIndex, __topIndex, __value); + } + + template + inline void + __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, + _RandomAccessIterator __result, _Tp __value) + { + typedef typename iterator_traits<_RandomAccessIterator>::difference_type _Distance; + *__result = *__first; + __adjust_heap(__first, _Distance(0), _Distance(__last - __first), __value); + } + + template + inline void + pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) + { + typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; + + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIterator>); + __glibcpp_function_requires(_LessThanComparableConcept<_ValueType>); + + __pop_heap(__first, __last - 1, __last - 1, _ValueType(*(__last - 1))); + } + + template + void + __adjust_heap(_RandomAccessIterator __first, _Distance __holeIndex, + _Distance __len, _Tp __value, _Compare __comp) + { + _Distance __topIndex = __holeIndex; + _Distance __secondChild = 2 * __holeIndex + 2; + while (__secondChild < __len) { + if (__comp(*(__first + __secondChild), *(__first + (__secondChild - 1)))) + __secondChild--; + *(__first + __holeIndex) = *(__first + __secondChild); + __holeIndex = __secondChild; + __secondChild = 2 * (__secondChild + 1); + } + if (__secondChild == __len) { + *(__first + __holeIndex) = *(__first + (__secondChild - 1)); + __holeIndex = __secondChild - 1; + } + __push_heap(__first, __holeIndex, __topIndex, __value, __comp); + } + + template + inline void + __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, + _RandomAccessIterator __result, _Tp __value, _Compare __comp) + { + typedef typename iterator_traits<_RandomAccessIterator>::difference_type _Distance; + *__result = *__first; + __adjust_heap(__first, _Distance(0), _Distance(__last - __first), + __value, __comp); + } + + template + inline void + pop_heap(_RandomAccessIterator __first, + _RandomAccessIterator __last, _Compare __comp) + { + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIterator>); + + typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; + __pop_heap(__first, __last - 1, __last - 1, _ValueType(*(__last - 1)), __comp); + } + + template + void + make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) + { + typedef typename iterator_traits<_RandomAccessIterator>::value_type + _ValueType; + typedef typename iterator_traits<_RandomAccessIterator>::difference_type + _DistanceType; + + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIterator>); + __glibcpp_function_requires(_LessThanComparableConcept<_ValueType>); + + if (__last - __first < 2) return; + _DistanceType __len = __last - __first; + _DistanceType __parent = (__len - 2)/2; + + while (true) { + __adjust_heap(__first, __parent, __len, _ValueType(*(__first + __parent))); + if (__parent == 0) return; + __parent--; + } + } + + template + inline void + make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, + _Compare __comp) + { + typedef typename iterator_traits<_RandomAccessIterator>::value_type + _ValueType; + typedef typename iterator_traits<_RandomAccessIterator>::difference_type + _DistanceType; + + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIterator>); + + if (__last - __first < 2) return; + _DistanceType __len = __last - __first; + _DistanceType __parent = (__len - 2)/2; + + while (true) { + __adjust_heap(__first, __parent, __len, + _ValueType(*(__first + __parent)), __comp); + if (__parent == 0) return; + __parent--; + } + } + + template + void + sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last) + { + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIterator>); + __glibcpp_function_requires(_LessThanComparableConcept< + typename iterator_traits<_RandomAccessIterator>::value_type>); + + while (__last - __first > 1) + pop_heap(__first, __last--); + } + + template + void + sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, + _Compare __comp) + { + // concept requirements + __glibcpp_function_requires(_Mutable_RandomAccessIteratorConcept< + _RandomAccessIterator>); + + while (__last - __first > 1) + pop_heap(__first, __last--, __comp); + } } // namespace std diff --git a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h index 5d3816fa839..97eb8b5208d 100644 --- a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h +++ b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h @@ -71,105 +71,107 @@ namespace std { -// There are two signatures for distance. In addition to the one taking -// two iterators and returning a result, there is another taking two -// iterators and a reference-to-result variable, and returning nothing. -// The latter seems to be an SGI extension. -- pedwards -template -inline void __distance(_InputIterator __first, _InputIterator __last, - _Distance& __n, input_iterator_tag) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); - while (__first != __last) { ++__first; ++__n; } -} - -template -inline void __distance(_RandomAccessIterator __first, - _RandomAccessIterator __last, - _Distance& __n, random_access_iterator_tag) -{ - // concept requirements - __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>); - __n += __last - __first; -} - -template -inline void distance(_InputIterator __first, - _InputIterator __last, _Distance& __n) -{ - // concept requirements -- taken care of in __distance - __distance(__first, __last, __n, iterator_category(__first)); -} - -template -inline typename iterator_traits<_InputIterator>::difference_type -__distance(_InputIterator __first, _InputIterator __last, input_iterator_tag) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); - typename iterator_traits<_InputIterator>::difference_type __n = 0; - while (__first != __last) { - ++__first; ++__n; - } - return __n; -} - -template -inline typename iterator_traits<_RandomAccessIterator>::difference_type -__distance(_RandomAccessIterator __first, _RandomAccessIterator __last, - random_access_iterator_tag) -{ - // concept requirements - __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>); - return __last - __first; -} - -template -inline typename iterator_traits<_InputIterator>::difference_type -distance(_InputIterator __first, _InputIterator __last) -{ - // concept requirements -- taken care of in __distance - typedef typename iterator_traits<_InputIterator>::iterator_category - _Category; - return __distance(__first, __last, _Category()); -} - -template -inline void __advance(_InputIter& __i, _Distance __n, input_iterator_tag) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); - while (__n--) ++__i; -} - -template -inline void __advance(_BidirectionalIterator& __i, _Distance __n, - bidirectional_iterator_tag) -{ - // concept requirements -__glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIterator>); - if (__n > 0) - while (__n--) ++__i; - else - while (__n++) --__i; -} - -template -inline void __advance(_RandomAccessIterator& __i, _Distance __n, - random_access_iterator_tag) -{ - // concept requirements - __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>); - __i += __n; -} - -template -inline void advance(_InputIterator& __i, _Distance __n) -{ - // concept requirements -- taken care of in __advance - __advance(__i, __n, iterator_category(__i)); -} + // There are two signatures for distance. In addition to the one taking + // two iterators and returning a result, there is another taking two + // iterators and a reference-to-result variable, and returning nothing. + // The latter seems to be an SGI extension. -- pedwards + template + inline void + __distance(_InputIterator __first, _InputIterator __last, + _Distance& __n, input_iterator_tag) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); + while (__first != __last) { ++__first; ++__n; } + } + + template + inline void + __distance(_RandomAccessIterator __first, _RandomAccessIterator __last, + _Distance& __n, random_access_iterator_tag) + { + // concept requirements + __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>); + __n += __last - __first; + } + + template + inline void + distance(_InputIterator __first, _InputIterator __last, + _Distance& __n) + { + // concept requirements -- taken care of in __distance + __distance(__first, __last, __n, __iterator_category(__first)); + } + + template + inline typename iterator_traits<_InputIterator>::difference_type + __distance(_InputIterator __first, _InputIterator __last, input_iterator_tag) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); + typename iterator_traits<_InputIterator>::difference_type __n = 0; + while (__first != __last) { + ++__first; ++__n; + } + return __n; + } + + template + inline typename iterator_traits<_RandomAccessIterator>::difference_type + __distance(_RandomAccessIterator __first, _RandomAccessIterator __last, + random_access_iterator_tag) + { + // concept requirements + __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>); + return __last - __first; + } + + template + inline typename iterator_traits<_InputIterator>::difference_type + distance(_InputIterator __first, _InputIterator __last) + { + // concept requirements -- taken care of in __distance + return __distance(__first, __last, __iterator_category(__first)); + } + + template + inline void + __advance(_InputIter& __i, _Distance __n, input_iterator_tag) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIter>); + while (__n--) ++__i; + } + + template + inline void + __advance(_BidirectionalIterator& __i, _Distance __n, bidirectional_iterator_tag) + { + // concept requirements + __glibcpp_function_requires(_BidirectionalIteratorConcept<_BidirectionalIterator>); + if (__n > 0) + while (__n--) ++__i; + else + while (__n++) --__i; + } + + template + inline void + __advance(_RandomAccessIterator& __i, _Distance __n, random_access_iterator_tag) + { + // concept requirements + __glibcpp_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>); + __i += __n; + } + + template + inline void + advance(_InputIterator& __i, _Distance __n) + { + // concept requirements -- taken care of in __advance + __advance(__i, __n, __iterator_category(__i)); + } } // namespace std diff --git a/libstdc++-v3/include/bits/stl_iterator_base_types.h b/libstdc++-v3/include/bits/stl_iterator_base_types.h index a5539d1495d..bb6b8ead924 100644 --- a/libstdc++-v3/include/bits/stl_iterator_base_types.h +++ b/libstdc++-v3/include/bits/stl_iterator_base_types.h @@ -67,142 +67,108 @@ #pragma GCC system_header -#include // for ptrdiff_t - - namespace std { -struct input_iterator_tag {}; -struct output_iterator_tag {}; -struct forward_iterator_tag : public input_iterator_tag {}; -struct bidirectional_iterator_tag : public forward_iterator_tag {}; -struct random_access_iterator_tag : public bidirectional_iterator_tag {}; - -// The base classes input_iterator, output_iterator, forward_iterator, -// bidirectional_iterator, and random_access_iterator are not part of -// the C++ standard. (They have been replaced by struct iterator.) -// They are included for backward compatibility with the HP STL. - -template struct input_iterator { - typedef input_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _Distance difference_type; - typedef _Tp* pointer; - typedef _Tp& reference; -}; - -struct output_iterator { - typedef output_iterator_tag iterator_category; - typedef void value_type; - typedef void difference_type; - typedef void pointer; - typedef void reference; -}; - -template struct forward_iterator { - typedef forward_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _Distance difference_type; - typedef _Tp* pointer; - typedef _Tp& reference; -}; - - -template struct bidirectional_iterator { - typedef bidirectional_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _Distance difference_type; - typedef _Tp* pointer; - typedef _Tp& reference; -}; - -template struct random_access_iterator { - typedef random_access_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _Distance difference_type; - typedef _Tp* pointer; - typedef _Tp& reference; -}; - -template -struct iterator { - typedef _Category iterator_category; - typedef _Tp value_type; - typedef _Distance difference_type; - typedef _Pointer pointer; - typedef _Reference reference; -}; - -template -struct iterator_traits { - typedef typename _Iterator::iterator_category iterator_category; - typedef typename _Iterator::value_type value_type; - typedef typename _Iterator::difference_type difference_type; - typedef typename _Iterator::pointer pointer; - typedef typename _Iterator::reference reference; -}; - -template -struct iterator_traits<_Tp*> { - typedef random_access_iterator_tag iterator_category; - typedef _Tp value_type; - typedef ptrdiff_t difference_type; - typedef _Tp* pointer; - typedef _Tp& reference; -}; - -template -struct iterator_traits { - typedef random_access_iterator_tag iterator_category; - typedef _Tp value_type; - typedef ptrdiff_t difference_type; - typedef const _Tp* pointer; - typedef const _Tp& reference; -}; - -// The overloaded functions iterator_category, distance_type, and -// value_type are not part of the C++ standard. (They have been -// replaced by struct iterator_traits.) They are included for -// backward compatibility with the HP STL. - -// We introduce internal names for these functions. - -template -inline typename iterator_traits<_Iter>::iterator_category -__iterator_category(const _Iter&) -{ - typedef typename iterator_traits<_Iter>::iterator_category _Category; - return _Category(); -} - -template -inline typename iterator_traits<_Iter>::difference_type* -__distance_type(const _Iter&) -{ - return static_cast::difference_type*>(0); -} - -template -inline typename iterator_traits<_Iter>::value_type* -__value_type(const _Iter&) -{ - return static_cast::value_type*>(0); -} - -template -inline typename iterator_traits<_Iter>::iterator_category -iterator_category(const _Iter& __i) { return __iterator_category(__i); } - - -template -inline typename iterator_traits<_Iter>::difference_type* -distance_type(const _Iter& __i) { return __distance_type(__i); } - -template -inline typename iterator_traits<_Iter>::value_type* -value_type(const _Iter& __i) { return __value_type(__i); } + struct input_iterator_tag {}; + struct output_iterator_tag {}; + struct forward_iterator_tag : public input_iterator_tag {}; + struct bidirectional_iterator_tag : public forward_iterator_tag {}; + struct random_access_iterator_tag : public bidirectional_iterator_tag {}; + + // The base classes input_iterator, output_iterator, forward_iterator, + // bidirectional_iterator, and random_access_iterator are not part of + // the C++ standard. (They have been replaced by struct iterator.) + // They are included for backward compatibility with the HP STL. + + template + struct input_iterator { + typedef input_iterator_tag iterator_category; + typedef _Tp value_type; + typedef _Distance difference_type; + typedef _Tp* pointer; + typedef _Tp& reference; + }; + + struct output_iterator { + typedef output_iterator_tag iterator_category; + typedef void value_type; + typedef void difference_type; + typedef void pointer; + typedef void reference; + }; + + template + struct forward_iterator { + typedef forward_iterator_tag iterator_category; + typedef _Tp value_type; + typedef _Distance difference_type; + typedef _Tp* pointer; + typedef _Tp& reference; + }; + + template + struct bidirectional_iterator { + typedef bidirectional_iterator_tag iterator_category; + typedef _Tp value_type; + typedef _Distance difference_type; + typedef _Tp* pointer; + typedef _Tp& reference; + }; + + template + struct random_access_iterator { + typedef random_access_iterator_tag iterator_category; + typedef _Tp value_type; + typedef _Distance difference_type; + typedef _Tp* pointer; + typedef _Tp& reference; + }; + + template + struct iterator { + typedef _Category iterator_category; + typedef _Tp value_type; + typedef _Distance difference_type; + typedef _Pointer pointer; + typedef _Reference reference; + }; + + template + struct iterator_traits { + typedef typename _Iterator::iterator_category iterator_category; + typedef typename _Iterator::value_type value_type; + typedef typename _Iterator::difference_type difference_type; + typedef typename _Iterator::pointer pointer; + typedef typename _Iterator::reference reference; + }; + + template + struct iterator_traits<_Tp*> { + typedef random_access_iterator_tag iterator_category; + typedef _Tp value_type; + typedef ptrdiff_t difference_type; + typedef _Tp* pointer; + typedef _Tp& reference; + }; + + template + struct iterator_traits { + typedef random_access_iterator_tag iterator_category; + typedef _Tp value_type; + typedef ptrdiff_t difference_type; + typedef const _Tp* pointer; + typedef const _Tp& reference; + }; + + // This function is not a part of the C++ standard but is syntactic + // sugar for internal library use only. + + template + inline typename iterator_traits<_Iter>::iterator_category + __iterator_category(const _Iter&) + { return typename iterator_traits<_Iter>::iterator_category(); } } // namespace std diff --git a/libstdc++-v3/include/bits/stl_numeric.h b/libstdc++-v3/include/bits/stl_numeric.h index 500a2653c6b..868143189c8 100644 --- a/libstdc++-v3/include/bits/stl_numeric.h +++ b/libstdc++-v3/include/bits/stl_numeric.h @@ -64,240 +64,208 @@ namespace std { -template -_Tp accumulate(_InputIterator __first, _InputIterator __last, _Tp __init) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); - - for ( ; __first != __last; ++__first) - __init = __init + *__first; - return __init; -} - -template -_Tp accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, - _BinaryOperation __binary_op) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); + template + _Tp + accumulate(_InputIterator __first, _InputIterator __last, _Tp __init) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); + + for ( ; __first != __last; ++__first) + __init = __init + *__first; + return __init; + } - for ( ; __first != __last; ++__first) - __init = __binary_op(__init, *__first); - return __init; -} + template + _Tp + accumulate(_InputIterator __first, _InputIterator __last, _Tp __init, + _BinaryOperation __binary_op) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); + + for ( ; __first != __last; ++__first) + __init = __binary_op(__init, *__first); + return __init; + } -template -_Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _Tp __init) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>); - - for ( ; __first1 != __last1; ++__first1, ++__first2) - __init = __init + (*__first1 * *__first2); - return __init; -} - -template -_Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1, - _InputIterator2 __first2, _Tp __init, - _BinaryOperation1 __binary_op1, - _BinaryOperation2 __binary_op2) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>); - __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>); - - for ( ; __first1 != __last1; ++__first1, ++__first2) - __init = __binary_op1(__init, __binary_op2(*__first1, *__first2)); - return __init; -} - -template -_OutputIterator -__partial_sum(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, _Tp*) -{ - _Tp __value = *__first; - while (++__first != __last) { - __value = __value + *__first; - *++__result = __value; - } - return ++__result; -} - -template -_OutputIterator -partial_sum(_InputIterator __first, _InputIterator __last, - _OutputIterator __result) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator>::value_type>); - - if (__first == __last) return __result; - *__result = *__first; - return __partial_sum(__first, __last, __result, __value_type(__first)); -} - -template -_OutputIterator -__partial_sum(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, _Tp*, _BinaryOperation __binary_op) -{ - _Tp __value = *__first; - while (++__first != __last) { - __value = __binary_op(__value, *__first); - *++__result = __value; - } - return ++__result; -} - -template -_OutputIterator -partial_sum(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, _BinaryOperation __binary_op) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator>::value_type>); - - if (__first == __last) return __result; - *__result = *__first; - return __partial_sum(__first, __last, __result, __value_type(__first), - __binary_op); -} - -template -_OutputIterator -__adjacent_difference(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, _Tp*) -{ - _Tp __value = *__first; - while (++__first != __last) { - _Tp __tmp = *__first; - *++__result = __tmp - __value; - __value = __tmp; - } - return ++__result; -} - -template -_OutputIterator -adjacent_difference(_InputIterator __first, - _InputIterator __last, _OutputIterator __result) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator>::value_type>); - - if (__first == __last) return __result; - *__result = *__first; - return __adjacent_difference(__first, __last, __result, - __value_type(__first)); -} - -template -_OutputIterator -__adjacent_difference(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, _Tp*, - _BinaryOperation __binary_op) { - _Tp __value = *__first; - while (++__first != __last) { - _Tp __tmp = *__first; - *++__result = __binary_op(__tmp, __value); - __value = __tmp; - } - return ++__result; -} - -template -_OutputIterator -adjacent_difference(_InputIterator __first, _InputIterator __last, - _OutputIterator __result, _BinaryOperation __binary_op) -{ - // concept requirements - __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); - __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator, - typename iterator_traits<_InputIterator>::value_type>); - - if (__first == __last) return __result; - *__result = *__first; - return __adjacent_difference(__first, __last, __result, - __value_type(__first), - __binary_op); -} - -// Returns __x ** __n, where __n >= 0. _Note that "multiplication" -// is required to be associative, but not necessarily commutative. - - -template -_Tp __power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op) -{ - if (__n == 0) - return identity_element(__monoid_op); - else { - while ((__n & 1) == 0) { - __n >>= 1; - __x = __monoid_op(__x, __x); + template + _Tp + inner_product(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _Tp __init) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>); + + for ( ; __first1 != __last1; ++__first1, ++__first2) + __init = __init + (*__first1 * *__first2); + return __init; } - _Tp __result = __x; - __n >>= 1; - while (__n != 0) { - __x = __monoid_op(__x, __x); - if ((__n & 1) != 0) - __result = __monoid_op(__result, __x); - __n >>= 1; + template + _Tp + inner_product(_InputIterator1 __first1, _InputIterator1 __last1, + _InputIterator2 __first2, _Tp __init, + _BinaryOperation1 __binary_op1, + _BinaryOperation2 __binary_op2) + { + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIterator1>); + __glibcpp_function_requires(_InputIteratorConcept<_InputIterator2>); + + for ( ; __first1 != __last1; ++__first1, ++__first2) + __init = __binary_op1(__init, __binary_op2(*__first1, *__first2)); + return __init; } - return __result; - } -} -template -inline _Tp __power(_Tp __x, _Integer __n) -{ - return __power(__x, __n, multiplies<_Tp>()); -} + template + _OutputIterator + partial_sum(_InputIterator __first, _InputIterator __last, + _OutputIterator __result) + { + typedef typename iterator_traits<_InputIterator>::value_type _ValueType; + + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>); + + if (__first == __last) return __result; + *__result = *__first; + _ValueType __value = *__first; + while (++__first != __last) { + __value = __value + *__first; + *++__result = __value; + } + return ++__result; + } -// Alias for the internal name __power. Note that power is an extension, -// not part of the C++ standard. + template + _OutputIterator + partial_sum(_InputIterator __first, _InputIterator __last, + _OutputIterator __result, _BinaryOperation __binary_op) + { + typedef typename iterator_traits<_InputIterator>::value_type _ValueType; + + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>); + + if (__first == __last) return __result; + *__result = *__first; + _ValueType __value = *__first; + while (++__first != __last) { + __value = __binary_op(__value, *__first); + *++__result = __value; + } + return ++__result; + } -template -inline _Tp power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op) -{ - return __power(__x, __n, __monoid_op); -} + template + _OutputIterator + adjacent_difference(_InputIterator __first, + _InputIterator __last, _OutputIterator __result) + { + typedef typename iterator_traits<_InputIterator>::value_type _ValueType; + + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>); + + if (__first == __last) return __result; + *__result = *__first; + _ValueType __value = *__first; + while (++__first != __last) { + _ValueType __tmp = *__first; + *++__result = __tmp - __value; + __value = __tmp; + } + return ++__result; + } -template -inline _Tp power(_Tp __x, _Integer __n) -{ - return __power(__x, __n); -} + template + _OutputIterator + adjacent_difference(_InputIterator __first, _InputIterator __last, + _OutputIterator __result, _BinaryOperation __binary_op) + { + typedef typename iterator_traits<_InputIterator>::value_type _ValueType; + + // concept requirements + __glibcpp_function_requires(_InputIteratorConcept<_InputIterator>); + __glibcpp_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>); + + if (__first == __last) return __result; + *__result = *__first; + _ValueType __value = *__first; + while (++__first != __last) { + _ValueType __tmp = *__first; + *++__result = __binary_op(__tmp, __value); + __value = __tmp; + } + return ++__result; + } -// iota is not part of the C++ standard. It is an extension. + // Returns __x ** __n, where __n >= 0. _Note that "multiplication" + // is required to be associative, but not necessarily commutative. + + + template + _Tp + __power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op) + { + if (__n == 0) + return identity_element(__monoid_op); + else { + while ((__n & 1) == 0) { + __n >>= 1; + __x = __monoid_op(__x, __x); + } + + _Tp __result = __x; + __n >>= 1; + while (__n != 0) { + __x = __monoid_op(__x, __x); + if ((__n & 1) != 0) + __result = __monoid_op(__result, __x); + __n >>= 1; + } + return __result; + } + } -template -void -iota(_ForwardIter __first, _ForwardIter __last, _Tp __value) -{ - // concept requirements - __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); - __glibcpp_function_requires(_ConvertibleConcept<_Tp, - typename iterator_traits<_ForwardIter>::value_type>); - - while (__first != __last) - *__first++ = __value++; -} + template + inline _Tp + __power(_Tp __x, _Integer __n) + { return __power(__x, __n, multiplies<_Tp>()); } + + // Alias for the internal name __power. Note that power is an extension, + // not part of the C++ standard. + + template + inline _Tp + power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op) + { return __power(__x, __n, __monoid_op); } + + template + inline _Tp + power(_Tp __x, _Integer __n) + { return __power(__x, __n); } + + // iota is not part of the C++ standard. It is an extension. + + template + void + iota(_ForwardIter __first, _ForwardIter __last, _Tp __value) + { + // concept requirements + __glibcpp_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIter>); + __glibcpp_function_requires(_ConvertibleConcept<_Tp, + typename iterator_traits<_ForwardIter>::value_type>); + + while (__first != __last) + *__first++ = __value++; + } } // namespace std diff --git a/libstdc++-v3/include/bits/stl_uninitialized.h b/libstdc++-v3/include/bits/stl_uninitialized.h index f4dbac48f17..f62364098bf 100644 --- a/libstdc++-v3/include/bits/stl_uninitialized.h +++ b/libstdc++-v3/include/bits/stl_uninitialized.h @@ -65,242 +65,214 @@ namespace std { -// uninitialized_copy - -// Valid if copy construction is equivalent to assignment, and if the -// destructor is trivial. -template -inline _ForwardIter -__uninitialized_copy_aux(_InputIter __first, _InputIter __last, - _ForwardIter __result, - __true_type) -{ - return copy(__first, __last, __result); -} - -template -_ForwardIter -__uninitialized_copy_aux(_InputIter __first, _InputIter __last, - _ForwardIter __result, - __false_type) -{ - _ForwardIter __cur = __result; - __STL_TRY { - for ( ; __first != __last; ++__first, ++__cur) - _Construct(&*__cur, *__first); - return __cur; + // uninitialized_copy + + template + inline _ForwardIter + __uninitialized_copy_aux(_InputIter __first, _InputIter __last, + _ForwardIter __result, + __true_type) + { return copy(__first, __last, __result); } + + template + _ForwardIter + __uninitialized_copy_aux(_InputIter __first, _InputIter __last, + _ForwardIter __result, + __false_type) + { + _ForwardIter __cur = __result; + __STL_TRY { + for ( ; __first != __last; ++__first, ++__cur) + _Construct(&*__cur, *__first); + return __cur; + } + __STL_UNWIND(_Destroy(__result, __cur)); + } + + template + inline _ForwardIter + uninitialized_copy(_InputIter __first, _InputIter __last, _ForwardIter __result) + { + typedef typename iterator_traits<_InputIter>::value_type _ValueType; + typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD; + return __uninitialized_copy_aux(__first, __last, __result, _Is_POD()); + } + + inline char* + uninitialized_copy(const char* __first, const char* __last, char* __result) + { + memmove(__result, __first, __last - __first); + return __result + (__last - __first); } - __STL_UNWIND(_Destroy(__result, __cur)); -} - - -template -inline _ForwardIter -__uninitialized_copy(_InputIter __first, _InputIter __last, - _ForwardIter __result, _Tp*) -{ - typedef typename __type_traits<_Tp>::is_POD_type _Is_POD; - return __uninitialized_copy_aux(__first, __last, __result, _Is_POD()); -} - -template -inline _ForwardIter - uninitialized_copy(_InputIter __first, _InputIter __last, - _ForwardIter __result) -{ - return __uninitialized_copy(__first, __last, __result, - __value_type(__result)); -} - -inline char* uninitialized_copy(const char* __first, const char* __last, - char* __result) { - memmove(__result, __first, __last - __first); - return __result + (__last - __first); -} - -inline wchar_t* -uninitialized_copy(const wchar_t* __first, const wchar_t* __last, - wchar_t* __result) -{ - memmove(__result, __first, sizeof(wchar_t) * (__last - __first)); - return __result + (__last - __first); -} - -// uninitialized_copy_n (not part of the C++ standard) -template -pair<_InputIter, _ForwardIter> -__uninitialized_copy_n(_InputIter __first, _Size __count, - _ForwardIter __result, - input_iterator_tag) -{ - _ForwardIter __cur = __result; - __STL_TRY { - for ( ; __count > 0 ; --__count, ++__first, ++__cur) - _Construct(&*__cur, *__first); - return pair<_InputIter, _ForwardIter>(__first, __cur); + inline wchar_t* + uninitialized_copy(const wchar_t* __first, const wchar_t* __last, + wchar_t* __result) + { + memmove(__result, __first, sizeof(wchar_t) * (__last - __first)); + return __result + (__last - __first); } - __STL_UNWIND(_Destroy(__result, __cur)); -} - -template -inline pair<_RandomAccessIter, _ForwardIter> -__uninitialized_copy_n(_RandomAccessIter __first, _Size __count, - _ForwardIter __result, - random_access_iterator_tag) { - _RandomAccessIter __last = __first + __count; - return pair<_RandomAccessIter, _ForwardIter>( - __last, - uninitialized_copy(__first, __last, __result)); -} - -template -inline pair<_InputIter, _ForwardIter> -__uninitialized_copy_n(_InputIter __first, _Size __count, - _ForwardIter __result) { - return __uninitialized_copy_n(__first, __count, __result, - __iterator_category(__first)); -} - -template -inline pair<_InputIter, _ForwardIter> -uninitialized_copy_n(_InputIter __first, _Size __count, - _ForwardIter __result) { - return __uninitialized_copy_n(__first, __count, __result, - __iterator_category(__first)); -} - -// Valid if copy construction is equivalent to assignment, and if the -// destructor is trivial. -template -inline void -__uninitialized_fill_aux(_ForwardIter __first, _ForwardIter __last, - const _Tp& __x, __true_type) -{ - fill(__first, __last, __x); -} -template -void -__uninitialized_fill_aux(_ForwardIter __first, _ForwardIter __last, - const _Tp& __x, __false_type) -{ - _ForwardIter __cur = __first; - __STL_TRY { - for ( ; __cur != __last; ++__cur) - _Construct(&*__cur, __x); - } - __STL_UNWIND(_Destroy(__first, __cur)); -} - -template -inline void __uninitialized_fill(_ForwardIter __first, - _ForwardIter __last, const _Tp& __x, _Tp1*) -{ - typedef typename __type_traits<_Tp1>::is_POD_type _Is_POD; - __uninitialized_fill_aux(__first, __last, __x, _Is_POD()); - -} - -template -inline void uninitialized_fill(_ForwardIter __first, - _ForwardIter __last, - const _Tp& __x) -{ - __uninitialized_fill(__first, __last, __x, __value_type(__first)); -} - -// Valid if copy construction is equivalent to assignment, and if the -// destructor is trivial. -template -inline _ForwardIter -__uninitialized_fill_n_aux(_ForwardIter __first, _Size __n, - const _Tp& __x, __true_type) -{ - return fill_n(__first, __n, __x); -} - -template -_ForwardIter -__uninitialized_fill_n_aux(_ForwardIter __first, _Size __n, - const _Tp& __x, __false_type) -{ - _ForwardIter __cur = __first; - __STL_TRY { - for ( ; __n > 0; --__n, ++__cur) - _Construct(&*__cur, __x); - return __cur; - } - __STL_UNWIND(_Destroy(__first, __cur)); -} - -template -inline _ForwardIter -__uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp& __x, _Tp1*) -{ - typedef typename __type_traits<_Tp1>::is_POD_type _Is_POD; - return __uninitialized_fill_n_aux(__first, __n, __x, _Is_POD()); -} - -template -inline _ForwardIter -uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp& __x) -{ - return __uninitialized_fill_n(__first, __n, __x, __value_type(__first)); -} - -// Extensions: __uninitialized_copy_copy, __uninitialized_copy_fill, -// __uninitialized_fill_copy. - -// __uninitialized_copy_copy -// Copies [first1, last1) into [result, result + (last1 - first1)), and -// copies [first2, last2) into -// [result, result + (last1 - first1) + (last2 - first2)). - -template -inline _ForwardIter -__uninitialized_copy_copy(_InputIter1 __first1, _InputIter1 __last1, - _InputIter2 __first2, _InputIter2 __last2, - _ForwardIter __result) -{ - _ForwardIter __mid = uninitialized_copy(__first1, __last1, __result); - __STL_TRY { - return uninitialized_copy(__first2, __last2, __mid); - } - __STL_UNWIND(_Destroy(__result, __mid)); -} - -// __uninitialized_fill_copy -// Fills [result, mid) with x, and copies [first, last) into -// [mid, mid + (last - first)). -template -inline _ForwardIter -__uninitialized_fill_copy(_ForwardIter __result, _ForwardIter __mid, - const _Tp& __x, - _InputIter __first, _InputIter __last) -{ - uninitialized_fill(__result, __mid, __x); - __STL_TRY { - return uninitialized_copy(__first, __last, __mid); - } - __STL_UNWIND(_Destroy(__result, __mid)); -} - -// __uninitialized_copy_fill -// Copies [first1, last1) into [first2, first2 + (last1 - first1)), and -// fills [first2 + (last1 - first1), last2) with x. -template -inline void -__uninitialized_copy_fill(_InputIter __first1, _InputIter __last1, - _ForwardIter __first2, _ForwardIter __last2, - const _Tp& __x) -{ - _ForwardIter __mid2 = uninitialized_copy(__first1, __last1, __first2); - __STL_TRY { - uninitialized_fill(__mid2, __last2, __x); - } - __STL_UNWIND(_Destroy(__first2, __mid2)); -} + // uninitialized_copy_n (not part of the C++ standard) + + template + pair<_InputIter, _ForwardIter> + __uninitialized_copy_n(_InputIter __first, _Size __count, + _ForwardIter __result, + input_iterator_tag) + { + _ForwardIter __cur = __result; + __STL_TRY { + for ( ; __count > 0 ; --__count, ++__first, ++__cur) + _Construct(&*__cur, *__first); + return pair<_InputIter, _ForwardIter>(__first, __cur); + } + __STL_UNWIND(_Destroy(__result, __cur)); + } + + template + inline pair<_RandomAccessIter, _ForwardIter> + __uninitialized_copy_n(_RandomAccessIter __first, _Size __count, + _ForwardIter __result, + random_access_iterator_tag) + { + _RandomAccessIter __last = __first + __count; + return pair<_RandomAccessIter, _ForwardIter>( + __last, + uninitialized_copy(__first, __last, __result)); + } + + template + inline pair<_InputIter, _ForwardIter> + __uninitialized_copy_n(_InputIter __first, _Size __count, + _ForwardIter __result) { + return __uninitialized_copy_n(__first, __count, __result, + __iterator_category(__first)); + } + + template + inline pair<_InputIter, _ForwardIter> + uninitialized_copy_n(_InputIter __first, _Size __count, + _ForwardIter __result) { + return __uninitialized_copy_n(__first, __count, __result, + __iterator_category(__first)); + } + + // Valid if copy construction is equivalent to assignment, and if the + // destructor is trivial. + template + inline void + __uninitialized_fill_aux(_ForwardIter __first, _ForwardIter __last, + const _Tp& __x, __true_type) + { fill(__first, __last, __x); } + + template + void + __uninitialized_fill_aux(_ForwardIter __first, _ForwardIter __last, + const _Tp& __x, __false_type) + { + _ForwardIter __cur = __first; + __STL_TRY { + for ( ; __cur != __last; ++__cur) + _Construct(&*__cur, __x); + } + __STL_UNWIND(_Destroy(__first, __cur)); + } + + template + inline void + uninitialized_fill(_ForwardIter __first, _ForwardIter __last, const _Tp& __x) + { + typedef typename iterator_traits<_ForwardIter>::value_type _ValueType; + typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD; + __uninitialized_fill_aux(__first, __last, __x, _Is_POD()); + } + + // Valid if copy construction is equivalent to assignment, and if the + // destructor is trivial. + template + inline _ForwardIter + __uninitialized_fill_n_aux(_ForwardIter __first, _Size __n, + const _Tp& __x, __true_type) + { + return fill_n(__first, __n, __x); + } + + template + _ForwardIter + __uninitialized_fill_n_aux(_ForwardIter __first, _Size __n, + const _Tp& __x, __false_type) + { + _ForwardIter __cur = __first; + __STL_TRY { + for ( ; __n > 0; --__n, ++__cur) + _Construct(&*__cur, __x); + return __cur; + } + __STL_UNWIND(_Destroy(__first, __cur)); + } + + template + inline _ForwardIter + uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp& __x) + { + typedef typename iterator_traits<_ForwardIter>::value_type _ValueType; + typedef typename __type_traits<_ValueType>::is_POD_type _Is_POD; + return __uninitialized_fill_n_aux(__first, __n, __x, _Is_POD()); + } + + // Extensions: __uninitialized_copy_copy, __uninitialized_copy_fill, + // __uninitialized_fill_copy. + + // __uninitialized_copy_copy + // Copies [first1, last1) into [result, result + (last1 - first1)), and + // copies [first2, last2) into + // [result, result + (last1 - first1) + (last2 - first2)). + + template + inline _ForwardIter + __uninitialized_copy_copy(_InputIter1 __first1, _InputIter1 __last1, + _InputIter2 __first2, _InputIter2 __last2, + _ForwardIter __result) + { + _ForwardIter __mid = uninitialized_copy(__first1, __last1, __result); + __STL_TRY { + return uninitialized_copy(__first2, __last2, __mid); + } + __STL_UNWIND(_Destroy(__result, __mid)); + } + + // __uninitialized_fill_copy + // Fills [result, mid) with x, and copies [first, last) into + // [mid, mid + (last - first)). + template + inline _ForwardIter + __uninitialized_fill_copy(_ForwardIter __result, _ForwardIter __mid, + const _Tp& __x, + _InputIter __first, _InputIter __last) + { + uninitialized_fill(__result, __mid, __x); + __STL_TRY { + return uninitialized_copy(__first, __last, __mid); + } + __STL_UNWIND(_Destroy(__result, __mid)); + } + + // __uninitialized_copy_fill + // Copies [first1, last1) into [first2, first2 + (last1 - first1)), and + // fills [first2 + (last1 - first1), last2) with x. + template + inline void + __uninitialized_copy_fill(_InputIter __first1, _InputIter __last1, + _ForwardIter __first2, _ForwardIter __last2, + const _Tp& __x) + { + _ForwardIter __mid2 = uninitialized_copy(__first1, __last1, __first2); + __STL_TRY { + uninitialized_fill(__mid2, __last2, __x); + } + __STL_UNWIND(_Destroy(__first2, __mid2)); + } } // namespace std diff --git a/libstdc++-v3/libio/Makefile.in b/libstdc++-v3/libio/Makefile.in index 53b9a869fa9..17e886cb074 100644 --- a/libstdc++-v3/libio/Makefile.in +++ b/libstdc++-v3/libio/Makefile.in @@ -124,7 +124,7 @@ toplevel_srcdir = @toplevel_srcdir@ AUTOMAKE_OPTIONS = 1.3 cygnus mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs -@GLIBCPP_BUILD_LIBIO_TRUE@noinst_LTLIBRARIES = @GLIBCPP_BUILD_LIBIO_TRUE@libio.la +@GLIBCPP_BUILD_LIBIO_TRUE@noinst_LTLIBRARIES = libio.la @GLIBCPP_BUILD_LIBIO_FALSE@noinst_LTLIBRARIES = # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES @@ -132,20 +132,14 @@ GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@ TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@ LIBIO_INCLUDES = @LIBIO_INCLUDES@ -INCLUDES = \ - -nostdinc++ \ - $(GLIBCPP_INCLUDES) $(LIBIO_INCLUDES) $(TOPLEVEL_INCLUDES) +INCLUDES = -nostdinc++ $(GLIBCPP_INCLUDES) $(LIBIO_INCLUDES) $(TOPLEVEL_INCLUDES) -libio_headers = \ - libio.h libioP.h iolibio.h +libio_headers = libio.h libioP.h iolibio.h -@GLIBCPP_NEED_LIBIO_TRUE@LIBIO_SRCS = @GLIBCPP_NEED_LIBIO_TRUE@\ -@GLIBCPP_NEED_LIBIO_TRUE@ filedoalloc.c genops.c fileops.c stdfiles.c c_codecvt.c \ -@GLIBCPP_NEED_LIBIO_TRUE@ iofclose.c iofopen.c +@GLIBCPP_NEED_LIBIO_TRUE@LIBIO_SRCS = filedoalloc.c genops.c fileops.c stdfiles.c c_codecvt.c iofclose.c iofopen.c @GLIBCPP_NEED_LIBIO_FALSE@LIBIO_SRCS = -@GLIBCPP_NEED_WLIBIO_TRUE@LIBIO_WSRCS = @GLIBCPP_NEED_WLIBIO_TRUE@\ -@GLIBCPP_NEED_WLIBIO_TRUE@ wfiledoalloc.c wfileops.c wgenops.c iofwide.c +@GLIBCPP_NEED_WLIBIO_TRUE@LIBIO_WSRCS = wfiledoalloc.c wfileops.c wgenops.c iofwide.c @GLIBCPP_NEED_WLIBIO_FALSE@LIBIO_WSRCS = EXTRA_DIST = iostreamP.h diff --git a/libstdc++-v3/libmath/Makefile.in b/libstdc++-v3/libmath/Makefile.in index ecdd410cbc0..17581f23533 100644 --- a/libstdc++-v3/libmath/Makefile.in +++ b/libstdc++-v3/libmath/Makefile.in @@ -129,18 +129,13 @@ mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs noinst_LTLIBRARIES = libmath.la -EXTRA_LONG_DOUBLE_yes = \ - hypotl.c signbitl.c +EXTRA_LONG_DOUBLE_yes = hypotl.c signbitl.c -EXTRA_DIST = \ - hypot.c hypotf.c \ - $(EXTRA_LONG_DOUBLE_yes) +EXTRA_DIST = hypot.c hypotf.c $(EXTRA_LONG_DOUBLE_yes) -libmath_la_LIBADD = \ - @LIBMATHOBJS@ \ - $(EXTRA_LONG_DOUBLE_$(USE_COMPLEX_LONG_DOUBLE)) +libmath_la_LIBADD = @LIBMATHOBJS@ $(EXTRA_LONG_DOUBLE_$(USE_COMPLEX_LONG_DOUBLE)) libmath_la_DEPENDENCIES = $(libmath_la_LIBADD) @@ -152,8 +147,7 @@ LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@ -INCLUDES = \ - $(TOPLEVEL_INCLUDES) +INCLUDES = $(TOPLEVEL_INCLUDES) CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in index c41b4f3aeb3..10197f5b96e 100644 --- a/libstdc++-v3/libsupc++/Makefile.in +++ b/libstdc++-v3/libsupc++/Makefile.in @@ -144,50 +144,24 @@ OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@ # These bits are all figured out from configure. Look in acinclude.m4 # or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS # NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden. -CONFIG_CXXFLAGS = \ - @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@ +CONFIG_CXXFLAGS = @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@ # Warning flags to use. -WARN_CXXFLAGS = \ - @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once +WARN_CXXFLAGS = @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES GLIBCPP_INCLUDES = @GLIBCPP_INCLUDES@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@ -INCLUDES = \ - -I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include \ - $(GLIBCPP_INCLUDES) $(LIBSUPCXX_INCLUDES) - - -headers = \ - exception new typeinfo cxxabi.h exception_defines.h - - -sources = \ - del_op.cc \ - del_opnt.cc \ - del_opv.cc \ - del_opvnt.cc \ - eh_alloc.cc \ - eh_aux_runtime.cc \ - eh_catch.cc \ - eh_exception.cc \ - eh_globals.cc \ - eh_personality.cc \ - eh_terminate.cc \ - eh_throw.cc \ - new_handler.cc \ - new_op.cc \ - new_opnt.cc \ - new_opv.cc \ - new_opvnt.cc \ - pure.cc \ - tinfo.cc \ - tinfo2.cc \ - vec.cc +INCLUDES = -I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include $(GLIBCPP_INCLUDES) $(LIBSUPCXX_INCLUDES) + + +headers = exception new typeinfo cxxabi.h exception_defines.h + + +sources = del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc eh_alloc.cc eh_aux_runtime.cc eh_catch.cc eh_exception.cc eh_globals.cc eh_personality.cc eh_terminate.cc eh_throw.cc new_handler.cc new_op.cc new_opnt.cc new_opv.cc new_opvnt.cc pure.cc tinfo.cc tinfo2.cc vec.cc libsupc___la_SOURCES = $(sources) @@ -203,12 +177,7 @@ LIBSUPCXX_CXXFLAGS = $(LIBSUPCXX_PICFLAGS) # set this option because CONFIG_CXXFLAGS has to be after # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden # as the occasion call for it. (ie, --enable-debug) -AM_CXXFLAGS = \ - -fno-implicit-templates \ - $(LIBSUPCXX_CXXFLAGS) \ - $(WARN_CXXFLAGS) \ - $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) +AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) # libstdc++ libtool notes @@ -232,9 +201,7 @@ AM_CXXFLAGS = \ # # We have to put --tag disable-shared after --tag CXX lest things # CXX undo the affect of disable-shared. -LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \ - --mode=compile $(CXX) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared --mode=compile $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) # 3) We'd have a problem when building the shared libstdc++ object if @@ -243,9 +210,7 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \ # course is problematic at this point. So, we get the top-level # directory to configure libstdc++-v3 to use gcc as the C++ # compilation driver. -CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared \ - --mode=link $(CXX) \ - @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@ +CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared --mode=link $(CXX) @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@ CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index 1c9304ea15c..f6c3124e5fd 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -134,13 +134,11 @@ OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@ # These bits are all figured out from configure. Look in acinclude.m4 # or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS # NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden. -CONFIG_CXXFLAGS = \ - @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@ +CONFIG_CXXFLAGS = @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@ # Warning flags to use. -WARN_CXXFLAGS = \ - @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once +WARN_CXXFLAGS = @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once # Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES @@ -150,28 +148,17 @@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@ LIBIO_INCLUDES = @LIBIO_INCLUDES@ TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@ -INCLUDES = \ - -nostdinc++ \ - $(GLIBCPP_INCLUDES) \ - $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) \ - $(TOPLEVEL_INCLUDES) +INCLUDES = -nostdinc++ $(GLIBCPP_INCLUDES) $(LIBSUPCXX_INCLUDES) $(LIBIO_INCLUDES) $(LIBMATH_INCLUDES) $(TOPLEVEL_INCLUDES) -sources = \ - basic_file.cc bitset.cc c++locale.cc cmath.cc codecvt.cc \ - complex_io.cc functexcept.cc globals.cc ios.cc limitsMEMBERS.cc \ - locale.cc locale-inst.cc localename.cc misc-inst.cc stdexcept.cc \ - stl-inst.cc string-inst.cc strstream.cc valarray-inst.cc \ - wstring-inst.cc +sources = basic_file.cc bitset.cc c++locale.cc cmath.cc codecvt.cc complex_io.cc functexcept.cc globals.cc ios.cc limitsMEMBERS.cc locale.cc locale-inst.cc localename.cc misc-inst.cc stdexcept.cc stl-inst.cc string-inst.cc strstream.cc valarray-inst.cc wstring-inst.cc VPATH = $(top_srcdir):$(top_srcdir)/src libstdc___la_SOURCES = $(sources) -libstdc___la_LIBADD = \ - ../libmath/libmath.la @libio_la@ \ - ../libsupc++/libsupc++convenience.la +libstdc___la_LIBADD = ../libmath/libmath.la @libio_la@ ../libsupc++/libsupc++convenience.la libstdc___la_LDFLAGS = -version-info 3:0:0 -lm @@ -191,12 +178,7 @@ GLIBCPP_INCLUDE_DIR = @glibcpp_builddir@/include # The no-implicit-templates flag will generate unresolved references to # the concept-checking symbols. So we must disable the checks while # actually building the library. -AM_CXXFLAGS = \ - -fno-implicit-templates \ - $(LIBSUPCXX_CXXFLAGS) \ - $(WARN_CXXFLAGS) \ - $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) +AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) # libstdc++ libtool notes @@ -217,8 +199,7 @@ AM_CXXFLAGS = \ # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to # attempt to infer which configuration to use -LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS) # 3) We'd have a problem when building the shared libstdc++ object if @@ -227,8 +208,7 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --mode=compile $(CXX) $(INCLUDES) \ # course is problematic at this point. So, we get the top-level # directory to configure libstdc++-v3 to use gcc as the C++ # compilation driver. -CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) \ - @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@ +CXXLINK = $(LIBTOOL) --tag CXX --mode=link $(CXX) @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@ CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = diff --git a/libstdc++-v3/testsuite/23_containers/vector_ctor.cc b/libstdc++-v3/testsuite/23_containers/vector_ctor.cc index 6e97159281b..94782bf2509 100644 --- a/libstdc++-v3/testsuite/23_containers/vector_ctor.cc +++ b/libstdc++-v3/testsuite/23_containers/vector_ctor.cc @@ -1,7 +1,6 @@ -// 1999-06-29 -// bkoz +// 1999-06-29 bkoz -// Copyright (C) 1999, 2000 Free Software Foundation, Inc. +// Copyright (C) 1999-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 @@ -57,10 +56,36 @@ void test02() std::vector v2 (v1); } +// test range constructors and range-fill constructor +void +test03() +{ + const int A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}; + const int B[] = {7, 7, 7, 7, 7}; + const int N = sizeof(A) / sizeof(int); + const int M = sizeof(B) / sizeof(int); + bool test = true; + + std::vector v3(A, A + N); + VERIFY(std::equal(v3.begin(), v3.end(), A)); + + std::vector v4(v3.begin(), v3.end()); + VERIFY(std::equal(v4.begin(), v4.end(), A)); + + std::vector v5(M, 7); + VERIFY(std::equal(v5.begin(), v5.end(), B)); + VERIFY(std::equal(B, B + M, v5.begin())); + +#ifdef DEBUG_ASSERT + assert(test); +#endif +} int main() { test01(); test02(); + test03(); + return 0; } diff --git a/libstdc++-v3/testsuite/23_containers/vector_modifiers.cc b/libstdc++-v3/testsuite/23_containers/vector_modifiers.cc index 7ca7cf6390e..db18b9a41a3 100644 --- a/libstdc++-v3/testsuite/23_containers/vector_modifiers.cc +++ b/libstdc++-v3/testsuite/23_containers/vector_modifiers.cc @@ -1,6 +1,6 @@ // 1999-11-09 bkoz -// Copyright (C) 1999 Free Software Foundation, Inc. +// Copyright (C) 1999, 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 @@ -21,7 +21,9 @@ // 23.2.4.3 vector modifiers #include -#include +#include "debug_assert.h" + +bool test = true; template struct A { }; @@ -29,10 +31,9 @@ template struct B { }; // vector::insert(iterator, inputiterator first, inputiterator last) -bool test01() +void +test01() { - bool test = true; - // POD types typedef std::vector vec_POD; vec_POD vec01; @@ -46,20 +47,42 @@ bool test01() A np01; A* pnp01 = &np01; vec02.insert(vec02.begin(), pnp01, pnp01 + 1); +} + +// test the assign() function +void +test03() +{ + const int K = 417; + const int A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}; + const int B[] = {K, K, K, K, K}; + const int N = sizeof(A) / sizeof(int); + const int M = sizeof(B) / sizeof(int); + bool test = true; + + // assign from pointer range + std::vector v3; + v3.assign(A, A + N); + VERIFY(std::equal(v3.begin(), v3.end(), A)); + VERIFY(v3.size() == N); - // Test that assign compiles. - vec01.assign (pi01, pi01 + 1); + // assign from iterator range + std::vector v4; + v4.assign(v3.begin(), v3.end()); + VERIFY(std::equal(v4.begin(), v4.end(), A)); + VERIFY(std::equal(A, A + N, v4.begin())); -#ifdef DEBUG_ASSERT - assert(test); -#endif - - return test; + // assign from initializer range with resize + v4.assign(M, K); + VERIFY(std::equal(v4.begin(), v4.end(), B)); + VERIFY(std::equal(B, B + M, v4.begin())); + VERIFY((v4.size() == M) && (M != N)); } int main() { test01(); + test03(); - return 0; + return !test; } diff --git a/libstdc++-v3/testsuite/25_algorithms/binary_search.cc b/libstdc++-v3/testsuite/25_algorithms/binary_search.cc new file mode 100644 index 00000000000..7e4396b4cb5 --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/binary_search.cc @@ -0,0 +1,183 @@ +// 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. + +// 25.3.3 [lib.alg.binary.search] Binary search algorithms. + +#include +#include + +bool test = true; + +const int A[] = {1, 2, 3, 3, 3, 5, 8}; +const int C[] = {8, 5, 3, 3, 3, 2, 1}; +const int N = sizeof(A) / sizeof(int); + +// A comparison, equalivalent to std::greater without the +// dependency on . + +struct gt +{ + bool + operator()(const int& x, const int& y) const + { return x > y; } +}; + +// Each test performs general-case, bookend, not-found condition, +// and predicate functional checks. + +// 25.3.3.1 lower_bound, with and without comparison predicate +void +test01() +{ + using std::lower_bound; + + const int first = A[0]; + const int last = A[N - 1]; + + const int* p = lower_bound(A, A + N, 3); + VERIFY(p == A + 2); + + const int* q = lower_bound(A, A + N, first); + VERIFY(q == A + 0); + + const int* r = lower_bound(A, A + N, last); + VERIFY(r == A + N - 1); + + const int* s = lower_bound(A, A + N, 4); + VERIFY(s == A + 5); + + const int* t = lower_bound(C, C + N, 3, gt()); + VERIFY(t == C + 2); + + const int* u = lower_bound(C, C + N, first, gt()); + VERIFY(u == C + N - 1); + + const int* v = lower_bound(C, C + N, last, gt()); + VERIFY(v == C + 0); + + const int* w = lower_bound(C, C + N, 4, gt()); + VERIFY(w == C + 2); +} + +// 25.3.3.2 upper_bound, with and without comparison predicate +void +test02() +{ + using std::upper_bound; + + const int first = A[0]; + const int last = A[N - 1]; + + const int* p = upper_bound(A, A + N, 3); + VERIFY(p == A + 5); + + const int* q = upper_bound(A, A + N, first); + VERIFY(q == A + 1); + + const int* r = upper_bound(A, A + N, last); + VERIFY(r == A + N); + + const int* s = upper_bound(A, A + N, 4); + VERIFY(s == A + 5); + + const int* t = upper_bound(C, C + N, 3, gt()); + VERIFY(t == C + 5); + + const int* u = upper_bound(C, C + N, first, gt()); + VERIFY(u == C + N); + + const int* v = upper_bound(C, C + N, last, gt()); + VERIFY(v == C + 1); + + const int* w = upper_bound(C, C + N, 4, gt()); + VERIFY(w == C + 2); +} + +// 25.3.3.3 equal_range, with and without comparison predicate +void +test03() +{ + using std::equal_range; + typedef std::pair Ipair; + + const int first = A[0]; + const int last = A[N - 1]; + + Ipair p = equal_range(A, A + N, 3); + VERIFY(p.first == A + 2); + VERIFY(p.second == A + 5); + + Ipair q = equal_range(A, A + N, first); + VERIFY(q.first == A + 0); + VERIFY(q.second == A + 1); + + Ipair r = equal_range(A, A + N, last); + VERIFY(r.first == A + N - 1); + VERIFY(r.second == A + N); + + Ipair s = equal_range(A, A + N, 4); + VERIFY(s.first == A + 5); + VERIFY(s.second == A + 5); + + Ipair t = equal_range(C, C + N, 3, gt()); + VERIFY(t.first == C + 2); + VERIFY(t.second == C + 5); + + Ipair u = equal_range(C, C + N, first, gt()); + VERIFY(u.first == C + N - 1); + VERIFY(u.second == C + N); + + Ipair v = equal_range(C, C + N, last, gt()); + VERIFY(v.first == C + 0); + VERIFY(v.second == C + 1); + + Ipair w = equal_range(C, C + N, 4, gt()); + VERIFY(w.first == C + 2); + VERIFY(w.second == C + 2); +} + +// 25.3.3.4 binary_search, with and without comparison predicate +void +test04() +{ + using std::binary_search; + + const int first = A[0]; + const int last = A[N - 1]; + + VERIFY(binary_search(A, A + N, 5)); + VERIFY(binary_search(A, A + N, first)); + VERIFY(binary_search(A, A + N, last)); + VERIFY(!binary_search(A, A + N, 4)); + + VERIFY(binary_search(C, C + N, 5, gt())); + VERIFY(binary_search(C, C + N, first, gt())); + VERIFY(binary_search(C, C + N, last, gt())); + VERIFY(!binary_search(C, C + N, 4, gt())); +} + +int +main(int argc, char* argv[]) +{ + test01(); + test02(); + test03(); + test04(); + + return !test; +} diff --git a/libstdc++-v3/testsuite/25_algorithms/copy.cc b/libstdc++-v3/testsuite/25_algorithms/copy.cc new file mode 100644 index 00000000000..f08694f28b3 --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/copy.cc @@ -0,0 +1,58 @@ +// 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 Pred 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. + +// 25.2.12 [lib.alg.partitions] Partitions. + +#include +#include + +bool test = true; + +const int A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}; +const int N = sizeof(A) / sizeof(int); + +// copy +void +test01() +{ + using std::copy; + + int s1[N]; + copy(A, A + N, s1); + VERIFY(std::equal(s1, s1 + N, A)); +} + +// copy_backward +void +test02() +{ + using std::copy_backward; + + int s1[N]; + copy_backward(A, A + N, s1 + N); + VERIFY(std::equal(s1, s1 + N, A)); +} + +int +main(int argc, char* argv[]) +{ + test01(); + test02(); + + return !test; +} diff --git a/libstdc++-v3/testsuite/25_algorithms/heap.cc b/libstdc++-v3/testsuite/25_algorithms/heap.cc new file mode 100644 index 00000000000..452b6aaa905 --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/heap.cc @@ -0,0 +1,132 @@ +// 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 Pred 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. + +// 25.3.6 Heap operations [lib.alg.heap.operations] + +#include +//#include +#include + +bool test = true; + +const int A[] = {1, 11, 12, 3, 10, 6, 17, 4, 8, 2, 5, 13, 9, 15, 14, 16, 7}; +const int B[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}; +const int C[] = {17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; +const int N = sizeof(A) / sizeof(int); + +// This functor has the equivalent functionality of std::geater<>, +// but there is no dependency on and it also tracks the +// number of invocations since creation. +class Gt +{ +public: + static int count() { return itsCount; } + static void reset() { itsCount = 0; } + + bool + operator()(const int& x, const int& y) + { + ++itsCount; + return x > y; + } + +private: + static int itsCount; +}; + +int Gt::itsCount = 0; + +// Exercise all of the heap functions for operator<. The +// intermediate results between push_heap and pop_heap and +// make_heap and sort_heap are not checked (they could be). +void +test01() +{ + // sort array s1 using push_heap/pop_heap + int s1[N]; + std::copy(A, A + N, s1); + VERIFY(std::equal(s1, s1 + N, A)); + + for (int i = 2; i <= N; ++i) { + std::push_heap(s1, s1 + i); + } + for (int i = N; i >= 2; --i) { + std::pop_heap(s1, s1 + i); + } + VERIFY(std::equal(s1, s1 + N, B)); + + // sort array s2 using make_heap/sort_heap + int s2[N]; + std::copy(A, A + N, s2); + VERIFY(std::equal(s2, s2 + N, A)); + + std::make_heap(s2, s2 + N); + std::sort_heap(s2, s2 + N); + VERIFY(std::equal(s2, s2 + N, B)); +} + +// Perform same tests as above but with the comparison predicate +// versions, and add complexity constraint checks. +void +test02() +{ + Gt gt; +// const int logN = static_cast(std::log(static_cast(N)) + 0.5); + const int logN = 3; + + int s1[N]; + std::copy(A, A + N, s1); + VERIFY(std::equal(s1, s1 + N, A)); + + for (int i = 2; i <= N; ++i) { + std::push_heap(s1, s1 + i, gt); + VERIFY(gt.count() <= logN); + gt.reset(); + } + + for (int i = N; i >= 2; --i) { + std::pop_heap(s1, s1 + i, gt); + VERIFY(gt.count() <= 2 * logN); + gt.reset(); + } + + VERIFY(std::equal(s1, s1 + N, C)); + + // sort array s2 using make_heap/sort_heap + int s2[N]; + std::copy(A, A + N, s2); + VERIFY(std::equal(s2, s2 + N, A)); + + std::make_heap(s2, s2 + N, gt); + VERIFY(gt.count() <= 3 * N); + gt.reset(); + + std::sort_heap(s2, s2 + N, gt); + VERIFY(gt.count() <= N * logN); + + VERIFY(std::equal(s2, s2 + N, C)); +} + +int +main(int argc, char* argv[]) +{ + test01(); + test02(); + + return !test; +} diff --git a/libstdc++-v3/testsuite/25_algorithms/partition.cc b/libstdc++-v3/testsuite/25_algorithms/partition.cc new file mode 100644 index 00000000000..6623cd3f0ed --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/partition.cc @@ -0,0 +1,73 @@ +// 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 Pred 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. + +// 25.2.12 [lib.alg.partitions] Partitions. + +#include +#include +#include + +bool test = true; + +const int A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}; +const int B[] = {2, 4, 6, 8, 10, 12, 14, 16, 1, 3, 5, 7, 9, 11, 13, 15, 17}; +const int N = sizeof(A) / sizeof(int); + +struct Pred +{ + bool + operator()(const int& x) const + { return (x % 2) == 0; } +}; + +// 25.2.12 partition() +void +test01() +{ + using std::partition; + + int s1[N]; + std::copy(A, A + N, s1); + + Pred pred; + int* m = partition(s1, s1 + N, pred); + for (const int* i = s1; i < m; ++i) VERIFY(pred(*i)); + for (const int* i = m; i < s1 + N; ++i) VERIFY(!pred(*i)); +} + +// 25.2.12 stable_partition() +void +test02() +{ + using std::stable_partition; + + int s1[N]; + std::copy(A, A + N, s1); + + stable_partition(s1, s1 + N, Pred()); + VERIFY(std::equal(s1, s1 + N, B)); +} + +int +main(int argc, char* argv[]) +{ + test01(); + test02(); + + return !test; +} diff --git a/libstdc++-v3/testsuite/25_algorithms/rotate.cc b/libstdc++-v3/testsuite/25_algorithms/rotate.cc new file mode 100644 index 00000000000..e80d3cd3cd3 --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/rotate.cc @@ -0,0 +1,80 @@ +// 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. + +// 25.?? algorithms, rotate() + +#include +#include +#include + +bool test = true; + +int A[] = {1, 2, 3, 4, 5, 6, 7}; +int B[] = {2, 3, 4, 5, 6, 7, 1}; +int C[] = {1, 2, 3, 4, 5, 6, 7}; +int D[] = {5, 6, 7, 1, 2, 3, 4}; +const int N = sizeof(A) / sizeof(int); + +/* need a test for a forward iterator -- can't think of one that makes sense */ + +/* biderectional iterator */ +void +test02() +{ + using std::rotate; + typedef std::list Container; + + Container a(A, A + N); + VERIFY(std::equal(a.begin(), a.end(), A)); + + Container::iterator i = a.begin(); + rotate(a.begin(), ++i, a.end()); + VERIFY(std::equal(a.begin(), a.end(), B)); + + i = a.end(); + rotate(a.begin(), --i, a.end()); + VERIFY(std::equal(a.begin(), a.end(), C)); + + i = a.begin(); + std::advance(i, 3); + rotate(a.begin(), ++i, a.end()); + VERIFY(std::equal(a.begin(), a.end(), D)); +} + +/* random iterator */ +void +test03() +{ + using std::rotate; + rotate(A, A + 1, A + N); + VERIFY(std::equal(A, A + N, B)); + + rotate(A, A + N - 1, A + N); + VERIFY(std::equal(A, A + N, C)); + + rotate(A, A + 4, A + N); + VERIFY(std::equal(A, A + N, D)); +} + +int +main(int argc, char* argv[]) +{ + test02(); + test03(); + return !test; +} diff --git a/libstdc++-v3/testsuite/25_algorithms/sort.cc b/libstdc++-v3/testsuite/25_algorithms/sort.cc new file mode 100644 index 00000000000..f26dd018727 --- /dev/null +++ b/libstdc++-v3/testsuite/25_algorithms/sort.cc @@ -0,0 +1,171 @@ +// 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. + +// 25.3.1 algorithms, sort() + +#include +#include + +bool test = true; + +const int A[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}; +const int B[] = {10, 20, 1, 11, 2, 12, 3, 13, 4, 14, 5, 15, 6, 16, 7, 17, 8, 18, 9, 19}; +const int C[] = {20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; +const int N = sizeof(A) / sizeof(int); +const int logN = 3; // ln(N) rounded up +const int P = 7; + +// comparison predicate for stable_sort: order by rightmost digit +struct CompLast +{ + bool + operator()(const int x, const int y) + { return x % 10 < y % 10; } +}; + +// This functor has the equivalent functionality of std::geater<>, +// but there is no dependency on and it also tracks the +// number of invocations since creation. +class Gt +{ +public: + static int count() { return itsCount; } + static void reset() { itsCount = 0; } + + bool + operator()(const int& x, const int& y) + { + ++itsCount; + return x > y; + } + +private: + static int itsCount; +}; + +int Gt::itsCount = 0; + + +// 25.3.1.1 sort() +void +test01() +{ + int s1[N]; + std::copy(B, B + N, s1); + VERIFY(std::equal(s1, s1 + N, B)); + + std::sort(s1, s1 + N); + VERIFY(std::equal(s1, s1 + N, A)); + + Gt gt; + gt.reset(); + std::sort(s1, s1 + N, gt); + VERIFY(std::equal(s1, s1 + N, C)); +} + +// 25.3.1.2 stable_sort() +void +test02() +{ + int s1[N]; + std::copy(A, A + N, s1); + VERIFY(std::equal(s1, s1 + N, A)); + + std::stable_sort(s1, s1 + N, CompLast()); + VERIFY(std::equal(s1, s1 + N, B)); + + std::stable_sort(s1, s1 + N); + VERIFY(std::equal(s1, s1 + N, A)); + + Gt gt; + gt.reset(); + std::stable_sort(s1, s1 + N, gt); + VERIFY(std::equal(s1, s1 + N, C)); + VERIFY(gt.count() <= N * logN * logN); +} + +// 25.3.1.3 partial_sort() +void +test03() +{ + int s1[N]; + std::copy(B, B + N, s1); + VERIFY(std::equal(s1, s1 + N, B)); + + std::partial_sort(s1, s1 + P, s1 + N); + VERIFY(std::equal(s1, s1 + P, A)); + + Gt gt; + gt.reset(); + std::partial_sort(s1, s1 + P, s1 + N, gt); + VERIFY(std::equal(s1, s1 + P, C)); +} + +// 25.3.1.4 partial_sort_copy() +void +test04() +{ + using std::partial_sort_copy; + + int s1[N]; + std::copy(B, B + N, s1); + VERIFY(std::equal(s1, s1 + N, B)); + + int s2[2*N]; + + partial_sort_copy(s1, s1 + N, s2, s2 + P); + VERIFY(std::equal(s2, s2 + P, A)); + + Gt gt; + gt.reset(); + partial_sort_copy(s1, s1 + N, s2, s2 + P, gt); + VERIFY(std::equal(s2, s2 + P, C)); + + VERIFY(std::equal(s2, partial_sort_copy(s1, s1 + N, s2, s2 + 2*N), A)); +} + +// 25.3.2 nth_element() +void +test05() +{ + using std::nth_element; + + int s1[N]; + std::copy(B, B + N, s1); + VERIFY(std::equal(s1, s1 + N, B)); + + int* pn = s1 + (N / 2) - 1; + nth_element(s1, pn, s1 + N); + for (const int* i = pn; i < s1 + N; ++i) VERIFY(!(*i < *pn)); + + CompLast pred; + nth_element(s1, pn, s1 + N, pred); + for (const int* i = pn; i < s1 + N; ++i) VERIFY(!pred(*i, *pn)); +} + +int +main(int argc, char* argv[]) +{ + test01(); + test02(); + test03(); + test04(); + test05(); + + return !test; +} diff --git a/libstdc++-v3/testsuite/26_numerics/sum_diff.cc b/libstdc++-v3/testsuite/26_numerics/sum_diff.cc new file mode 100644 index 00000000000..ffc4e639c1c --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/sum_diff.cc @@ -0,0 +1,47 @@ +// 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. + +// 26.4.3 [lib.partial.sum] +// 26.4.4 [lib.adjacent.difference] + +#include +#include +#include + +int A[] = {1, 4, 9, 16, 25, 36, 49, 64, 81, 100}; +int B[] = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19}; +const int N = sizeof(A) / sizeof(int); + +void +test01() +{ + int D[N]; + + std::adjacent_difference(A, A + N, D); + assert(std::equal(D, D + N, B)); + + std::partial_sum(D, D + N, D); + assert(std::equal(D, D + N, A)); +} + +int +main(int argc, char* argv[]) +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in index 2c350e5a1c4..1af4d4e6d0c 100644 --- a/libstdc++-v3/testsuite/Makefile.in +++ b/libstdc++-v3/testsuite/Makefile.in @@ -128,14 +128,10 @@ AUTOMAKE_OPTIONS = foreign dejagnu DEJATOOL = libstdc++-v3 -EXPECT = `if [ -f @glibcpp_builddir@/../../expect/expect ] ; then \ - echo @glibcpp_builddir@/../../expect/expect ; \ - else echo expect ; fi` +EXPECT = `if [ -f @glibcpp_builddir@/../../expect/expect ] ; then echo @glibcpp_builddir@/../../expect/expect ; else echo expect ; fi` -RUNTEST = `if [ -f @glibcpp_srcdir@/../dejagnu/runtest ] ; then \ - echo @glibcpp_srcdir@/../dejagnu/runtest ; \ - else echo runtest; fi` +RUNTEST = `if [ -f @glibcpp_srcdir@/../dejagnu/runtest ] ; then echo @glibcpp_srcdir@/../dejagnu/runtest ; else echo runtest; fi` RUNTESTFLAGS =