Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: [RFA] Remove OS-specific defines (was: _WIN32?)
@ 2001-05-07 11:36 David Taylor
  0 siblings, 0 replies; 5+ messages in thread
From: David Taylor @ 2001-05-07 11:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: ac131313, danny_r_smith_2001, gdb, mingw-users, gdb-patches

    Date: Mon, 7 May 2001 19:10:59 +0300 (IDT)
    From: Eli Zaretskii <eliz@is.elta.co.il>

    I'm seeking approval for the following patches.  They remove all the
    DOS- and Windows-specific #ifdef's like "#ifdef _WIN32" and use the
    portable macros from filenames.h instead.  In addition, they convert
    code which used macros private to GDB, such as SLASH_P and ROOTED_P,
    to use the macros from filenames.h instead.

I was surprised that you sent this to gdb rather than gdb-patches.  I
added gdb-patches to the cc list.

    2001-05-07  Eli Zaretskii  <eliz@is.elta.co.il>

	    * source.c (mod_path, openp): Use HAVE_DOS_BASED_FILE_SYSTEM
	    instead of system-specific define's like _WIN32 and __MSDOS__.
	    Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH instead of SLASH_P and
	    ROOTED_P.
	    (top-level): #include "filenames.h".

	    * solib.c (solib_open): Use IS_DIR_SEPARATOR and IS_ABSOLUTE_PATH
	    instead of SLASH_CHAR, ROOTED_P and SLASH_P.
	    (top-level): #include "filenames.h".

	    * defs.h (SLASH_P, SLASH_CHAR, ROOTED_P): Remove definitions.
	    (SLASH_STRING): Define only for _WIN32.

The defs.h part of this patch is approved.

	    * completer.c: Use HAVE_DOS_BASED_FILE_SYSTEM instead of
	    __MSDOS_.

	    * cli/cli-cmds.c (cd_command): Use IS_DIR_SEPARATOR and
	    IS_ABSOLUTE_PATH instead of SLASH_P and ROOTED_P.  Replace
	    system-specific ifdefs with HAVE_DOS_BASED_FILE_SYSTEM.
	    (top-level): #include "filenames.h".


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: [Mingw-users] Re: _WIN32?
@ 2001-05-03 14:15 Danny Smith
  2001-05-03 15:24 ` Andrew Cagney
  0 siblings, 1 reply; 5+ messages in thread
From: Danny Smith @ 2001-05-03 14:15 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb, mingw-users

--- Andrew Cagney <ac131313@cygnus.com> wrote: > > ACT, Inc. is also committed
to producing or assisting in a MINGW32
> > port of GDB5, and contributing the necessary patches.  However, I
> > don't have a timetable for this yet.
> > 
> > In any case, again this argues against removing the _WIN32 conditionals.
> 
> I'm not so sure.  It depends on why/how the tests are there. For instance:
> 
> 
> #if defined(_WIN32) || defined(__MSDOS__) || defined(__CYGWIN__):
> 
> 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?).
> 
> 
> main.c:
>    /* The default command loop.
>       The WIN32 Gui calls this main to set up gdb's state, and
>       has its own command loop. */
> #if !defined _WIN32 || defined __GNUC__
>    /* GUIs generally have their own command loop, mainloop, or
>       whatever.  This is a good place to gain control because many
>       error conditions will end up here via longjmp(). */
> The _WIN32 test here is probably for wingdb (and old, long dead, MS 
> Windows based GDB) and not for mingw.  There are plenty of other 
> examples of the same thing.
> 
> 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.
> 
> 	Andrew
> 
>
In trying to get GDB to work under mingw, I have found the #if(n)def _WIN32 
useful as tags to look for potential trouble spots, but let me ask you to
clarify something:

You are proposing that something like this in inflow.c 

#ifndef _WIN32
  kill (PIDGET (inferior_pid), SIGINT);
#endif

would be replaced with something like this:

#ifndef _N0_KILL_
  kill (PIDGET (inferior_pid), SIGINT);
#endif

with configure defining _NO_KILL for me.

Is that correct?  If so, then I have no objections to replacing the _WIN32
conditionals with something more specific.

Danny

_____________________________________________________________________________
http://store.yahoo.com.au - Yahoo! Store
- It's time you had your business online!


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-05-07 11:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-07 11:36 [RFA] Remove OS-specific defines (was: _WIN32?) David Taylor
  -- strict thread matches above, loose matches on Subject: below --
2001-05-03 14:15 [Mingw-users] Re: _WIN32? Danny Smith
2001-05-03 15:24 ` Andrew Cagney
2001-05-07  9:09   ` [RFA] Remove OS-specific defines (was: _WIN32?) Eli Zaretskii
2001-05-07 10:39     ` Kevin Buettner
2001-05-07 11:23       ` Eli Zaretskii
2001-05-07 11:37         ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox