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
 CryptoPP namespace problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

znakeeye
Tomato Guru

379 Posts

Posted - Jan 07 2010 :  03:45:11 AM  Show Profile  Reply with Quote
VAX 1649, VS 2008 SP1.

Download Crypto++ 5.6.0 and load any project using its classes. Anything following the namespace "CryptoPP" will not be parsed correctly.

E.g.
Underlined = not recognized by VAX.

CryptoPP::CBC_Mode<CryptoPP::AES>::Decryption decryptor(key, sizeof key, iv);

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 07 2010 :  2:39:05 PM  Show Profile  Reply with Quote
I was able to reproduce your problem, and made a workaround for this:

Just put these line into VA's stdafx.h:

#define NAMESPACE_BEGIN(x) namespace x {
#define NAMESPACE_END }

You can learn more about VA stdafx.h here:
http://docs.wholetomato.com?W302

With this workaround the underlines disappeared after I included these:
#include "config.h"
#include "modes.h"


In case you are interested, the cause of these underlines was that Visual Assist parses both #ifdef branches when evaluate them, for example:

#ifdef _DEBUG
int Apple;
#else
int Banana;
#endif

With a code like this Visual Assist parses both branches so will see both Apple and Banana. This is partly because it would be hard to determine which branch to use considering all circumstances, and partly because this way you can use VA's help f.e. when you are working on DEGUB branches but you had set a different configuration.

One side effect of this approach is that VA will use the first macro it sees, so if you have a marco in both branches, it will use the first.
In this concrete case config.h contains this:

#ifdef CRYPTOPP_DOXYGEN_PROCESSING
// Avoid putting "CryptoPP::" in front of everything in Doxygen output
#	define CryptoPP
#	define NAMESPACE_BEGIN(x)
#	define NAMESPACE_END
// Get Doxygen to generate better documentation for these typedefs
#	define DOCUMENTED_TYPEDEF(x, y) class y : public x {};
#else
#	define NAMESPACE_BEGIN(x) namespace x {
#	define NAMESPACE_END }
#	define DOCUMENTED_TYPEDEF(x, y) typedef x y;
#endif 


So VA would use the empty defines without the workaround.

Edited by - accord on Jan 07 2010 2:41:09 PM
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