Don't check STREAMS error numbers on systems that don't implement the obsolete (as described in POSIX2008) XSI STREAMS extension.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@140248 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Chisnall 2011-09-21 12:23:11 +00:00
parent 6b8ac3acda
commit eb2c855c44
2 changed files with 16 additions and 0 deletions

View File

@ -180,9 +180,11 @@
#error ENOBUFS not defined #error ENOBUFS not defined
#endif #endif
#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
#ifndef ENODATA #ifndef ENODATA
#error ENODATA not defined #error ENODATA not defined
#endif #endif
#endif
#ifndef ENODEV #ifndef ENODEV
#error ENODEV not defined #error ENODEV not defined
@ -220,13 +222,17 @@
#error ENOSPC not defined #error ENOSPC not defined
#endif #endif
#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
#ifndef ENOSR #ifndef ENOSR
#error ENOSR not defined #error ENOSR not defined
#endif #endif
#endif
#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
#ifndef ENOSTR #ifndef ENOSTR
#error ENOSTR not defined #error ENOSTR not defined
#endif #endif
#endif
#ifndef ENOSYS #ifndef ENOSYS
#error ENOSYS not defined #error ENOSYS not defined
@ -312,9 +318,11 @@
#error ESRCH not defined #error ESRCH not defined
#endif #endif
#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
#ifndef ETIME #ifndef ETIME
#error ETIME not defined #error ETIME not defined
#endif #endif
#endif
#ifndef ETIMEDOUT #ifndef ETIMEDOUT
#error ETIMEDOUT not defined #error ETIMEDOUT not defined

View File

@ -55,18 +55,24 @@ int main()
static_assert(std::errc::no_child_process == ECHILD, ""); static_assert(std::errc::no_child_process == ECHILD, "");
static_assert(std::errc::no_link == ENOLINK, ""); static_assert(std::errc::no_link == ENOLINK, "");
static_assert(std::errc::no_lock_available == ENOLCK, ""); static_assert(std::errc::no_lock_available == ENOLCK, "");
#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
static_assert(std::errc::no_message_available == ENODATA, ""); static_assert(std::errc::no_message_available == ENODATA, "");
#endif
static_assert(std::errc::no_message == ENOMSG, ""); static_assert(std::errc::no_message == ENOMSG, "");
static_assert(std::errc::no_protocol_option == ENOPROTOOPT, ""); static_assert(std::errc::no_protocol_option == ENOPROTOOPT, "");
static_assert(std::errc::no_space_on_device == ENOSPC, ""); static_assert(std::errc::no_space_on_device == ENOSPC, "");
#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
static_assert(std::errc::no_stream_resources == ENOSR, ""); static_assert(std::errc::no_stream_resources == ENOSR, "");
#endif
static_assert(std::errc::no_such_device_or_address == ENXIO, ""); static_assert(std::errc::no_such_device_or_address == ENXIO, "");
static_assert(std::errc::no_such_device == ENODEV, ""); static_assert(std::errc::no_such_device == ENODEV, "");
static_assert(std::errc::no_such_file_or_directory == ENOENT, ""); static_assert(std::errc::no_such_file_or_directory == ENOENT, "");
static_assert(std::errc::no_such_process == ESRCH, ""); static_assert(std::errc::no_such_process == ESRCH, "");
static_assert(std::errc::not_a_directory == ENOTDIR, ""); static_assert(std::errc::not_a_directory == ENOTDIR, "");
static_assert(std::errc::not_a_socket == ENOTSOCK, ""); static_assert(std::errc::not_a_socket == ENOTSOCK, "");
#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
static_assert(std::errc::not_a_stream == ENOSTR, ""); static_assert(std::errc::not_a_stream == ENOSTR, "");
#endif
static_assert(std::errc::not_connected == ENOTCONN, ""); static_assert(std::errc::not_connected == ENOTCONN, "");
static_assert(std::errc::not_enough_memory == ENOMEM, ""); static_assert(std::errc::not_enough_memory == ENOMEM, "");
static_assert(std::errc::not_supported == ENOTSUP, ""); static_assert(std::errc::not_supported == ENOTSUP, "");
@ -84,7 +90,9 @@ int main()
static_assert(std::errc::resource_unavailable_try_again == EAGAIN, ""); static_assert(std::errc::resource_unavailable_try_again == EAGAIN, "");
static_assert(std::errc::result_out_of_range == ERANGE, ""); static_assert(std::errc::result_out_of_range == ERANGE, "");
static_assert(std::errc::state_not_recoverable == ENOTRECOVERABLE, ""); static_assert(std::errc::state_not_recoverable == ENOTRECOVERABLE, "");
#if (defined(_XOPEN_STREAMS) && _XOPEN_STREAMS != -1)
static_assert(std::errc::stream_timeout == ETIME, ""); static_assert(std::errc::stream_timeout == ETIME, "");
#endif
static_assert(std::errc::text_file_busy == ETXTBSY, ""); static_assert(std::errc::text_file_busy == ETXTBSY, "");
static_assert(std::errc::timed_out == ETIMEDOUT, ""); static_assert(std::errc::timed_out == ETIMEDOUT, "");
static_assert(std::errc::too_many_files_open_in_system == ENFILE, ""); static_assert(std::errc::too_many_files_open_in_system == ENFILE, "");