Re: [RFA] defs.h _WIN32 defined by Win98, too

Keith Seitz
2001-08-01T08:32:00Z

On Wed, 1 Aug 2001, Eli Zaretskii wrote:

> So you are saying that the same version of Cygwin defines _WIN32 on
> Windows 98, but not on W2K? isn't that strange?

Ah. I see what you're driving at. Hmmm... Ok, it certainly appears that
_WIN32 is being defined by cygwin. Nonetheless, we'll need to tweak gdb
until cygwin is fixed. (And I think we all agree about that.)

> > I don't
> > know (and frankly don't care) who is to blame. Gdb doesn't work on Win98.
>
> I don't argue with facts; it's clear that something breaks GDB. But I
> think we need to understand why does _WIN32 get defined on some systems,
> but not on others.

I admit, I admire your enthusiasm for this sort of thing, but I have
resigned myself not to linger on about cases where Win98/95 differs from
WinNT/2000. We could be hitting some whacko WIN32 API "feature". I admit
that I am very lame in this regard. I have wasted weeks trying to sort
messes out like this before.

> > As for eliminating SLASH_STRING, well, that's a much bigger and riskier
> > change than the simple, pragmatic approach I've taken.
>
> I didn't say eliminate SLASH_STRING, I said eliminate _WIN32. That is,
> make SLASH_STRING always be "/", but don't replace it with a literal "/".

Oh, ok, I see: just in case it is needed again, I suppose. That certainly
makes me a bit more comfortable than what I (mistakenly) thought you were
proposing.

In that case, I offer this alternative approach:

ChangeLog
2001-08-01 Keith Seitz <keiths@redhat.com>

* defs.h (SLASH_STRING): If not defined, set
to "/", regardless of _WIN32, __CYGWIN__, or
whatnot.

Patch
Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.57
diff -u -p -r1.57 defs.h
--- defs.h 2001/07/07 17:19:50 1.57
+++ defs.h 2001/08/01 15:32:06
@@ -1408,11 +1408,7 @@ extern int use_windows;
#endif

#ifndef SLASH_STRING
-#ifdef _WIN32
-#define SLASH_STRING "\\"
-#else
#define SLASH_STRING "/"
-#endif
#endif

/* Provide default definitions of PIDGET, TIDGET, and MERGEPID.

(Just wait until you see my next patch to fix gdb on win98! ;-)
Keith