Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preprocessor directives supported by the RIM compiler

Tags:

blackberry

This isn't really clearly documented, but a shallow search reveals that RIM's RAPC compiler does support preprocessor statements (with some project file modification).

We've been using the simple #ifdef, #else, and #endif directives for quite some time now, as supporting platforms 4.1 through 4.7 with one code base is nearly impossible without them, but I began wondering recently if there are other supported directives which aren't quite as well documented; something akin to C's #elif for example, or even rudimentary equivalency directives?

like image 704
Andrey Butov Avatar asked Jul 24 '09 17:07

Andrey Butov


1 Answers

Here's a complete listing of commands for the RAPC preprocessor. The preprocessor's not very robust, but that's on purpose.

//#preprocess - Used to specify that the file should be preprocessed. It must be the first line of the file.

//#implicit tag - This needs to be on the second line of the file. If tag is part of the command line, then the whole file should be compiled. If not, then it should be excluded.

Then there's the //#ifdef tag ... #else ... #endif and the //#ifndef tag ... #else ... #endif directives that you mentioned.

Also note, there is no nesting of preprocessed blocks and no macros.

RIM Help Center Doc: http://docs.blackberry.com/en/developers/deliverables/21065/Specifying_preprocessor_directives_657636_11.jsp

like image 188
Fostah Avatar answered Oct 14 '22 10:10

Fostah