Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Revision as of 04:33, 30 May 2013 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

How compile conditionally based on SDK

From Wiki
Jump to: navigation, search
Article Metadata
Created: nigel.brown (06 Mar 2008)
Last edited: hamishwillee (30 May 2013)

This tip explains how you can write SDK-conditional code

There are a number of macros for different SDKs, including __SERIES60_31__, __SERIES60_32__ etc. Unfortunately these aren’t available for all platforms and cannot be used in all file types (for example, mmp, bld.inf).

The solution is to define your own. Make a file called “blddef.h” and put whatever #defines in it you like and put it in epoc32\include. You can now include this in your source, mmp and bld.inf. Note, for the mmp and bld.inf, you need to use #include “blddef.h” and for the source files you need to use #include<blddef.h>

Then, you can just use #if defined(xxx) as normal.

This page was last modified on 30 May 2013, at 04:33.
28 page views in the last 30 days.