From patchwork Wed Dec 21 13:11:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 88733 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp2261579qgi; Wed, 21 Dec 2016 05:11:45 -0800 (PST) X-Received: by 10.99.22.65 with SMTP id 1mr7614009pgw.70.1482325905072; Wed, 21 Dec 2016 05:11:45 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id e8si26613496pgn.44.2016.12.21.05.11.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Dec 2016 05:11:45 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-444915-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-444915-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-444915-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=VBaGWRfL2MSvGvm0d QPtHbUOIU+iQdyD81GMD4Z/GsRBaVSplqCuUXeFw4Sg7qtADCoOmSBbZJ/sDv55i YMrTZgw6AGiKTYJxHhoXHuFeKucHSzQ7H7Mev9wNnylHhFrpDO+deykuR6lioHWL 12v0grXyb4PiA3TtUqTo9owcIA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=1UVkhXhzhTs5sYIcTFKMAwL +LS0=; b=OafZmWDf8ev9CZJkW00KahWHJrlHhjGiEX1b5SfQyd6re83r0rEYLP1 4kMF68VBiZHIQuKaPUdr2UkSU28E/lZHEui1sB2bVwuDA3sI0m8acVQ4Fd2QhwDD wtgJqZLFZB2fkImJqQK+nTbx9Oh+9bBs7TfG6iq7mpEm+Uiusfgc= Received: (qmail 661 invoked by alias); 21 Dec 2016 13:11:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 637 invoked by uid 89); 21 Dec 2016 13:11:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:jwakely X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Dec 2016 13:11:16 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A12986A6D5; Wed, 21 Dec 2016 13:11:14 +0000 (UTC) Received: from localhost (ovpn-116-120.ams2.redhat.com [10.36.116.120]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uBLDBDL7024142; Wed, 21 Dec 2016 08:11:13 -0500 Date: Wed, 21 Dec 2016 13:11:13 +0000 From: Jonathan Wakely To: niXman Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: Fix for libstdc++-v3's error_constants.h for MinGW-W64 Message-ID: <20161221131112.GS895@redhat.com> References: <5bad9c6fa54ca7c457a251ed83b639f7@autistici.org> <20161216130413.GD895@redhat.com> <6604bda6257e83aba7c5bfe0a1f86e08@autistici.org> <20161216202337.GH895@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20161216202337.GH895@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.7.1 (2016-10-04) On 16/12/16 20:23 +0000, Jonathan Wakely wrote: >On 16/12/16 16:28 +0300, niXman wrote: >>Jonathan Wakely 2016-12-16 16:04: >> >>>I don't think this is suitable for the branches, but could be applied >>>to trunk (as the patch was posted during stage 1, but I missed it). >>Ok. >> >>>Does this require a particular version of MinGW-w64? >>Yes, at the moment MinGW-W64 trunk is required. (MinGW-W64-v6) >> >>>Does it work for older versions? >>No. > >OK, how about this instead then? > >This unconditionally enables all the error codes supported by >mingw-w64 v5, and uses configure checks to detect the ones that are >only available on trunk. This means it will still work for v5, but if >you use trunk you get them all. I'm committing this. It should work for mingw-w64 v3.0.0 and later, but some constants are only defined for mingw-w64 trunk. Tested x86_64-linux, committed to trunk. commit 5615ca1afbe84adb8335c7b6e44b4619ceac129d Author: Jonathan Wakely Date: Wed Dec 21 12:44:14 2016 +0000 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. diff --git a/libstdc++-v3/config/os/mingw32-w64/error_constants.h b/libstdc++-v3/config/os/mingw32-w64/error_constants.h index 5cbf63c..f100373 100644 --- a/libstdc++-v3/config/os/mingw32-w64/error_constants.h +++ b/libstdc++-v3/config/os/mingw32-w64/error_constants.h @@ -41,22 +41,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // replaced by Winsock WSA-prefixed equivalents. enum class errc { -// address_family_not_supported = EAFNOSUPPORT, -// address_in_use = EADDRINUSE, -// address_not_available = EADDRNOTAVAIL, -// already_connected = EISCONN, + address_family_not_supported = EAFNOSUPPORT, + address_in_use = EADDRINUSE, + address_not_available = EADDRNOTAVAIL, + already_connected = EISCONN, argument_list_too_long = E2BIG, argument_out_of_domain = EDOM, bad_address = EFAULT, bad_file_descriptor = EBADF, -// bad_message = EBADMSG, +#ifdef _GLIBCXX_HAVE_EBADMSG + bad_message = EBADMSG, +#endif broken_pipe = EPIPE, -// connection_aborted = ECONNABORTED, -// connection_already_in_progress = EALREADY, -// connection_refused = ECONNREFUSED, -// connection_reset = ECONNRESET, -// cross_device_link = EXDEV, -// destination_address_required = EDESTADDRREQ, + connection_aborted = ECONNABORTED, + connection_already_in_progress = EALREADY, + connection_refused = ECONNREFUSED, + connection_reset = ECONNRESET, + cross_device_link = EXDEV, + destination_address_required = EDESTADDRREQ, device_or_resource_busy = EBUSY, directory_not_empty = ENOTEMPTY, executable_format_error = ENOEXEC, @@ -64,8 +66,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION file_too_large = EFBIG, filename_too_long = ENAMETOOLONG, function_not_supported = ENOSYS, -// host_unreachable = EHOSTUNREACH, -// identifier_removed = EIDRM, + host_unreachable = EHOSTUNREACH, +#ifdef _GLIBCXX_HAVE_EIDRM + identifier_removed = EIDRM, +#endif illegal_byte_sequence = EILSEQ, inappropriate_io_control_operation = ENOTTY, interrupted = EINTR, @@ -73,67 +77,84 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION invalid_seek = ESPIPE, io_error = EIO, is_a_directory = EISDIR, -// message_size = EMSGSIZE, -// network_down = ENETDOWN, -// network_reset = ENETRESET, -// network_unreachable = ENETUNREACH, -// no_buffer_space = ENOBUFS, + message_size = EMSGSIZE, + network_down = ENETDOWN, + network_reset = ENETRESET, + network_unreachable = ENETUNREACH, + no_buffer_space = ENOBUFS, #ifdef _GLIBCXX_HAVE_ECHILD no_child_process = ECHILD, #endif -// no_link = ENOLINK, +#ifdef _GLIBCXX_HAVE_ENOLINK + no_link = ENOLINK, +#endif no_lock_available = ENOLCK, -// no_message_available = ENODATA, -// no_message = ENOMSG, -// no_protocol_option = ENOPROTOOPT, +#ifdef _GLIBCXX_HAVE_ENODATA + no_message_available = ENODATA, +#endif +#ifdef _GLIBCXX_HAVE_ENOMSG + no_message = ENOMSG, +#endif + no_protocol_option = ENOPROTOOPT, #ifdef _GLIBCXX_HAVE_ENOSPC no_space_on_device = ENOSPC, #endif -// no_stream_resources = ENOSR, +#ifdef _GLIBCXX_HAVE_ENOSR + no_stream_resources = ENOSR, +#endif no_such_device_or_address = ENXIO, no_such_device = ENODEV, no_such_file_or_directory = ENOENT, no_such_process = ESRCH, not_a_directory = ENOTDIR, -// not_a_socket = ENOTSOCK, -// not_a_stream = ENOSTR, -// not_connected = ENOTCONN, + not_a_socket = ENOTSOCK, +#ifdef _GLIBCXX_HAVE_ENOSTR + not_a_stream = ENOSTR, +#endif + not_connected = ENOTCONN, not_enough_memory = ENOMEM, #ifdef _GLIBCXX_HAVE_ENOTSUP not_supported = ENOTSUP, #endif -// operation_canceled = ECANCELED, -// operation_in_progress = EINPROGRESS, + operation_canceled = ECANCELED, + operation_in_progress = EINPROGRESS, #ifdef _GLIBCXX_HAVE_EPERM operation_not_permitted = EPERM, #endif -// operation_not_supported = EOPNOTSUPP, + operation_not_supported = EOPNOTSUPP, #ifdef _GLIBCXX_HAVE_EWOULDBLOCK operation_would_block = EWOULDBLOCK, #endif -// owner_dead = EOWNERDEAD, +#ifdef _GLIBCXX_HAVE_EOWNERDEAD + owner_dead = EOWNERDEAD, +#endif permission_denied = EACCES, -// protocol_error = EPROTO, -// protocol_not_supported = EPROTONOSUPPORT, + protocol_error = EPROTO, + protocol_not_supported = EPROTONOSUPPORT, read_only_file_system = EROFS, resource_deadlock_would_occur = EDEADLK, resource_unavailable_try_again = EAGAIN, result_out_of_range = ERANGE, -// state_not_recoverable = ENOTRECOVERABLE, -// stream_timeout = ETIME, -// text_file_busy = ETXTBSY, +#ifdef _GLIBCXX_HAVE_ENOTRECOVERABLE + state_not_recoverable = ENOTRECOVERABLE, +#endif +#ifdef _GLIBCXX_HAVE_ETIME + stream_timeout = ETIME, +#endif +#ifdef _GLIBCXX_HAVE_ETXTBSY + text_file_busy = ETXTBSY, +#endif #ifdef _GLIBCXX_HAVE_ETIMEDOUT timed_out = ETIMEDOUT, #endif too_many_files_open_in_system = ENFILE, too_many_files_open = EMFILE, - too_many_links = EMLINK -// too_many_symbolic_link_levels = ELOOP, + too_many_links = EMLINK, + too_many_symbolic_link_levels = ELOOP, #ifdef _GLIBCXX_HAVE_EOVERFLOW - , - value_too_large = EOVERFLOW + value_too_large = EOVERFLOW, #endif -// wrong_protocol_type = EPROTOTYPE + wrong_protocol_type = EPROTOTYPE }; _GLIBCXX_END_NAMESPACE_VERSION diff --git a/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc index 636178e..20b5cce 100644 --- a/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc +++ b/libstdc++-v3/testsuite/19_diagnostics/headers/system_error/errc_std_c++0x.cc @@ -82,7 +82,9 @@ void test01() TEST_ERRC(no_message_available); #endif +#ifdef _GLIBCXX_HAVE_ENOMSG TEST_ERRC(no_message); +#endif TEST_ERRC(no_protocol_option); TEST_ERRC(no_space_on_device);