Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 CryptoPP namespace problem

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
znakeeye Posted - Jan 07 2010 : 03:45:11 AM
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);
1   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Jan 07 2010 : 2:39:05 PM
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.

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