Alternatives/Tools for #define hell C/C++ -
in our c/c++ project use configuration header (~1000 lines) full of #ifdef's , #defines
#if (defined(hw_1) || defined(some_technology_supported)) && defined(other_technology_supported) #define some_feature_available #endif
in our build configuration predefine defines passed compiler. results in different defines (like some_feature_aveilable) in our configuration header.
since our configuration header quite big, there bit of mess.
are there alternatives #define
hell?
or there tools see in case defines set.
we developing embedded firmware can't replace conditional compiling runtime if's.
in case #define
's in single configuration file, can try doing preprocessor-only compilation , finding defined macros. e.g.,
$ gcc -dfeature1 -dfeature2 -e configuration.h | grep '#define'
Comments
Post a Comment