In C/C++, is there a directive similar to #ifndef for typedefs? -


if want define value if not defined, :

#ifndef thing #define thing other_thing #endif 

what if thing typedef'd identifier, , not defined? this:

#ifntypedef thing_type typedef uint32_t thing_type #endif 

the issue arose because wanted check see if external library has defined boolean type, i'd open hearing more general solution.

no there no such facility in c++ @ preprocessing stage. @ max can is

#ifndef thing_type #define thing_type uint32_t  #endif 

though not coding practice , don't suggest it.


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -