Bug 71444 - Error constants for MinGW-w64
Summary: Error constants for MinGW-w64
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 5.3.0
: P3 normal
Target Milestone: 5.5
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 68307 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-06-07 12:49 UTC by frankhb1989
Modified: 2017-05-18 15:33 UTC (History)
3 users (show)

See Also:
Host:
Target: mingw-w64
Build:
Known to work:
Known to fail:
Last reconfirmed: 2016-12-17 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description frankhb1989 2016-06-07 12:49:21 UTC
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?
Comment 1 Jonathan Wakely 2016-12-17 12:27:59 UTC
Proposed patch that enables all error codes in mingw-w64 v5 and above:

https://gcc.gnu.org/ml/gcc-patches/2016-12/msg01533.html
Comment 2 Jonathan Wakely 2016-12-20 23:07:42 UTC
In fact it looks like the patch should work for mingw-w64 v4, and maybe v3 too.
Comment 3 Jonathan Wakely 2016-12-21 13:09:47 UTC
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
Comment 4 Jonathan Wakely 2016-12-21 13:18:34 UTC
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.
Comment 5 Jonathan Wakely 2017-01-13 17:39:39 UTC
*** Bug 68307 has been marked as a duplicate of this bug. ***
Comment 6 Jonathan Wakely 2017-05-18 14:35:28 UTC
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
Comment 7 Jonathan Wakely 2017-05-18 15:31:29 UTC
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
Comment 8 Jonathan Wakely 2017-05-18 15:33:03 UTC
Fixed for 5.5, 6.4 and 7.1