Including OS-specific code
If you need to include OS-specific code in your application, you can wrap it in an #ifdef to make the program more portable.
The qcc utility defines these preprocessor symbols (or manifest constants):
- The target is a QNX operating system (QNX 4, QNX Neutrino, or BlackBerry 10 OS).
- The target is the QNX Neutrino RTOS or BlackBerry 10 OS.
#if defined(__QNX__) /* QNX-specific (any flavor) code here */ #if defined(__QNXNTO__) /* QNX Neutrino-specific code here */ #else /* QNX 4-specific code here */ #endif #endif
For information about other preprocessor symbols that you might find useful, see the Manifests chapter of the BlackBerry 10 OS C Library Reference.