Several enumerators are commented out in <bits/error_constants.h> for MinGW-w64. However, I find several macros are actually usable in <errno.h> in the distribution (MSYS2) I am using, as: /* Defined as WSAETIMEDOUT. */ #ifndef ETIMEDOUT #define ETIMEDOUT 138 #endif #ifndef ELOOP #define ELOOP 114 #endif #ifndef EPROTOTYPE #define EPROTOTYPE 136 #endif #ifndef EOVERFLOW #define EOVERFLOW 132 #endif Can they be configured automatically?
Proposed patch that enables all error codes in mingw-w64 v5 and above: https://gcc.gnu.org/ml/gcc-patches/2016-12/msg01533.html
In fact it looks like the patch should work for mingw-w64 v4, and maybe v3 too.
Author: redi Date: Wed Dec 21 13:09:13 2016 New Revision: 243853 URL: https://gcc.gnu.org/viewcvs?rev=243853&root=gcc&view=rev Log: PR 71444 define more error constants for mingw-w64 PR libstdc++/71444 * config/os/mingw32-w64/error_constants.h (address_family_not_supported, address_in_use, address_not_available) (already_connected, connection_aborted, connection_already_in_progress) connection_refused, connection_reset, cross_device_link) (destination_address_required, host_unreachable, message_size) (network_down, network_reset, network_unreachable, no_buffer_space) (no_protocol_option, not_a_socket, not_connected, operation_canceled) (operation_in_progress, operation_not_supported, protocol_error) (protocol_not_supported, too_many_links, too_many_symbolic_link_levels) (value_too_large, wrong_protocol_type): Define. (bad_message, identifier_removed, no_link, no_message_available) (no_message, no_stream_resources, not_a_stream, owner_dead) (state_not_recoverable, stream_timeout, text_file_busy): Define conditionally. * testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc: Guard test for no_message with _GLIBCXX_HAVE_ENOMSG. Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/config/os/mingw32-w64/error_constants.h trunk/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc
Fixed on gcc trunk. Assuming no problems show up this is suitable for backporting to the branches, so I'll leave the bug open for now.
*** Bug 68307 has been marked as a duplicate of this bug. ***
Author: redi Date: Thu May 18 14:34:56 2017 New Revision: 248208 URL: https://gcc.gnu.org/viewcvs?rev=248208&root=gcc&view=rev Log: PR 71444 define more error constants for mingw-w64 Backport from mainline 2016-12-21 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/71444 * config/os/mingw32-w64/error_constants.h (address_family_not_supported, address_in_use, address_not_available) (already_connected, connection_aborted, connection_already_in_progress) connection_refused, connection_reset, cross_device_link) (destination_address_required, host_unreachable, message_size) (network_down, network_reset, network_unreachable, no_buffer_space) (no_protocol_option, not_a_socket, not_connected, operation_canceled) (operation_in_progress, operation_not_supported, protocol_error) (protocol_not_supported, too_many_links, too_many_symbolic_link_levels) (value_too_large, wrong_protocol_type): Define. (bad_message, identifier_removed, no_link, no_message_available) (no_message, no_stream_resources, not_a_stream, owner_dead) (state_not_recoverable, stream_timeout, text_file_busy): Define conditionally. * testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc: Guard test for no_message with _GLIBCXX_HAVE_ENOMSG. Modified: branches/gcc-6-branch/libstdc++-v3/ChangeLog branches/gcc-6-branch/libstdc++-v3/config/os/mingw32-w64/error_constants.h branches/gcc-6-branch/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc
Author: redi Date: Thu May 18 15:30:57 2017 New Revision: 248231 URL: https://gcc.gnu.org/viewcvs?rev=248231&root=gcc&view=rev Log: PR 71444 define more error constants for mingw-w64 Backport from mainline 2016-12-21 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/71444 * config/os/mingw32-w64/error_constants.h (address_family_not_supported, address_in_use, address_not_available) (already_connected, connection_aborted, connection_already_in_progress) connection_refused, connection_reset, cross_device_link) (destination_address_required, host_unreachable, message_size) (network_down, network_reset, network_unreachable, no_buffer_space) (no_protocol_option, not_a_socket, not_connected, operation_canceled) (operation_in_progress, operation_not_supported, protocol_error) (protocol_not_supported, too_many_links, too_many_symbolic_link_levels) (value_too_large, wrong_protocol_type): Define. (bad_message, identifier_removed, no_link, no_message_available) (no_message, no_stream_resources, not_a_stream, owner_dead) (state_not_recoverable, stream_timeout, text_file_busy): Define conditionally. * testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc: Guard test for no_message with _GLIBCXX_HAVE_ENOMSG. Modified: branches/gcc-5-branch/libstdc++-v3/ChangeLog branches/gcc-5-branch/libstdc++-v3/config/os/mingw32-w64/error_constants.h branches/gcc-5-branch/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc
Fixed for 5.5, 6.4 and 7.1