Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 VA X not recognising pre-processor switches

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
sandylobban Posted - Jan 19 2011 : 06:40:44 AM
Hi, we have some pre processor switches set up in a config header file like so...

//config.h
#ifdef _PLATFORM
#define ENABLE_BOO 0
#define ENABLE_UTILS 1
#define ENABLE_LENS_FLARE 0
#define ENABLE_AUDIO 1

#else

#define ENABLE_BOO 0
#define ENABLE_UTILS 0
#define ENABLE_LENS_FLARE 0
#define ENABLE_AUDIO 0

#endif

When we include this header file into audio.cpp, and use for example...

#if ENABLE AUDIO

....some audio code

#endif

All of the code within this pre processor command is greyed out and greyed out anywhere that these preprocessor definitions are used in the code base. I have tried adding the PLATFORM and ENABLE_AUDIO preprocessor definitions to Project > Properties > Config properties > NMake > Preprocessor Definitions list.

That doesnt work. It looks like a bug of sorts in not picking up the pre procesoor def. Any ideas how to stop the code greying out? Visual assist still works with suggestions if I start typing and stuff within this greyed out code, but its not the best to read.


Any ideas, work arounds or fixes?
2   L A T E S T    R E P L I E S    (Newest First)
sandylobban Posted - Jan 20 2011 : 05:50:02 AM
Brilliant. Nice one feline. Working nicely now.

thanks alot.
feline Posted - Jan 19 2011 : 11:51:06 AM
VA does not attempt to show inactive code in a different colour, this is coming from the IDE its self:

IDE tools menu -> Options -> Text Editor -> C/C++ -> Formatting -> Colorize inactive code blocks in a different color

I have also seen this problem myself, sometimes the IDE can get confused and show active code as if it was inactive. Turning off the IDE option will stop this from happening.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000