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

后端 未结 11 2213
太阳男子
太阳男子 2020-12-15 16:03

If I want to define a value only if it is not defined, I do something like this :

#ifndef THING
#define THING OTHER_THING
#endif

What if

11条回答
  •  囚心锁ツ
    2020-12-15 16:29

    As mentioned before this is not included in the C++ standard, but you might be able to use autotools to get the same functionality.

    You could use the ac_cxx_bool macro to make sure bool is defined (or different routines for different datatypes).

提交回复
热议问题