8.4.2 Constructs

The following C declarations and statements are recognized:

denes
denes are changed into pascal constants if they are simple denes. macros are changed - wherever possible to functions; however the arguments are all integers, so these must be changed manually. Simple expressions in dene staments are recognized, as are most arithmetic operators: addition, substraction, multiplication, division, logical operators, comparision 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.

typedef
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 an array of const argument.
speciers
The extern specier is recognized; however it is ignored. the packed specier is also recognised and changed with the PACKRECORDS directive. The const specier is also recognized, but is ignored.
modiers
If the -w option is specied, then the following modiers are recognized:
STDCALL  
CDECL  
CALLBACK  
PASCAL  
WINAPI  
APIENTRY  
WINGDIAPI

as dened in the win32 headers. If additionally the -x option is specied then the

SYS_TRAP

specier is also recognized.

enums
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 enus to a series of integer constants.
unions
unions are changed to variant records.
structs
are changed to pascal records, with C packing.