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 330513858C56 for ; Wed, 2 Nov 2022 16:51:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 330513858C56 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 1oqGxb-0006dk-1q; Wed, 02 Nov 2022 12:51:27 -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=LSEKu9BVfAioVvYEzKav1x7fM8w8ZL3oDOFiT3LwISc=; b=eRmtNCz03j7Z T8HiCLhr/jVjtU1SDwMy/bHjBVr3jWZzBfImhboRFtO6nvZqREcseSJYgknw/maJM4fg7dCzVbJuy ixT/wGulBUD+646AfAylOr8gkEdSQ/OHFRdZv6Wh5zTw7Ro/oJ0+F65aF16ZIwRNvXwRU3p5LI8Ak 6mqDmv+1qhJlF06NrQRf6w5bDsoCiYhnSDVqVWVz+whr6EHZF1FBV48ZCkgJlVJGcInyXMIX837ZU UF0aQcJ4jquAK7/FgICHkJ3VeOCNeWkfUNTI7pDfuh3/wUzvZPZkPGnTqGxo9R13WlLhgAh9C2Mao jk65ZISLfYioR9FvdgKynw==; 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 1oqGxa-0005rh-Gp; Wed, 02 Nov 2022 12:51:26 -0400 Date: Wed, 02 Nov 2022 18:51:17 +0200 Message-Id: <83fsf19u62.fsf@gnu.org> From: Eli Zaretskii To: i.nixman@autistici.org Cc: gdb@sourceware.org In-Reply-To: <821f45f4fe87dc1dcea23520dd8e42ab@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> 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 15:51:05 +0000 > From: i.nixman@autistici.org > > On 2022-11-02 15:18, Eli Zaretskii wrote: > > > Then the stuff in common-defs.h should be augmented to define > > _WIN32_WINNT to the value 0x0600 or greater, if it isn't already high > > enough, but only if the patch for gthreads is being used. How exactly > > to write the cpp conditional for that, I don't know, but hopefully you > > will be able to figure that out. > > no. > just for eyes: > 74 #if defined (__MINGW32__) || defined (__CYGWIN__) > 75 # ifdef _WIN32_WINNT > 76 # if _WIN32_WINNT < 0x0501 > 77 # undef _WIN32_WINNT > 78 # define _WIN32_WINNT 0x0501 > 79 # endif > 80 # else > 81 # define _WIN32_WINNT 0x0501 > 82 # endif > 83 #endif /* __MINGW32__ || __CYGWIN__ */ > > the condition on line 75 is always false, because none of the inclusions > above include neither `windows.h` nor `winver.h`. That's on your system, with your MinGW w32api headers. But that's not the only game in town. > it can be solved by inclusion `windows.h` after line 74. > but I did it and faced with another error: That's not what I suggested. I suggested that you augment the above cpp conditionals such that when the gthread patch is in use, _WIN32_WINNT is defined to 0x0600, and otherwise to 0x0501, as before. The question is: what could be a preprocessor conditional to determine whether the gthread patch is used, so that it could be used to augment the above. This is something I cannot answer, but I hope you can.