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 4B2203858D3C for ; Wed, 2 Nov 2022 13:27:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4B2203858D3C 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 1oqDlk-0008Kj-Ox; Wed, 02 Nov 2022 09:27:00 -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=lbIzMyQGBcW2bhR37Z6i6mJBBnAtcnj2gplIAOyALmc=; b=MoAh6P/aZPYA v0AyA3TP9UtIIZxjT966sW1WmOqtDuG7jaT+2oMXxd2rTRGA8mkAdll1QaKf/+8Mk+jKgzEPipPIz 3D++RgNP9Kx1Az6wuVxrCAwWUeZGqsyVIkHb4KZNDsj4cVGIVfWmfJ204Mwhbhk96LAcpbgIPTbpn NHBJUfOGe7MnfWI5Uageb2IA6WIQMKz48NOetdD3sMifAtNOQoVemdWy0lqhM60gxdpOTsrevLEvT dpootX9mePPdQCzFRgJCkccjUq+i/nW/Ni4eVRw90on+s1XbR/AcPEjO0S0v1J4h3lLyqDf1z9gOd bFnHBWT2r9meldqItRgQ9w==; 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 1oqDlk-0004nD-53; Wed, 02 Nov 2022 09:27:00 -0400 Date: Wed, 02 Nov 2022 15:26:49 +0200 Message-Id: <83sfj1a3mu.fsf@gnu.org> From: Eli Zaretskii To: noloader@gmail.com Cc: i.nixman@autistici.org, gdb@sourceware.org In-Reply-To: (message from Jeffrey Walton on Wed, 2 Nov 2022 09:10:21 -0400) Subject: Re: _WIN32_WINNT redefined? References: <6485dbfe07e21a1c451b17d3fda5b3d9@autistici.org> <41193fbdb742b1c2d4d7b4ab06561822@autistici.org> <6acd12904c2bedb0a96162354d1ee8dd@autistici.org> <83zgd9a4w7.fsf@gnu.org> X-Spam-Status: No, score=-1.6 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: > From: Jeffrey Walton > Date: Wed, 2 Nov 2022 09:10:21 -0400 > Cc: i.nixman@autistici.org, gdb@sourceware.org > > > > right, with commented out the entire PP block the build was successful! > > > > This is the wrong solution, IMO. > > Here's what Microsoft has to say about it: > https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt > " > > To modify the macros, in a header file (for example, in targetver.h, > which is included by some project templates that target Windows), > add the following lines. > > #define WINVER 0x0A00 > #define _WIN32_WINNT 0x0A00 > > If I am reading that correctly, there should be a common header file > which defines WINVER and _WIN32_WINNT. In my old MFC days, we would > set it in a file like . In a non-MFC project, we would set > it under the Visual Studio preprocessor macros, which is just > CPPFLAGS. I believe we use common-defs.h as that common header. > Maybe there needs to be a configure option to set the values. What for? I see no reason to expose this complexity to people who configure GDB. The underlying problem here is that one of the two flavors of MinGW has its headers (and _WIN32_WINNT in particular) set for Widows 9X, and GDB no longer supports those old versions. So we force the w32api headers of that MinGW flavor to expose the parts that are supported on Windows XP and later. If the w32api headers are set for a higher value of _WIN32_WINNT (as the other MinGW flavor already does), then the offending part of common-defs.h should be a no-op. Why this didn't work for the OP is unclear. Until it is clear, IMO we are not ready to have a rational discussion of the solutions for the issue.