diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3f1734d0c6b..873ac16cef5 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,13 @@ +2007-09-05 Roger Sayle + + * acinclude.m4 (GLIBCXX_CHECK_SYSTEM_ERROR): Add EBADMSG for darwin. + * configure: Regenerate. + * include/std/system_error: Guard. + * testsuite/19_diagnostics/headers/system_error/ + types_std_c++0x.cc: Same. + * testsuite/19_diagnostics/error_category/cons/copy_neg.cc: Adjust + line numbers. + 2007-09-03 Paolo Carlini PR libstdc++/33293 diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index 5fa76eda147..064b6ad0b85 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -1351,6 +1351,16 @@ AC_DEFUN([GLIBCXX_CHECK_SYSTEM_ERROR], [ if test x"$ac_system_error9" = x"yes"; then AC_DEFINE(HAVE_SYS_NERR, 1, [Define if sys_nerr exists.]) fi + + AC_MSG_CHECKING([for EBADMSG]) + AC_CACHE_VAL(ac_system_error_10, [ + AC_TRY_COMPILE([#include ], [ int i = EBADMSG; ], + [ac_system_error_10=yes], [ac_system_error_10=no]) + ]) + AC_MSG_RESULT($ac_system_error_10) + if test x"$ac_system_error_10" = x"yes"; then + AC_DEFINE(HAVE_EBADMSG, 1, [Define if EBADMSG exists.]) + fi ]) dnl diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 4df7e23acf4..0e6eb2f8101 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -17109,6 +17109,70 @@ _ACEOF fi + echo "$as_me:$LINENO: checking for EBADMSG" >&5 +echo $ECHO_N "checking for EBADMSG... $ECHO_C" >&6 + if test "${ac_system_error_10+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 +int +main () +{ + int i = EBADMSG; + ; + 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_10=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_system_error_10=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +fi + + echo "$as_me:$LINENO: result: $ac_system_error_10" >&5 +echo "${ECHO_T}$ac_system_error_10" >&6 + if test x"$ac_system_error_10" = x"yes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_EBADMSG 1 +_ACEOF + + fi + # No surprises, no surprises... @@ -17151,7 +17215,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 17154 "configure" +#line 17218 "configure" int main() { // NB: _Atomic_word not necessarily int. diff --git a/libstdc++-v3/include/std/system_error b/libstdc++-v3/include/std/system_error index e5b65ed5fc8..9758d5ebb7a 100644 --- a/libstdc++-v3/include/std/system_error +++ b/libstdc++-v3/include/std/system_error @@ -63,7 +63,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std) argument_out_of_domain = EDOM, bad_address = EFAULT, bad_file_descriptor = EBADF, + +#ifdef _GLIBCXX_HAVE_EBADMSG bad_message = EBADMSG, +#endif + broken_pipe = EPIPE, connection_aborted = ECONNABORTED, connection_already_in_progress = EALREADY, diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_category/cons/copy_neg.cc b/libstdc++-v3/testsuite/19_diagnostics/error_category/cons/copy_neg.cc index 766009c429e..0fdf2c7b32d 100644 --- a/libstdc++-v3/testsuite/19_diagnostics/error_category/cons/copy_neg.cc +++ b/libstdc++-v3/testsuite/19_diagnostics/error_category/cons/copy_neg.cc @@ -50,7 +50,7 @@ int main() return 0; } -// { dg-error "is private" "" { target *-*-* } 183 } +// { dg-error "is private" "" { target *-*-* } 187 } // { dg-error "within this context" "" { target *-*-* } 29 } // { dg-error "first required here" "" { target *-*-* } 48 } // { dg-excess-errors "copy constructor" } diff --git a/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/types_std_c++0x.cc b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/types_std_c++0x.cc index 742ef29a77c..b5ba872b69a 100644 --- a/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/types_std_c++0x.cc +++ b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/types_std_c++0x.cc @@ -37,7 +37,11 @@ namespace gnu using std::argument_out_of_domain; using std:: bad_address; using std::bad_file_descriptor; + +#ifdef _GLIBCXX_HAVE_EBADMSG using std::bad_message; +#endif + using std::broken_pipe; using std::connection_aborted; using std::connection_already_in_progress;