Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 (Tek) 9/28/84 based on 9/17/84; site dadla.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!tektronix!teklds!dadla!rogers From: rogers@dadla.UUCP (Roger Southwick) Newsgroups: net.unix-wizards Subject: Re(cap): Which Unix? Message-ID: <237@dadla.UUCP> Date: Tue, 23-Apr-85 20:57:40 EST Article-I.D.: dadla.237 Posted: Tue Apr 23 20:57:40 1985 Date-Received: Thu, 25-Apr-85 07:52:56 EST Distribution: net Organization: Tektronix, Beaverton OR Lines: 78 [No matter where you go..... there you are. Buckaroo Banzai] Dear Fellow Gurus, I realize I'll probably get lots of flames for asking this observation (question) and making a (minor) suggestion, but here goes: 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. I seem to remember a few suggested methods, but I don't ever recall ONE method which would work under all cases (or did I miss this?). Anyway, given that there (probably) wasn't one submitted, I'd like to make the below suggested method for you all to consider, and make comment on. Please send me mail (don't post to the net) and I'll (try to) summarize and make a final posting later. 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: /* * This file contains a definition for the type * of Unix this machine is running under. * * There are defines for most known types of Unix * and then the UNIX define is set up in terms * of this. */ #define V6 0 #define PWB 1 #define V7 2 #define SYS3 3 #define 32V 4 #define BSD2_8 5 #define BSD4_1 6 #define SYS5 7 #define BSD2_9 8 #define BSD4_2 9 #define ULTRIX 10 #define P1003 11 /* /usr/group standard */ ... #define UNIX BSD4_2 Anyway, you get the idea. Then all programs would have to do is to include this file, then have lines like: #if UNIX == BSD4_2 I've tried (in the above) to basically stick to a cronological order as best as I can remember, (forgive me if I've got them out of order a bit) and I think this may be as good as any approach to future defines. Anyway, what do you all think? -Roger UUCP: ...!tektronix!dadla!rogers CSnet: rogers%dadla@tektronix ARPAnet: rogers%dadla%tektronix@csnet-relay BELLnet (phone): (503)-629-1911 SNAILnet (U.S. Mail): Roger Southwick Tektronix, Inc. P.O. Box 4600, D.S. 92-731 Beaverton, Oregon 97075