Re(cap): Which Unix?

Joseph S. D. Yao jsdy at hadron.UUCP
Tue May 7 13:32:29 AEST 1985


> [No matter where you go..... there you are.  Buckaroo Banzai]
> 
> It seems to me that (when this was bandied about on the net
> a few weeks ago) there never was a EASY method for determining
> which version of UN*X a program was being compiled under.
> 	...
> What I'm proposing is for ALL UN*X systems to have a single
> (additional) include file: /usr/include/unix.h, which would
> contain something like:
> 		-Roger [Southwick]
> UUCP:			...!tektronix!dadla!rogers

Many but not all UNIces already have an include file <local/uparm.h>.
It does not bother to define a value for each type of UNIX, but just
tries to:
	#define	BSD4_1	/* N O T  BSD.4.1 !!! */
or
	#define SYSVR2
or whatnot, and then use:
	#ifdef	BSD4_1
		...
	#endif	BSD4_1	/* So who likes the ANSI restriction? */

Thus, you need not have a global update of all machines' uparm.h's:
just make sure that your symbol is a universally agreed-on one.
(What good is #ifdef BSD41 above?)  You may wish to define several
for particular things available on your machine (#define BSD4_2;
#define SCCS; #define RCS).

If you want to mess anybody who isn't in your list of machines:
	#ifdef	SYSVR1
		...
	# elif	BSD4_1	/* well, I do like most of ANSI. */
		...
	# else
		THIS WILL UPSET THE COMPILER!
	#endif	SYSTEMS			/* but not all. */

Anybody want to contribute the symbols for their machine that they
like best?

	Joe Yao		hadron!jsdy at seismo.{ARPA,UUCP}



More information about the Comp.unix.wizards mailing list