J
joseph cook
The recent discussion on PIMPL and opaque pointers made me think about
a construct I have seen commonly with respect to defining types on a
platform by platform basis. Unlike structs, obviously types needs to
be 'complete' in header files for ease of use.
What I mean is something like the following...
#ifdef PLATFORM1
typedef unsigned long unsigned64;
....
#elseif PLATFORM2
typedef unsigned long long unsigned64;
#endif
That way you can ensure that a given type is the same size,
independent of platform.
With all the vitriol against "#if", etc, does anyone have any other
methods for achieving the same sort of effect?
Thanks
a construct I have seen commonly with respect to defining types on a
platform by platform basis. Unlike structs, obviously types needs to
be 'complete' in header files for ease of use.
What I mean is something like the following...
#ifdef PLATFORM1
typedef unsigned long unsigned64;
....
#elseif PLATFORM2
typedef unsigned long long unsigned64;
#endif
That way you can ensure that a given type is the same size,
independent of platform.
With all the vitriol against "#if", etc, does anyone have any other
methods for achieving the same sort of effect?
Thanks