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
 conditional namespace definition not recognized
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sl@sh
Tomato Guru

Switzerland
204 Posts

Posted - Jan 15 2007 :  05:54:38 AM  Show Profile  Reply with Quote
For switching between different implementations of an interface I am using namespaces like this:


#ifdef NEW_VERSION
namespace new_version_namespace
#else
namespace old_version_namespace
#endif
{
    int Foo();
    void Bar();
}
#ifdef NEW_VERSION
using namespace new_version_namespace;
#else
using namespace old_version_namespace;
#endif


I have two different implementation files that I include in the project, but only the implementations of one of the namespaces will be used, depending on the define.

Unfortunately, VAX doesn't recognice the symbol new_version_namespace, regardless on whether or not the macro symbol NEW_VERSION is defined or not (not even when I place a #define right on top of the namespace definition). It's always underlined with a red wriggly line. If I use the namespace symbol though, and append a '::', I get prompted with a listbox of symbols defined in the namespace, so after all VA *does* know the symbol, it just pretends to not know it ....

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jan 15 2007 :  1:15:39 PM  Show Profile  Reply with Quote
The first part of the answer is this FAQ:

http://docs.wholetomato.com?W321

I am seeing the same underlining problem here, and was able to fix it by changing the code to read:

#ifdef NEW_VERSION
namespace new_version_namespace
{
#else
namespace old_version_namespace
{
#endif
	int Foo();
	void Bar();
}
#ifdef NEW_VERSION
using namespace new_version_namespace;
#else
using namespace old_version_namespace;
#endif


however I suspect this will cause problems, since the curly brackets are now unbalanced.

Which IDE are you using? I am seeing a different behaviour on "new_version_namespace::", specifically no completion listbox and the IDE complains about this being unknown.

zen is the art of being at one with the two'ness
Go to Top of Page

sl@sh
Tomato Guru

Switzerland
204 Posts

Posted - Jan 16 2007 :  03:26:22 AM  Show Profile  Reply with Quote
Interesting - I would have expected VAX to not recognize the namespace members correctly with imbalanced brackets within a define, that's why I didn't even try. However, this doesn't really fix the problem except for the underlining - for instance when I have a member function
int foobar(const char* name);
and choose it from the completion listbox after '::', VAX does not suggest any parameter list(s) for the function, even after explicitely typing ALT-TAB. When I just type
foobar(|)
however (someplace after the using statement), I get a suggestion listbox providing the correct parameter list (at the text cursor position marked by |).

IDE VS 2003

VA X Version Info:

VA_X.dll file version 10.3.1543.0 built 2006.12.19
Licensed to:
VA X: [email protected] (3-user license) Support ends 2007.09.23
VAOpsWin.dll version 1.3.4.1
VATE.dll version 1.0.5.5
DevEnv.exe version 7.10.3077.0
msenv.dll version 7.10.3077.0
Font: Courier New 13(Pixels)
Comctl32.dll version 5.82.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
2 processors

Platform: Win32
Stable Includes:
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\PlatformSDK\\include\\prerelease;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\PlatformSDK\\include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\SDK\\v1.1\\include;

Library Includes:
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\src\\mfc;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\src\\atl;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\crt\\src;

Other Includes:

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jan 16 2007 :  09:02:49 AM  Show Profile  Reply with Quote
I am seeing the same effect here. I have put in a case for the parameter info tooltips not appearing

case=4559

and I have also put in a case for the namespace name being underlined

case=4560

zen is the art of being at one with the two'ness
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