BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 12-22-2010, 09:17 AM   #1 (permalink)
New Member
 
Join Date: Dec 2010
Model: 9500
PIN: N/A
Carrier: airtel india
Posts: 3
Post Thanks: 1
Thanked 0 Times in 0 Posts
Exclamation regarding Blackberry preprocessor in eclipse

Please Login to Remove!

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?
Offline  
Old 12-22-2010, 09:31 AM   #2 (permalink)
Grumpy Moderator
 
NJBlackBerry's Avatar
 
Join Date: Aug 2004
Location: Somewhere in the swamps of Jersey
Model: iPh6
Carrier: AT&T
Posts: 27,821
Post Thanks: 33
Thanked 442 Times in 382 Posts
Default Re: regarding Blackberry preprocessor in eclipse

Moved to Developer Forum
Offline  
Old 12-22-2010, 09:51 AM   #3 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default Re: regarding Blackberry preprocessor in eclipse

There is no runtime performance issue with preprocessor directives - the excluded code does not appear in the compiled object, so it is not a factor.
Offline  
The Following User Says Thank You to Dougsg38p For This Useful Post:
arinv1618beta (12-22-2010)
Old 12-22-2010, 01:36 PM   #4 (permalink)
New Member
 
Join Date: Dec 2010
Model: 9500
PIN: N/A
Carrier: airtel india
Posts: 3
Post Thanks: 1
Thanked 0 Times in 0 Posts
Talking Re: regarding Blackberry preprocessor in eclipse

Thanks. That was exactly what I was looking for!
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads for: regarding Blackberry preprocessor in eclipse
Thread Thread Starter Forum Replies Last Post
HOWTO: Use BlackBerry on Generic NON-BlackBerry Data Plan Mark Rejhon BlackBerry Network 92 03-08-2014 12:26 PM
Perform a cutover to another BlackBerry Enterprise Server in IBM Lotus Domino hdawg BES Admin Corner 3 04-25-2008 10:47 AM
New to BES admin , need help with messages. bigwig BES Admin Corner 5 10-17-2007 11:59 AM
BES 4.1 SP2 for Microsoft Exchange - Now Available jibi BES Admin Corner 51 01-10-2007 10:30 AM
BES Domino 4.0 SP2 rsun BES Admin Corner 12 08-25-2005 02:27 PM





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.