{: .-three-column}
$ cpp -P file > outfile
#include "file"
#define FOO
#define FOO "hello"
#undef FOO
#ifdef DEBUG
console.log('hi');
#elif defined VERBOSE
...
#else
...
#endif
#if VERSION == 2.0
#error Unsupported
#warning Not really supported
#endif
#define DEG(x) ((x) * 57.29)
#define DST(name) name##_s name##_t
DST(object); #=> object_s object_t;
#define STR(name) #name
char * a = STR(object); #=> char * a = "object";
#define LOG(msg) console.log(__FILE__, __LINE__, msg)
#=> console.log("file.txt", 3, "hey")
Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️