Newsgroups: comp.sys.transputer
From: andyr@wizzy.com (Andy Rabagliati)
Subject: Re: OCCAM Compiler Directives
Organization: W.Z.I.
Date: Thu, 12 May 1994 23:22:13 GMT
Message-ID: <Cppq92.Dy5@wizzy.com>

In article <1994May12.174550.22108@jarvis.csri.toronto.edu>,
Manfred Sever <mse@wolverine.utias.utoronto.ca> wrote:
>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?

Well, I do this sometimes ..

SEQ
  IF
    TRUE -- FALSE
      ...  do this
    TRUE
      ...  do that
      

The compiler optimises the code out, I think.

Or, you could just run your favourite C pre-processor over it
beforehand. A small modification to your makefile ..

Cheers,     Andy.

