Re: [Mingw-users] Re: _WIN32?

Paul Hilfinger
2001-05-03T23:58:00Z

> Date: Thu, 03 May 2001 16:40:59 -0400
> From: Andrew Cagney <ac131313@cygnus.com>

> Remember, GDB is moving away from OS specific tests and towards
> autoconf/feature based tests. Things like this should be replaced by
> something like WITH_REALLY_TRICKY_FILESYSTEM_SUPPORT test (and
> eventually changed to a runtime switch?).

Has anyone considered going even further, and eliminating explicit
conditionals in .c files in favor of host/target-dependent #defines?
It's not always possible, of course, but I can see something like

if ((b->type == bp_catch_load)
#if defined(SOLIB_HAVE_LOAD_EVENT)
&& (!SOLIB_HAVE_LOAD_EVENT (inferior_pid)
|| ((b->dll_pathname != NULL)
&& (strcmp (b->dll_pathname,
SOLIB_LOADED_LIBRARY_PATHNAME (inferior_pid))
!= 0)))
#endif
)

turning instead into

if (b->type == bp_catch_load)
&& SOLIB_MAY_HAVE_LOADED (inferior_pid, b->dll_pathname))

> For reference, there are ~38 uses of _WIN32 in the sources, ~18 don't
> appear to be accompanied by #ifdef MSDOS, CYGWIN or GO32. It is those 18
> that I think should be deleted.

Is there any particular rush? There are apparently a couple of groups who
intend to spruce up the WIN32 stuff and get it working in GDB5. Why don't
we just agree that part of their sprucing up effort should be the removal of
these unsightly _WIN32 conditionalizations?

Paul Hilfinger