public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: noloader@gmail.com
Cc: i.nixman@autistici.org, gdb@sourceware.org
Subject: Re: _WIN32_WINNT redefined?
Date: Wed, 02 Nov 2022 15:26:49 +0200	[thread overview]
Message-ID: <83sfj1a3mu.fsf@gnu.org> (raw)
In-Reply-To: <CAH8yC8mFh8Kde9OGd-uGCv5EDDRw+SnR+pHzm41dPW-Zpc8HrA@mail.gmail.com> (message from Jeffrey Walton on Wed, 2 Nov 2022 09:10:21 -0400)

> From: Jeffrey Walton <noloader@gmail.com>
> 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 <stdafx.h> . 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.

  reply	other threads:[~2022-11-02 13:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02  8:14 i.nixman
2022-11-02  8:21 ` i.nixman
2022-11-02  8:44   ` i.nixman
2022-11-02  9:46     ` i.nixman
2022-11-02 10:15       ` i.nixman
2022-11-02 12:59         ` Eli Zaretskii
2022-11-02 13:10           ` Jeffrey Walton
2022-11-02 13:26             ` Eli Zaretskii [this message]
2022-11-02 12:50       ` Eli Zaretskii
2022-11-02 14:13         ` i.nixman
2022-11-02 15:18           ` Eli Zaretskii
2022-11-02 15:51             ` i.nixman
2022-11-02 16:02               ` i.nixman
2022-11-02 16:51               ` Eli Zaretskii
2022-11-02 17:20                 ` i.nixman
2022-11-02 18:13                   ` Eli Zaretskii
2022-11-02 12:55     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83sfj1a3mu.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb@sourceware.org \
    --cc=i.nixman@autistici.org \
    --cc=noloader@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).