Subject: Re: ifdef's

From: Marc Paquette <[email-masked]>
Date: Sun, 30 Nov 1997 21:32:35 -0500

Let's ask principal porter of FSF Emacs on NT:

Geoff, what's the difference intended between DOSNT and WINDOWSNT ?

Hrvoje Niksic wrote:
> 
> I notice several different #ifdef styles in the sources:
> 
> #ifdef MSDOS
> 
> #ifdef DOSNT
> #ifdef WINDOWSNT
> 
> #ifdef HAVE_MS_WINDOWS
> 
> The first style is traditional, the second ones seem to stem from
> late-ish FSF sources (maybe from Ben's v19.30 synch), and the third
> one is ours.
> 
> Which one should we use?  I think it's important to have some sort of
> consistency, so we don't go insane!

I beleive that we could do the same thing with MSDOS specific code that
we did for VMS code, i.e. remove it completly.  Or will that compromise
running on Windows95 ?

HAVE_MS_WINDOWS is akin to HAVE_X_WINDOWS, i.e. it is window-system
specific, so it ought to be a different define that for os-specific
things.

> 
> --
> Hrvoje Niksic <[email-masked]> | Student at FER Zagreb, Croatia
> --------------------------------+--------------------------------
> Speak softly and carry a +6 two-handed sword.

-- 
Marc Paquette
[email-masked]

---

From: Hrvoje Niksic <[email-masked]>
Date: 01 Dec 1997 03:46:32 +0100

> we did for VMS code, i.e. remove it completly.  Or will that compromise

There should be an ifdef for Windows 95, too.  I have noticed things
commented out because "Windows 95 doesn't support them."  IMHO it
should all be ifdefed properly, e.g.:

...stuff pertaining to DOS...
#ifdef MSDOS

...stuff pertaining to DOS and any WINDOWS...
#ifdef DOSWINDOWS

...stuff pertaining to Windows NT or 95...
#ifdef MSWINDOWS

...stuff pertaining to Windows NT only...
#ifdef WINDOWSNT

...stuff pertaining to Windows 95 only...
#ifdef WINDOWS95

...stuff pertaining to Windows as a window-system (XEmacs-specific)...
#ifdef HAVE_MS_WINDOWS

That way, there would be no surprises.  For instance, the code to make 
file completions case-insensitive would be under #ifdef DOSWINDOWS.

> specific, so it ought to be a different define that for os-specific

Yes, but unlike Unix, Windows will always have a Window system.
Although, conceptually, one should be able to build an XEmacs without
support for a windowing system, running only in `-nw' mode (once that
is implemented under Windows), so I see your point.

-- 
Hrvoje Niksic <[email-masked]> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it."                                    -- Donald Knuth