Hi Group!
I have a doubt about blackberry preprocessing. I am using eclipse and maintaining a codebase which is compatible with both touch based devices and qwerty devices.
Now the well known problem with eclipse is... when you change the blackberry installed component of 4.5, it started showing out compilation errors for touch specific API parts even though I put them inside preprocessor blocks. Note that the same code dont give any error in JDE when compiled under 4.7 and 4.5.
I followed a tip which block comments the //#ifdef with two blocks of //ifndef.
Basically
Code:
//#ifdef MY_FLAG
my logic
//#endif
turned into
Code:
//#ifndef
/*
//#endif
mylogic
//#ifndef
*/
//#endif
so that the eclipse ignores the touch based code in 4.5 components.
now I have a question,
suppose I have a if-else block of preprocessor like this:
Code:
//#ifdef MY_FLAG
my logic for touch
//#elseif
my logic for qwerty
//#endif
can I rewrite this stuff like this:
Code:
//#ifndef MY_FLAG
/*
//#endif
my logic for touch
//#ifndef
*/
//#endif
//#ifndef MY_FLAG
my logic for qwerty
//#endif
so that instead of 1 if-else block, there are 2 if blocks now. Will there be any performance issue due to this? Basically, are they the same?