I am currently hacking around on a new DRM system for my applications which – surprise, surprise – will include OTA wherever its possible (aka at MobiHand’s). As I need to use variable URL’s for each distributor, I felt like using the preprocessor.
As I stumbled across a few interesting things, I felt like sharing the code below:
#if defined MOBIHAND
#elif defined PALMGEAR
#error "no ESD Specified"
The first thing that I considered interesting is the #error macro – it allows you to stop the compilation process if some condition is not met. In the example above, the condition would be that no ESD flag is set. Furthermore, nesting definitions isn’t too easy either – the syntax involves the defined operator (which the PODS does NOT highlight).