07-24-2023, 04:15 AM
I am trying to write something like this:
#define COV_ON(x) \
#ifdef COVERAGE_TOOL \
_Pragma (COVERAGE #x)
#endif
Is there any way to define `COV_ON` like this? I know what I have done above is wrong as I can't have `#ifdef` inside #define. (`#` is not an allowed character in `#define`).
So is there any solution?
#define COV_ON(x) \
#ifdef COVERAGE_TOOL \
_Pragma (COVERAGE #x)
#endif
Is there any way to define `COV_ON` like this? I know what I have done above is wrong as I can't have `#ifdef` inside #define. (`#` is not an allowed character in `#define`).
So is there any solution?