I have a problem. I want to set pointers to a default value for both 32 bit and 64 bit compiles. The 32-bit version works as:
enum constants { UNDEFINED = 0xDeadBeef }
if ((unsigned long)ptr == UNDEFINED)
but I can't seem to extend this to 64-bits. I've tried
#if __SIZEOF_POINTER__ == 4
enum constants { UNDEFDATA = 0xDeadBeef };
}; // enum constants
#elif __SIZEOF_POINTER__ == 8
enum constants { UNDEFDATA = 0xDeadBeefDeadBeef };
#endif
with:
if (ptr == UNDEFINED)
but get a message saying the '==' is undefined (I understand this)
Is there any way to setup so that I can change the size of my constants so that the comparisons will always work correctly? I've tried a 'typedef' but the compiler complains at
'typedef unsigned long long ADDR' // won't accept, and
static const SlipCellBase * const TEMPORARY = (SlipCellBase&)0xFFFFFFFFFFFFFFFF; // illegal conversion
enum doesn't work (because it's an int?) and I'm out of ideas.