This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] defs.h: Define GDB_DEFAULT_TARGET_[WIDE_]CHARSET for Cygwin and MingW builds
Corinna Vinschen <vinschen <at> redhat.com> writes:
> > Otherwise, should we use USE_WIN32API rather than _WIN32? It isn't
> > clear to me which is preferred.
>
> I really don't know. I wasn't involved in porting GDB to MingW.
> I see USE_WIN32API mainly used in gdbserver.c and ser-tcp.c so far.
> Guessing from the comment in configure.ac I assume that USE_WIN32API
> is the way to go.
Remember that _WIN32 can be defined, even on __CYGWIN__, if <windows.h> is
#included -- so _WIN32 is not, in general, a reliable indicator of "native
win32"-ness. (Conversely, if you HAVEN'T included <windows.h>, then on cygwin
_WIN32 is not defined -- which could be a problem if you really DO want to use a
native win32 api from cygwin, but the code is using _WIN32 to determine whether
to do so. 'Course, if you wanted to use a native win32 api, you really should
have included <windows.h> to get the API's declaration, but that's another
story).
--
Chuck