Newsgroups: comp.sys.transputer
From: raw@stardust.sj.unisys.com (Bob Wipfel)
Subject: Re: OCCAM Compiler Directives
Organization: Unisys Open Systems Group, San Jose
Date: 14 May 1994 02:11:14 GMT
Message-ID: <2r1c02$n88@ctnews2.sj.unisys.com>

In article <1994May12.174550.22108@jarvis.csri.toronto.edu>, mse@wolverine.utias.utoronto.ca
(Manfred Sever) writes:
|> Fellow Transputer users,
|> 
|> INMOS ANSI C allows compiler directives such as: ``#if defined'',
|> ``#elif defined'', ``#else'' and ``#endif'' so that the same source
|> code file can be compiled to yield object code, which is dependent on
|> what has been defined using the ``-D'' compiler switch.
|> 
|> The above can be a useful and powerful feature.
|> 
|> My question is:
|> 
|> HOW CAN THIS BE DONE USING THE OCCAM2 COMPILER?
|> I have read the manuals and there seems to be no
|> indication that a similar facility exists.
|> 
|> Am I going to have to write many slightly different versions of the
|> same OCCAM2 programme, where only ONE *.c file would have been
|> necessary?
|> 
|> What's the scoop?

You could have used the C pre-processor, cpp, if OCCAM didn't have its
own set of directives prefixed by `#'. So, failing that, there is an OCCAM
pre-processor called PREOCC that will do want you want. It recognises 
the #ifdef stuff, but doesn't get phased by OCCAM syntax like #USE. There
is probably a copy on Hensa, look out for postings from Dave Beckett at UKC
for ftp details etc.  

Bob.

-- 
|--------------------------\---------------------------------------------------|
| Bob Wipfel                \  Ski and Parapente the Wasatch Front             |
|                            \                                                 |
| UNISYS Corporation          \  Internet: raw@unislc.slc.unisys.com           |
| Distributed O/S Group        \  UUCP:    ...!{sun!sequent!ctnews}!unislc!raw |
| Scalable Parallel Processing  \  Phone:  +1 (801) 594 6281                   |
|--------------------------------\---------------------------------------------|

