[2272] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

Re: #ifdef unix is wrong afaik

daemon@ATHENA.MIT.EDU (Richard Basch)
Sat Feb 22 10:06:57 1997

Date: Sat, 22 Feb 1997 10:05:45 -0500
To: Sam Hartman <hartmans@MIT.EDU>
Cc: krbdev@MIT.EDU
In-Reply-To: <199702220612.BAA23494@luminous.MIT.EDU>
From: "Richard Basch" <basch@lehman.com>

On Sat, 22-February-1997, "Sam Hartman" wrote to "probe@MIT.EDU, krbdev@MIT.EDU" saying:

> 
> 	So, at several places in the source tree, you have a #ifdef
> unix; I have always been told that this is the wrong way of doing
> things, and I tend to agree as it is giving me significant trouble at
> the moment.  In particular, AIX does not define unix, almost certainly
> because Ansi does not allow it to add to  the namespace in this
> manner.
> 
> 	In general, I would do something along the lines of the tests
> in port-socket.h, or if that is inappropriate for some reason, have
> some other define that we arrange to get set.  I'm removing all ifdef
> unixes for now, replacing with the moral equivelent of if not
> Windows.  If you have a better solution, feel free to implement.

Actually, I re-read your message.  comerr (et_[ch].awk) should stay
#ifdef unix.  Others may need changing, as necessary, but are likely to
need to be revamped based on new OS, such as VMS, MVS/OpenEdition, etc.
I would prefer to have #ifdef unix, as those sections are generally
Unix-centric.  In cases where it was unclear about other OS's such as
MVS/OpenEdition and VMS, I preferred the !WINDOWS style.  Anyway, as I
said, comerr should stay (or be made even more restrictive to the
platforms where we wish to maintain the bad interface).  The others are
arguable but I fear a proliferation of if not X and not Y and not Z and
not AA and not BB and not CC and not DD, where we are really trying to
define Unix-centric behavior.  In fact, in places where #ifdef unix is
wrong, it should not be #if not WINDOWS..., it should probably be made
into a configure variable, with #ifdef HAVE_XYZ.  Until now, I did not
know there were any Unix systems that did not define "unix"...

-- 
Richard Basch                   
Sr. Developer/Analyst, DSO      URL: http://web.mit.edu/basch/www/home.html
Lehman Brothers, Inc.           Email: basch@lehman.com, basch@mit.edu
101 Hudson St., 38th Floor      Fax:   +1-201-524-5828
Jersey City, NJ 07302-3988      Voice: +1-201-524-5049


home help back first fref pref prev next nref lref last post