Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!rochester!pt.cs.cmu.edu!ius2.cs.cmu.edu!edw From: edw@ius2.cs.cmu.edu.UUCP Newsgroups: comp.lang.c Subject: Re: "unix" macro on System V? Message-ID: <1076@ius2.cs.cmu.edu> Date: Sun, 29-Mar-87 01:00:21 EST Article-I.D.: ius2.1076 Posted: Sun Mar 29 01:00:21 1987 Date-Received: Sun, 29-Mar-87 17:54:04 EST References: <317@aucs.UUCP> <318@aucs.UUCP> Distribution: na Organization: Carnegie-Mellon University, CS/RI Lines: 51 In article <318@aucs.UUCP>, peter@aucs.UUCP writes: > In 4.3BSD Unix C there is a macro called "unix" which may be used to > control compilation. E.g: > > #ifdef unix > ... do some unix dependent stuff ... > #else > ... do some generic stuff ... > #endif > Excuse me if I am misunderstanding your question, but conditional compulation (#ifdef, #ifndef and #if) is or at least should be support by every C compiler. example : . . #ifdef DEBUG printf("size %d\nn",size); #endif . . If you compile your code using -D option (cc -DDEBUG) the debugging code will be included. Nothing is sacred about the variable DEBUG. You can also do things like: #ifndef TRUE #define TRUE 1 #endif where if the macro TRUE is not defined already, it will be now. This will avoids all those anoying macro whatever is redefined messages from the compiler. If your question is however, does every unix compiler automatically define 'unix' for you, I do not know. -- Eddie Wyatt Those who know what's best for us- Must rise and save us from ourselves Quick to judge ... Quick to anger ... Slow to understand... Ignorance and prejudice and fear [all] Walk hand in hand. - RUSH