acinclude.m4 (GLIBCXX_CHECK_SYSTEM_ERROR): Add ECANCELED for cygwin.
authorRoger Sayle <roger@eyesopen.com>
Sun, 9 Sep 2007 21:47:04 +0000 (21:47 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sun, 9 Sep 2007 21:47:04 +0000 (21:47 +0000)
* acinclude.m4 (GLIBCXX_CHECK_SYSTEM_ERROR): Add ECANCELED for cygwin.
* configure: Regenerate.
* config/os/generic/error_constants.h: Guard.
* testsuite/19_diagnostics/headers/system_error/
types_std_c++0x.cc: Same.

From-SVN: r128307

libstdc++-v3/ChangeLog
libstdc++-v3/acinclude.m4
libstdc++-v3/config/os/generic/error_constants.h
libstdc++-v3/configure
libstdc++-v3/testsuite/19_diagnostics/headers/system_error/types_std_c++0x.cc

index bbb848c05408f1992c4fe71240c832e23b86a418..1849b11ea34f796261f96cc13d329ffc828b33c4 100644 (file)
@@ -1,3 +1,11 @@
+2007-09-09  Roger Sayle  <roger@eyesopen.com>
+
+       * acinclude.m4 (GLIBCXX_CHECK_SYSTEM_ERROR): Add ECANCELED for cygwin.
+       * configure: Regenerate.
+       * config/os/generic/error_constants.h: Guard.
+       * testsuite/19_diagnostics/headers/system_error/
+       types_std_c++0x.cc: Same.
+
 2007-09-09  Benjamin Kosnik  <bkoz@redhat.com>
        
        * testsuite/25_algorithms/binary_search.cc: Move...
index 064b6ad0b85cd217b6cf1ec362684c38b26d1479..d29b7932a3e0a07820124b7e97b180b8f32986ab 100644 (file)
@@ -1361,6 +1361,16 @@ AC_DEFUN([GLIBCXX_CHECK_SYSTEM_ERROR], [
   if test x"$ac_system_error_10" = x"yes"; then
     AC_DEFINE(HAVE_EBADMSG, 1, [Define if EBADMSG exists.])
   fi
+
+  AC_MSG_CHECKING([for ECANCELED])
+  AC_CACHE_VAL(ac_system_error_11, [
+  AC_TRY_COMPILE([#include <errno.h>], [ int i = ECANCELED; ],
+             [ac_system_error_11=yes], [ac_system_error_11=no])
+  ])
+  AC_MSG_RESULT($ac_system_error_11)
+  if test x"$ac_system_error_11" = x"yes"; then
+    AC_DEFINE(HAVE_ECANCELED, 1, [Define if ECANCELED exists.])
+  fi
 ])
 
 dnl
index 8b0a6bf2799b1f06a8b405e5518b6eefc173421d..d13b7ff3e8b0d0caf390c12b5e58580d6e97a074 100644 (file)
@@ -116,7 +116,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
       not_connected =                          ENOTCONN,
       not_enough_memory =                      ENOMEM,
       not_supported =                          ENOTSUP,
+
+#ifdef _GLIBCXX_HAVE_ECANCELED
       operation_canceled =                     ECANCELED,
+#endif
+
       operation_in_progress =                  EINPROGRESS,
       operation_not_permitted =                EPERM,
       operation_not_supported =                EOPNOTSUPP,
index 3651176e1720d773afada6c98fbbd11563d175f5..4b4a44433419c9fa64b2c5e7d6a7d2e9a23eb32e 100755 (executable)
@@ -17173,6 +17173,70 @@ _ACEOF
 
   fi
 
+  echo "$as_me:$LINENO: checking for ECANCELED" >&5
+echo $ECHO_N "checking for ECANCELED... $ECHO_C" >&6
+  if test "${ac_system_error_11+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <errno.h>
+int
+main ()
+{
+ int i = ECANCELED;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_system_error_11=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_system_error_11=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+
+  echo "$as_me:$LINENO: result: $ac_system_error_11" >&5
+echo "${ECHO_T}$ac_system_error_11" >&6
+  if test x"$ac_system_error_11" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ECANCELED 1
+_ACEOF
+
+  fi
+
 
 # No surprises, no surprises...
 
@@ -17215,7 +17279,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
   # Fake what AC_TRY_COMPILE does.  XXX Look at redoing this new-style.
     cat > conftest.$ac_ext << EOF
-#line 17218 "configure"
+#line 17282 "configure"
 int main()
 {
   // NB: _Atomic_word not necessarily int.
index b5ba872b69a2adc316d74d06310f7e6d49d27151..47e24d937b683aad8109d1ef6db8621e957e0634 100644 (file)
@@ -105,7 +105,11 @@ namespace gnu
   using std::not_connected; 
   using std::not_enough_memory;
   using std::not_supported;
+
+#ifdef _GLIBCXX_HAVE_ECANCELED
   using std::operation_canceled;
+#endif
+
   using std::operation_in_progress;
   using std::operation_not_permitted;
   using std::operation_not_supported;