I have:
I need:
A tool (online for example) that will simply do the instantiation of the MACROS (or the system of macros) and show the resultant code.
Example:
Input:
#define AAA(a,b) if ((a) > (b))
AAA(1, f1(10))
Output:
if ((1) > (f1(10)))
In simple terms, a C Preprocessor is just a text substitution tool and it instructs the compiler to do required pre-processing before the actual compilation. We'll refer to the C Preprocessor as CPP. All preprocessor commands begin with a hash symbol (#).
In the C Programming Language, the #ifdef directive allows for conditional compilation. The preprocessor determines if the provided macro exists before including the subsequent code in the compilation process.
Pass gcc the -E option. This will output preprocessed source code. If your compiler commands already has a parameter like -o something.o you may also want to change it to -o something.
The #ifndef directive checks whether a macro is not defined. If the identifier specified is not defined as a macro, the lines of code immediately follow the condition are passed on to the compiler.
The gcc
option would be -E and then your filename.
With the MSVC cl.exe
the solution is also /E.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With