Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

I have a config file with a lot of defines that are used to include modules during the complie time. In addition this means that I have to check very oft inside of the code for defines. Every check requires 3 lines is it possible to do this in one line.

#if FUNC_ENABLED
function_optional_call();
#endif

I'm looking for something like.

CALL(function_optional_call(),FUNC_ENABLED);

Is there a makro possible doing this or do I have to use the 3 line expression. I know its possbile to define a makro for every makro.

Skip function call if not definedSkip function call if not defined

But is it possible to generate a generall makro.

I have a config file with a lot of defines that are used to include modules during the complie time. In addition this means that I have to check very oft inside of the code for defines. Every check requires 3 lines is it possible to do this in one line.

#if FUNC_ENABLED
function_optional_call();
#endif

I'm looking for something like.

CALL(function_optional_call(),FUNC_ENABLED);

Is there a makro possible doing this or do I have to use the 3 line expression. I know its possbile to define a makro for every makro.

Skip function call if not defined

But is it possible to generate a generall makro.

I have a config file with a lot of defines that are used to include modules during the complie time. In addition this means that I have to check very oft inside of the code for defines. Every check requires 3 lines is it possible to do this in one line.

#if FUNC_ENABLED
function_optional_call();
#endif

I'm looking for something like.

CALL(function_optional_call(),FUNC_ENABLED);

Is there a makro possible doing this or do I have to use the 3 line expression. I know its possbile to define a makro for every makro.

Skip function call if not defined

But is it possible to generate a generall makro.

Source Link
Schafwolle
  • 531
  • 4
  • 16

One line #if statement

I have a config file with a lot of defines that are used to include modules during the complie time. In addition this means that I have to check very oft inside of the code for defines. Every check requires 3 lines is it possible to do this in one line.

#if FUNC_ENABLED
function_optional_call();
#endif

I'm looking for something like.

CALL(function_optional_call(),FUNC_ENABLED);

Is there a makro possible doing this or do I have to use the 3 line expression. I know its possbile to define a makro for every makro.

Skip function call if not defined

But is it possible to generate a generall makro.