From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59636 invoked by alias); 30 Apr 2019 17:04:02 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 59628 invoked by uid 89); 30 Apr 2019 17:04:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: mail-wm1-f46.google.com Received: from mail-wm1-f46.google.com (HELO mail-wm1-f46.google.com) (209.85.128.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 Apr 2019 17:04:01 +0000 Received: by mail-wm1-f46.google.com with SMTP id h18so4648476wml.1 for ; Tue, 30 Apr 2019 10:04:00 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id i30sm4387034wrc.8.2019.04.30.10.03.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 10:03:58 -0700 (PDT) Subject: Re: Fix compilation using mingw.org's MinGW To: Eli Zaretskii , LRN References: <835zrbe36c.fsf@gnu.org> <250801eb-14f6-5a35-0556-cf5797dd8a7b@redhat.com> <83y347cfbu.fsf@gnu.org> <556cefd7-47ce-54ab-a228-2c727aab4179@redhat.com> <83d0lick7o.fsf@gnu.org> <93ccb0fa-8a05-60ff-d1a8-85d5663b8d16@redhat.com> <831s1murm2.fsf@gnu.org> <365578d2-82fb-8860-26e6-1b31a63632ed@gmail.com> <83imuvsefv.fsf@gnu.org> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <014135c5-5bb8-d451-ec7a-6d765b1ea5f5@redhat.com> Date: Tue, 30 Apr 2019 17:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <83imuvsefv.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-04/txt/msg00658.txt.bz2 On 4/30/19 4:25 PM, Eli Zaretskii wrote: >> From: LRN >> Date: Tue, 30 Apr 2019 16:05:55 +0300 >> >>> - IIRC, Cygwin uses the same w32api headers as mingw.org. I don't know >>> whether Cygwin sets _WIN32_WINNT to a higher number already; we >>> haven't heard any complaints, so I guess it does. >>> >> >> Cygwin uses mingw-w64. > > Maybe I'm missing something, but I don't think this is relevant. > _WIN32_WINNT is not a MinGW invention, it's an official symbol in > Windows headers, so all Windows compilers need to support it in the > same way and with the same semantics. The only difference is the > default value. > > Am I missing something? > The issue is where is that default set? On my Fedora mingw-w64 cross, it is not set by default by the compiler: $ x86_64-w64-mingw32-gcc -x c /dev/null -dM -E | grep _WIN32_WINNT $ (empty) It seems to be set instead in the headers, in include/sdkddkver.h. I guess that if Cygwin indeed uses mingw-w64 headers nowadays, it won't need the fix as long as the headers default to a higher version than gdb requires. Pedantically, I think we should tweak the "#ifdef __MINGW32__" to consider Cygwin too, since the Cygwin ports also pulls in w32api headers, but if it doesn't matter in practice, and it's not convenient to test, then we can simply forget about it until a time when someone notices something odd. Thanks, Pedro Alves