Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 __cplusplus macro override does not work
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

vvv444
New Member

2 Posts

Posted - Sep 12 2013 :  08:31:02 AM  Show Profile  Reply with Quote
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

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 13 2013 :  7:25:22 PM  Show Profile  Reply with Quote
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?

Go to Top of Page

vvv444
New Member

2 Posts

Posted - Sep 15 2013 :  04:23:04 AM  Show Profile  Reply with Quote
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
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 16 2013 :  4:50:18 PM  Show Profile  Reply with Quote
Yes. That was my point. Both of these features are solely VS features, and we cannot fix them, unfortunately.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000