Home |
RTTarget-32 Programming Manual Running Win32 Programs without Win32 Preprocessor Directives Running a Program on the Target Compiling and Linking with On Time RTOS-32 |
Preprocessor DirectivesRTLoc supports the following basic preprocessor commands with the same syntax as C/C++: #include <Filename> #include "Filename" #define Symbol [Value] #defineN Symbol Expression #undef Symbol #if Expression #elif Expression #else #endif #ifdef Symbol #ifndef Symbol #elifdef Symbol #elifndef Symbol #ifsection [ModuleName.]SectionName #elifsection [ModuleName.]SectionName #error String ## Expressions for #if and #elif are numeric unsigned 32-bit integers. The supported operators are: + - | & (high precedence) == > >= < <= || && (low precedence) Parenthesis are not supported. #defineN evaluates the specified Expression and then assigns the result to Symbol. By contrast, #define merely associates one string with another without any interpretation or evaluation. RTLoc will expand symbols defined with #define/#defineN or RTLoc's command line option -D. However, such expansions cannot change the number of tokens. A single token is always expanded to a new single token, whereby numeric expressions are considered a single token. The only exception are tokens generated through the token pasting operator ##. For example, the code: #define Test Left ## Right #error Test Would print the text: Error: LeftRight The following symbols are predefined: OUTNAME = <base output directory and file name without extension> APPLICATION = <Application name specified on RTLoc command line> RTT32_VER = <RTTarget-32 version multiplied by 100> RTLOC = TRUE TRUE = 1 FALSE = 0 #ifsection and #elifsection evaluate to true if section SectionName exists in the .EXE or .DLL specified by ModuleName. If no ModuleName is given, the main .EXE file is assumed.
|