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
 Issue with 64-bit enums
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

BruteForce
Senior Member

Greece
32 Posts

Posted - Oct 01 2009 :  07:06:43 AM  Show Profile  Reply with Quote
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

When all else fails try common sense.

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Oct 01 2009 :  11:06:49 AM  Show Profile  Reply with Quote
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

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