Silverfrost Logo About Us | Contact Us
 

C-Style Conditional Compilation

Alongside Silverfrost Conditional Compilation, FTN95 also offers a C-Style pre-processor. This processor makes use of the standard #if..#endif style of pre-processor directives. This pre-processing operates alongside the Silverfrost pre-processor and is not affected by its use. It is invoked by the use of

/CFPP

on the command line. The command line switches:

/VPARAM <name> <integer>
/DEFINE <name> <integer>

Can be used in conjunction with /CFPP to define values that can be used subsequently within conditional statements. Only integer values are accepted and used as part of the two statements above. Values set as part of these statements can be used interchangeably, that is a value defined by /DEFINE can be compared against one defined with /VPARAM.

The pre-processor can only be used for conditional compilation. Macro substitution is not supported.

#if..#ifdef..#ifndef..#elif..#else..#endif blocks are used to determine which portions of source code should be compiled depending on the logical result of expressions contained within the pre-processor statements

Pre-processor Statements

The following pre-processor statements are supported by FTN95:

#if (constant-expression)
#ifdef (param-name)
#ifndef (param-name)
#elif (constant-expression)
#else
#endif
#define (param-name) [(param-value)]
#undef (param-name)
#error (string)
#warning (string)
#include (quoted file name)

Nested single line statements may be constructed such as:

#if MACRO1 && (defined (MACRO2) || MACRO3 > 10)

Statements can be nested over multiple lines also.

Line continuations are not permitted

 

 

 

Copyright © 1999-2017 Silverfrost Limited