Unknown Enumeration List Definition

closed account (zb0S216C)
In the sourceannotations header, I've come across this enumeration list definition which puzzles me:

1
2
3
4
5
6
7
enum SA( AccessType )
{
    SA( NoAccess ) = 0,
    SA( Read ) = 1,
    SA( Write ) = 2,
    SA( ReadWrite ) = 3
};


Does anybody know what to make of this?

Wazzak
Could it be that SA is a macro?
closed account (zb0S216C)
It appears not. I used the Go To Definition in VCE 2010, and it took me to the above SA. However, there's more. Here it is:

1
2
3
4
5
6
7
8
9
10
// This is before the code above.
enum SA( YesNoMaybe )
{
	// Choose values that we can detect as invalid if they are or'd together
	SA( No ) = 0x0fff0001,
	SA( Maybe ) = 0x0fff0010,
	SA( Yes ) = 0x0fff0100
};

typedef enum SA( YesNoMaybe ) SA( YesNoMaybe );


Wazzak
Last edited on
It is a macro - and if your sourceannotations header file is the same as mine - you will find it a
few lines earlier in the header file - mine looks like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma push_macro( "SA" )
#pragma push_macro( "REPEATABLE" )

#ifdef __cplusplus
#define SA( id ) id
#define REPEATABLE [repeatable]
#else  // !__cplusplus
#define SA( id ) SA_##id
#define REPEATABLE
#endif  // !__cplusplus

#ifdef __cplusplus
namespace vc_attributes
{
#endif  // __cplusplus

enum SA( YesNoMaybe )
{
    // Choose values that we can detect as invalid if they are or'd together
    SA( No ) = 0x0fff0001,
    SA( Maybe ) = 0x0fff0010,
    SA( Yes ) = 0x0fff0100
};

typedef enum SA( YesNoMaybe ) SA( YesNoMaybe );

enum SA( AccessType )
{
    SA( NoAccess ) = 0,
    SA( Read ) = 1,
    SA( Write ) = 2,
    SA( ReadWrite ) = 3
};
closed account (zb0S216C)
Hmmmm...I never noticed that macro. Then why did Go To Definition take me to the enumeration list, and not the macro?

Wazzak
Topic archived. No new replies allowed.