AC_LANG_RESTORE
])
-dnl
-dnl Check whether macros, etc are present for <system_error>
-dnl
-AC_DEFUN([GLIBCXX_CHECK_SYSTEM_ERROR], [
-
-m4_pushdef([n_syserr], [1])dnl
-m4_foreach([syserr], [EOWNERDEAD, ENOTRECOVERABLE, ENOLINK, EPROTO, ENODATA,
- ENOSR, ENOSTR, ETIME, EBADMSG, ECANCELED,
- EOVERFLOW, ENOTSUP, EIDRM, ETXTBSY,
- ECHILD, ENOSPC, EPERM,
- ETIMEDOUT, EWOULDBLOCK],
-[m4_pushdef([SYSERR], m4_toupper(syserr))dnl
-AC_MSG_CHECKING([for syserr])
-AC_CACHE_VAL([glibcxx_cv_system_error[]n_syserr], [
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]],
- [int i = syserr;])],
- [glibcxx_cv_system_error[]n_syserr=yes],
- [glibcxx_cv_system_error[]n_syserr=no])
-])
-AC_MSG_RESULT([$glibcxx_cv_system_error[]n_syserr])
-if test x"$glibcxx_cv_system_error[]n_syserr" = x"yes"; then
- AC_DEFINE([HAVE_]SYSERR, 1, [Define if ]syserr[ exists.])
-fi
-m4_define([n_syserr], m4_incr(n_syserr))dnl
-m4_popdef([SYSERR])dnl
-])
-m4_popdef([n_syserr])dnl
-])
-
dnl
dnl Check for what type of C headers to use.
dnl
bad_address = EFAULT,
bad_file_descriptor = EBADF,
-#ifdef _GLIBCXX_HAVE_EBADMSG
+#ifdef EBADMSG
bad_message = EBADMSG,
#endif
function_not_supported = ENOSYS,
host_unreachable = EHOSTUNREACH,
-#ifdef _GLIBCXX_HAVE_EIDRM
+#ifdef EIDRM
identifier_removed = EIDRM,
#endif
no_buffer_space = ENOBUFS,
no_child_process = ECHILD,
-#ifdef _GLIBCXX_HAVE_ENOLINK
+#ifdef ENOLINK
no_link = ENOLINK,
#endif
no_lock_available = ENOLCK,
-#ifdef _GLIBCXX_HAVE_ENODATA
+#ifdef ENODATA
no_message_available = ENODATA,
#endif
no_protocol_option = ENOPROTOOPT,
no_space_on_device = ENOSPC,
-#ifdef _GLIBCXX_HAVE_ENOSR
+#ifdef ENOSR
no_stream_resources = ENOSR,
#endif
not_a_directory = ENOTDIR,
not_a_socket = ENOTSOCK,
-#ifdef _GLIBCXX_HAVE_ENOSTR
+#ifdef ENOSTR
not_a_stream = ENOSTR,
#endif
not_connected = ENOTCONN,
not_enough_memory = ENOMEM,
-#ifdef _GLIBCXX_HAVE_ENOTSUP
+#ifdef ENOTSUP
not_supported = ENOTSUP,
#endif
-#ifdef _GLIBCXX_HAVE_ECANCELED
+#ifdef ECANCELED
operation_canceled = ECANCELED,
#endif
operation_not_supported = EOPNOTSUPP,
operation_would_block = EWOULDBLOCK,
-#ifdef _GLIBCXX_HAVE_EOWNERDEAD
+#ifdef EOWNERDEAD
owner_dead = EOWNERDEAD,
#endif
permission_denied = EACCES,
-#ifdef _GLIBCXX_HAVE_EPROTO
+#ifdef EPROTO
protocol_error = EPROTO,
#endif
resource_unavailable_try_again = EAGAIN,
result_out_of_range = ERANGE,
-#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
+#ifdef ENOTRECOVERABLE
state_not_recoverable = ENOTRECOVERABLE,
#endif
-#ifdef _GLIBCXX_HAVE_ETIME
+#ifdef ETIME
stream_timeout = ETIME,
#endif
-#ifdef _GLIBCXX_HAVE_ETXTBSY
+#ifdef ETXTBSY
text_file_busy = ETXTBSY,
#endif
too_many_links = EMLINK,
too_many_symbolic_link_levels = ELOOP,
-#ifdef _GLIBCXX_HAVE_EOVERFLOW
+#ifdef EOVERFLOW
value_too_large = EOVERFLOW,
#endif
# Checks for operating systems support that doesn't require linking.
GLIBCXX_CHECK_STDIO_PROTO
GLIBCXX_CHECK_MATH11_PROTO
-GLIBCXX_CHECK_SYSTEM_ERROR
GLIBCXX_CHECK_UCHAR_H
# For the streamoff typedef.
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+// Copyright (C) 2020 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 3, 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 COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// PR libstdc++/93151
+#undef _XOPEN_SOURCE
+#define _XOPEN_SOURCE 600
+#include <system_error>
TEST_ERRC(bad_address);
TEST_ERRC(bad_file_descriptor);
-#ifdef _GLIBCXX_HAVE_EBADMSG
+#ifdef EBADMSG
TEST_ERRC(bad_message);
#endif
TEST_ERRC(function_not_supported);
TEST_ERRC(host_unreachable);
-#ifdef _GLIBCXX_HAVE_EIDRM
+#ifdef EIDRM
TEST_ERRC(identifier_removed);
#endif
TEST_ERRC(no_buffer_space);
TEST_ERRC(no_child_process);
-#ifdef _GLIBCXX_HAVE_ENOLINK
+#ifdef ENOLINK
TEST_ERRC(no_link);
#endif
TEST_ERRC(no_lock_available);
-#ifdef _GLIBCXX_HAVE_ENODATA
+#ifdef ENODATA
TEST_ERRC(no_message_available);
#endif
-#ifdef _GLIBCXX_HAVE_ENOMSG
+#ifdef ENOMSG
TEST_ERRC(no_message);
#endif
TEST_ERRC(no_protocol_option);
TEST_ERRC(no_space_on_device);
-#ifdef _GLIBCXX_HAVE_ENOSR
+#ifdef ENOSR
TEST_ERRC(no_stream_resources);
#endif
TEST_ERRC(not_a_directory);
TEST_ERRC(not_a_socket);
-#ifdef _GLIBCXX_HAVE_ENOSTR
+#ifdef ENOSTR
TEST_ERRC(not_a_stream);
#endif
- TEST_ERRC(not_connected);
+ TEST_ERRC(not_connected);
TEST_ERRC(not_enough_memory);
TEST_ERRC(not_supported);
-#ifdef _GLIBCXX_HAVE_ECANCELED
+#ifdef ECANCELED
TEST_ERRC(operation_canceled);
#endif
TEST_ERRC(operation_not_supported);
TEST_ERRC(operation_would_block);
-#ifdef _GLIBCXX_HAVE_EOWNERDEAD
+#ifdef EOWNERDEAD
TEST_ERRC(owner_dead);
#endif
TEST_ERRC(permission_denied);
-#ifdef _GLIBCXX_HAVE_EPROTO
+#ifdef EPROTO
TEST_ERRC(protocol_error);
#endif
TEST_ERRC(protocol_not_supported);
TEST_ERRC(read_only_file_system);
TEST_ERRC(resource_deadlock_would_occur);
- TEST_ERRC(resource_unavailable_try_again);
+ TEST_ERRC(resource_unavailable_try_again);
TEST_ERRC(result_out_of_range);
-#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE
+#ifdef ENOTRECOVERABLE
TEST_ERRC(state_not_recoverable);
#endif
-#ifdef _GLIBCXX_HAVE_ETIME
+#ifdef ETIME
TEST_ERRC(stream_timeout);
#endif
-#ifdef _GLIBCXX_HAVE_ETXTBSY
+#ifdef ETXTBSY
TEST_ERRC(text_file_busy);
#endif
TEST_ERRC(too_many_links);
TEST_ERRC(too_many_symbolic_link_levels);
-#ifdef _GLIBCXX_HAVE_EOVERFLOW
+#ifdef EOVERFLOW
TEST_ERRC(value_too_large);
#endif