Standalone C ++ Preprocessor

I am looking for a separate C ++ preprocessor. I will use it with another language, so it makes no sense to run a full-fledged compiler, but this is a very limited script language, so #define and #if and other directives will help me a lot.

For example, I would write a file like this:

#define DEBUG
do some stuff
#ifdef DEBUG
    show a message box or whatever
#endif
do some more stuff
+3
source share
3 answers

I found what fits my needs, mcpp . It is an easy-to-use preprocessor and supports output to other languages ​​thanks to the command line switch.

+3
source

What about the GNU C preprocessor?

+1
source

M4, , - C/++. , M4 , C/++.

+1
source

Source: https://habr.com/ru/post/1781443/


All Articles