Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 __cplusplus macro override does not work

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
vvv444 Posted - Sep 12 2013 : 08:31:02 AM
Hi,

I have a Win32 Makefile project that uses the gcc compiler (it has full support for C++11). Thus, gcc defines __cplusplus macro to be "201103L" for my code. I wanted to "tell" that to Visual Assist.

For some other macro __Foo it works fine, I define the macro in project settings:


and the code is correctly parsed:

(note that the correct part was grayed out)

However, this does not work for __cplusplus macro. Even when it is defined as __cplusplus=201103L in project settings, the parser of Visual Assist still thinks it is "199711L".

Looking forward for your assistance.

Best,
Vasili
3   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Sep 16 2013 : 4:50:18 PM
Yes. That was my point. Both of these features are solely VS features, and we cannot fix them, unfortunately.
vvv444 Posted - Sep 15 2013 : 04:23:04 AM
Hi,

The graying out is not the problem, on the contrary, it is useful and I do want it to work. The problem is that it grays out the wrong part (because uses wrong value of __cplusplus variable).

However, the more serious problem is that it also starts parsing the wrong code and generates IntelliSense errors for the wrong code (that should have been grayed).

For example if I write:

#if __cplusplus < 201103L
#error "Foo"
#endif

IntelliSense will generate the Foo error in Error List window.

In any case, is there any way Visual Assist can help me with this or all this functionality is implemented solely by VS?

Best,
Vasili
accord Posted - Sep 13 2013 : 7:25:22 PM
The graying out part itself is a Visual Studio feature, and you can control it via the following option:

Tools -> Options... -> Text Editor -> C/C++ -> Formatting -> Show Inactive Blocks

Or does this cause other problems as well or just the coloring?


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