From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id E01843858404 for ; Wed, 2 Nov 2022 18:14:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E01843858404 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqIFd-0004nT-6l; Wed, 02 Nov 2022 14:14:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=qwC8+LKMXFQw9Vlxv6CYyaX3c+5QvojYfUqAZ2vcN4Y=; b=naXtBCdNvSjs /+UJQpzOu8j1LGJecXNdSGGiJs8yInwjlmBxhnS+G38gW8GAtm8FMyPYAWuNoyQGIKlm46bM1IStw h16vw+V50onNz21XxOnL8D6lxUCKCDV/5hFNevqxYEs5+ESSrUTfmDhUqDlVJNbqzf3/VkLTWZuZ0 6OGt+uSx+Kf5vBt1h2NNptrj434iyDuEk135iy08JHgBuGfMpyJezugXc6RnyR2izzQri8bBVKp8k pesZLBVcpElU8BfY7w+nbh46cWeoBZL0azG2PUb3Myk4rKdAC90ptIcdmzSrxTn+soUMySN0t3uTl k/HE7vIk3jvzlPQ09295Yg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqIFc-00015o-LJ; Wed, 02 Nov 2022 14:14:08 -0400 Date: Wed, 02 Nov 2022 20:13:58 +0200 Message-Id: <838rkt9qc9.fsf@gnu.org> From: Eli Zaretskii To: i.nixman@autistici.org Cc: gdb@sourceware.org In-Reply-To: <0a2bab35dcbc1df695371814c7802ec6@autistici.org> (i.nixman@autistici.org) Subject: Re: _WIN32_WINNT redefined? References: <6485dbfe07e21a1c451b17d3fda5b3d9@autistici.org> <41193fbdb742b1c2d4d7b4ab06561822@autistici.org> <8335b1bjv2.fsf@gnu.org> <83h6zh9ygb.fsf@gnu.org> <821f45f4fe87dc1dcea23520dd8e42ab@autistici.org> <83fsf19u62.fsf@gnu.org> <0a2bab35dcbc1df695371814c7802ec6@autistici.org> X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Date: Wed, 02 Nov 2022 17:20:50 +0000 > From: i.nixman@autistici.org > > On 2022-11-02 16:51, Eli Zaretskii wrote: > > > That's on your system, with your MinGW w32api headers. But that's not > > the only game in town. > > I'm sure there is no WINAPI implementation that does not define > _WIN32_WINNT. it's just impossible. > but in line 75 the condition is exactly for that impossible case. It is not impossible. I use mingw.org's MinGW, where the header which defines _WIN32_WINNT is included by every header file. So as soon as you #include anything, _WIN32_WINNT is already defined. Maybe it isn't so in the headers you are using, but that doesn't mean it is so for everyone. And I don't see how is that relevant: even if _WIN32_WINNT is undefined before that place, my suggestion is to change this: # else # define _WIN32_WINNT 0x0501 into something that defines _WIN32_WINNT to 0x0600 under the condition that the gthread patch is being used, and to 0x0501 otherwise. This should solve everyone's problem, right? > What I'm doing now is trying to tell you that it's illogical to check > the value of _WIN32_WINNT BEFORE the corresponding header file in which > this value was originally defined, has been included. See above: that is not necessarily what happens, not in all the cases anyway.