8.4.2 Constructs

The following C declarations and statements are recognized:

Defines are changed into Pascal constants if they are simple defines. Macros are changed - wherever possible - to functions; however the arguments are all integers, so these must be changed manually. Simple expressions in define staments are recognized, as are most arithmetic operators: addition, substraction, multiplication, division, logical operators, comparison operators, shift operators. The C construct ( A ? B : C) is also recognized and translated to a Pascal construct with an IF statement. (This is buggy, however).
preprocessor statements
The conditional preprocessing commands are recognized and translated into equivalent Pascal compiler directives. The special
#ifdef __cplusplus

is also recognized and removed.

A typedef statement is changed into a Pascal type statement. The following basic types are recognized:

These types are also changed if they appear in the arguments of a function or procedure.

functions and procedures
Functions and procedures are translated as well. Pointer types may be changed to call by reference arguments (using the var argument) by using the -p command line argument. Functions that have a variable number of arguments are changed to a function with a cvar modifier. (This used to be the array of const argument.)
The extern specifier is recognized; however it is ignored. The packed specifier is also recognised and changed with the PACKRECORDS directive. The const specifier is also recognized, but is ignored.
If the -w option is specified, then the following modifiers are recognized:

as defined in the win32 headers. If additionally the -x option is specified then the


specifier is also recognized.

Enum constructs are changed into enumeration types. Bear in mind that, in C, enumeration types can have values assigned to them. Free Pascal also allows this to a certain degree. If you know that values are assigned to enums, it is best to use the -e option to change the enumerations to a series of integer constants.
Unions are changed to variant records.
Structs are changed to Pascal records, with C packing.