Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!genrad!panda!talcott!harvard!seismo!brl-tgr!tgr!cottrell@nbs-vms.ARPA From: cottrell@nbs-vms.ARPA Newsgroups: net.unix-wizards Subject: which UNIX? Message-ID: <8358@brl-tgr.ARPA> Date: Wed, 20-Feb-85 15:22:47 EST Article-I.D.: brl-tgr.8358 Posted: Wed Feb 20 15:22:47 1985 Date-Received: Tue, 26-Feb-85 08:20:37 EST Sender: news@brl-tgr.ARPA Organization: Ballistic Research Lab Lines: 48 /* > If you need to know at compile time whether you're on a Berklix or > a System V system, this might help. It seems to work on all of our > systems, including the Pyramid split universe wonder: > > # include > # ifdef FNDELAY > # define BSD > # else > # define SYS5 > # endif > > This assumes that FNDELAY is not defined in the System V fcntl.h, and > is in the BSD. Can anyone think of a case where this is not true, or > suggest a more convenient/valid alternative? > "The closer you look, the worse it gets." Hopefully the C std will define once & for all the appropriate system names. In the meantime, one could make up one's own names, then define them in as follows: /* something.h */ #ifdef ___V4_1 #define ___OK #endif #ifdef ___V4_2 #define ___OK #endif #ifdef ___SYSV #define ___OK #endif #ifdef ___V6 #define ___OK #endif #ifdef ___V7 #define ___OK #endif #ifndef ___OK something horrible! ! % ^ & * ( ) - + = [ { } ] #endif #undef ___OK The user would be instructed to edit this file & define his system. All source files would include this file. Multiple defs could also be forbidden by this technique. Kinda gross tho. Oh well... jim */