]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
configure.ac (ac_cv_std_swap_in_utility): New test.
authorMichael Matz <matz@gcc.gnu.org>
Tue, 26 Jan 2016 16:34:24 +0000 (16:34 +0000)
committerMichael Matz <matz@gcc.gnu.org>
Tue, 26 Jan 2016 16:34:24 +0000 (16:34 +0000)
* configure.ac (ac_cv_std_swap_in_utility): New test.
* system.h (<algorithm>): Check HAVE_SWAP_IN_UTILITY as well.
* configure: Regenerate.
* config.in: Regenerate.

From-SVN: r232836

gcc/ChangeLog
gcc/config.in
gcc/configure
gcc/configure.ac
gcc/system.h

index 6518a3b184139adc46468c832da2fc386846a998..71e96024dd4f3bb5df3f4b8da85822e699abd5b2 100644 (file)
@@ -1,11 +1,18 @@
+2016-01-26  Michael Matz  <matz@suse.de>
+
+       * configure.ac (ac_cv_std_swap_in_utility): New test.
+       * system.h (<algorithm>): Check HAVE_SWAP_IN_UTILITY as well.
+       * configure: Regenerate.
+       * config.in: Regenerate.
+
 2016-01-26  Claudiu Zissulescu  <claziss@synopsys.com>
 
-        * config/arc/arc.md (cstoresi4): Force operand into register.
-        (arcset<code>): Fix predicate.
-        (arcsetltu): Likewise.
-        (arcsetgeu): Likewise.
-        (arcsethi): Likewise.
-        (arcsetls): Likewise.
+       * config/arc/arc.md (cstoresi4): Force operand into register.
+       (arcset<code>): Fix predicate.
+       (arcsetltu): Likewise.
+       (arcsetgeu): Likewise.
+       (arcsethi): Likewise.
+       (arcsetls): Likewise.
 
 2016-01-26  Jakub Jelinek  <jakub@redhat.com>
 
index 1796e1d895e3b091469dc57dc40be90c6476b262..115cb61639dacd2661e2ef1ec7759ffb8917aa0f 100644 (file)
 #endif
 
 
+/* Define if <utility> defines std::swap. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_SWAP_IN_UTILITY
+#endif
+
+
 /* Define to 1 if you have the `sysconf' function. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_SYSCONF
 #endif
 
 
-/* Define if your assembler supports .dwsect 0xB0000 */
+/* Define if your assembler supports AIX debug frame section label reference.
+   */
 #ifndef USED_FOR_TARGET
 #undef HAVE_XCOFF_DWARF_EXTRAS
 #endif
index ff646e8fcac28cae9f78f7355124510d34f01705..8ea4281cce424a774a12208df71fb73803cf3d7f 100755 (executable)
@@ -6534,6 +6534,40 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::swap in <utility>" >&5
+$as_echo_n "checking for std::swap in <utility>... " >&6; }
+if test "${ac_cv_std_swap_in_utility+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <utility>
+
+int
+main ()
+{
+int a, b; std::swap(a,b);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_std_swap_in_utility=yes
+else
+  ac_cv_std_swap_in_utility=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_std_swap_in_utility" >&5
+$as_echo "$ac_cv_std_swap_in_utility" >&6; }
+if test $ac_cv_std_swap_in_utility = yes; then
+
+$as_echo "#define HAVE_SWAP_IN_UTILITY 1" >>confdefs.h
+
+fi
+
 # Check whether compiler is affected by placement new aliasing bug (PR 29286).
 # If the host compiler is affected by the bug, and we build with optimization
 # enabled (which happens e.g. when cross-compiling), the pool allocator may
@@ -18419,7 +18453,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18422 "configure"
+#line 18456 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18525,7 +18559,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18528 "configure"
+#line 18562 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index 4dc7c109a2667f871960096b105536fde03839f2..6cfb68a8520a0a78f2a22019c76e43a4adb0e9c4 100644 (file)
@@ -416,6 +416,15 @@ struct X<long long> { typedef long long t; };
 ]], [[X<int64_t>::t x;]])],[],[AC_MSG_ERROR([error verifying int64_t uses long long])])
 fi
 
+AC_CACHE_CHECK(for std::swap in <utility>, ac_cv_std_swap_in_utility, [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <utility>
+]], [[int a, b; std::swap(a,b);]])],[ac_cv_std_swap_in_utility=yes],[ac_cv_std_swap_in_utility=no])])
+if test $ac_cv_std_swap_in_utility = yes; then
+  AC_DEFINE(HAVE_SWAP_IN_UTILITY, 1,
+  [Define if <utility> defines std::swap.])
+fi
+
 # Check whether compiler is affected by placement new aliasing bug (PR 29286).
 # If the host compiler is affected by the bug, and we build with optimization
 # enabled (which happens e.g. when cross-compiling), the pool allocator may
index 8151e0a7b2a35c0ac6da0c9dc0083e8098943c84..445073c5cae75f9b510ba13f6e46ebd451b6c77e 100644 (file)
@@ -217,7 +217,7 @@ extern int errno;
 #endif
 
 #ifdef __cplusplus
-#ifdef INCLUDE_ALGORITHM
+#if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
 # include <algorithm>
 #endif
 # include <cstring>