[PATCH] Conditionally include "<windows.h>" on common/pathstuff.c (and unbreak build on mingw*)

Eli Zaretskii eliz@gnu.org
Sat Mar 3 07:36:00 GMT 2018


> From: Sergio Durigan Junior <sergiodj@redhat.com>
> Cc: Eli Zaretskii <eliz@gnu.org>,  gdb-patches@sourceware.org,  simon.marchi@ericsson.com,  palves@redhat.com,  brobecker@adacore.com,  christophe.lyon@linaro.org
> Date: Fri, 02 Mar 2018 13:20:38 -0500
> 
> >>> +#ifdef USE_WIN32API
> >>> +#include <windows.h>
> >>> +#endif
> >>
> >> Isn't USE_WIN32API specific to gdbserver?  If so, perhaps it's better
> >> to use __MINGW32__ or _WIN32 instead?
> >
> > I see it defined in both gdb and gdbserver:
> >
> > https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/configure.ac;h=698fc7b83456f8c5a63ae0050dc8ec65069290f7;hb=HEAD#l1908
> > https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/gdbserver/configure.ac;h=99801681ff47ee8dcd9ad2e5ae282dcd113c83e4;hb=HEAD#l281
> 
> It's also present on common/filestuff.c, which is shared.  That's
> actually where I took the idea from.

Those could be mistakes due to moving stuff into common/.  So I think
we should decide what that symbol means and how to use it, and then
see if the practice somehow deviates from those rules.

I asked my question because AFAIR this symbol used to be only in
gdbserver sources.  If nowadays we can use it anywhere, then I'd
suggest to replace it with something common with GDB, because the
meaning of USE_WIN32API in the context of GDB is unclear to me.



More information about the Gdb-patches mailing list