Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Issue with 64-bit enums

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
BruteForce Posted - Oct 01 2009 : 07:06:43 AM
Hi,
I am trying to define a 64-bit enum and VAX doesn't seem to like it that much:



In case anyone is wondering, we use an enum for our error codes and the idea is to have an enum so that during debugging we can see nice symbolic names.
However, we shifted the actual error code to the upper 32-bits, so that with a few casts we can stuff other information in the low 32-bit bits, like the error code that GetLastError() returns.
It might seem a little unorthodox, but we are writing in C and it really simplifies the handling of all 'unexpected' errors that might occur for example because a Win32 API failed with something we have never dealt with before.
So now my VS source code windows are once again full of red underlines...
Any tricks to bypass this?

Warm Regards
Dimitris Staikos
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Oct 01 2009 : 11:06:49 AM
I am seeing the same effect here. Thank you for the clear description.

case=4839

I have found a form of workaround, but it is not brilliant. Changing the code to read:

#define ENUM_64BIT enum : unsigned __int64

typedef enum { item1, item2, item3 } VAX_OK;
typedef ENUM_64BIT { item11, item12, item13 } VAX_NOT_OK;


stops the underlining, but VA does not properly understand this. The colouring is correct on my test system, but I am not getting the enum items suggested when typing "y."

Note I have edited VA's "StdAfx.h" file as explained in this FAQ entry:

http://docs.wholetomato.com?W302

and add the entry:

#define ENUM_64BIT enum

at the bottom. This file is used to help VA's parser with difficult code, and can be used to work around odd effects. After modifying this file you need to rebuild the VA symbol database for the changes to take effect:

VA Options -> Performance -> General -> Rebuild symbol databases

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