From patchwork Thu Jul 12 17:12:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Durigan Junior X-Patchwork-Id: 28341 Received: (qmail 20635 invoked by alias); 12 Jul 2018 17:13:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 20616 invoked by uid 89); 12 Jul 2018 17:13:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Jul 2018 17:13:02 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8DFC14059FF4 for ; Thu, 12 Jul 2018 17:13:00 +0000 (UTC) Received: from psique.yyz.redhat.com (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1753A111AF0E; Thu, 12 Jul 2018 17:12:58 +0000 (UTC) From: Sergio Durigan Junior To: GDB Patches Cc: Sergio Durigan Junior Subject: [obvious/pushed] Declare 'ioarg' (from ser-tcp.c:try_connect) as 'u_long' when on Windows (and unbreak build on mingw32) Date: Thu, 12 Jul 2018 13:12:55 -0400 Message-Id: <20180712171255.8607-1-sergiodj@redhat.com> X-IsSubscribed: yes When building GDB on mingw32, it fails with: ../../binutils-gdb/gdb/ser-tcp.c: In function 'int try_connect(const addrinfo*, unsigned int*)': ../../binutils-gdb/gdb/ser-tcp.c:176:25: error: invalid conversion from 'int*' to 'u_long* {aka long unsigned int*}' [-fpermissive] ioctl (sock, FIONBIO, &ioarg); ^~~~~~ In file included from ../../binutils-gdb/gdb/serial.h:23:0, from ../../binutils-gdb/gdb/ser-tcp.c:21: /usr/x86_64-w64-mingw32/sys-root/mingw/include/winsock2.h:977:34: note: initializing argument 3 of 'int ioctlsocket(SOCKET, long int, u_long*)' WINSOCK_API_LINKAGE int WSAAPI ioctlsocket(SOCKET s,__LONG32 cmd,u_long *argp); ^~~~~~~~~~~ make[2]: *** [Makefile:1610: ser-tcp.o] Error 1 The problem happens because the IPv6 commit (c7ab0aef11d91b637bf091aa9176b8dc4aadee46) wrongly removed the code responsible for declaring 'ioarg' with a different type if building for Windows. This patch restores that. gdb/ChangeLog: 2018-07-12 Sergio Durigan Junior * ser-tcp.c (try_connect): Declare 'ioarg' as 'u_long' if building on Windows. --- gdb/ChangeLog | 5 +++++ gdb/ser-tcp.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 933a04e7fa..1a37862570 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2018-07-12 Sergio Durigan Junior + + * ser-tcp.c (try_connect): Declare 'ioarg' as 'u_long' if building + on Windows. + 2018-07-11 Sergio Durigan Junior Jan Kratochvil Paul Fertser diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index 8f165bcf0b..618d2d931a 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -171,7 +171,11 @@ try_connect (const struct addrinfo *ainfo, unsigned int *polls) return -1; /* Set socket nonblocking. */ +#ifdef USE_WIN32API + u_long ioarg = 1; +#else int ioarg = 1; +#endif ioctl (sock, FIONBIO, &ioarg);