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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -