Im working on WPF project with C++ and C#. I have written .idl file for communicating between these modules. I defined one enum like
typedef enum Samp{
Samp1 =1,
Samp2 =2,
Samp3 =4,....
Samp32=4294967296
}SampEnum;
each enum representing a number with only 1 bit set, now i need to add more enums, now it is taking 32 bit as default but i need to convert it to 64, how to change it. I tried these methods but all are giving compiler errors.
1st way is
i declared typedef for unsigned long long
typedef unsigned long long typeUll;
and tried to use this inside enum as
typedef enum Samp{
Samp1 =typeUll(1),
Samp2 =typeUll(2),
....
}SampEnum;
2nd way is using @bit_bound, i found in some link to use @bit_bound(64) like this
@bit_bound(64)
bitmask MyBitMask
{
@position(0) flag0,
@position(1) flag1,
@position(2) flag2,
@position(3) flag3,
...
@position(63) falg63
};
they mentioned like if we use @bit_bound this way, it will be converted to —->
enum MyBitMask : uint64_t
{
flag0 = 1 << 0,
flag1 = 1 << 1,
flag2 = 1 << 2,
flag3 = 1 << 3,
....
flag63 = 1<<63
};
For both im getting compiler errors. Can anyone help on this how to resolve this for supporting 64 bits in enum inside .idl files