[cfe-dev] Possibilities with the Preprocessor API

Jacob Carlborg doob at me.com
Fri Oct 4 00:35:10 PDT 2013


This might be quite a vague question but I'm wondering what's possible 
to do with the preprocessor API in general.

For example, I would like to do a source to source translation of the 
following:

#if _WIN32
void foo (int);
#elif __APPLE__
void foo (long long);
#elif linux
void foo (long long);
#endif

To something like this:

version (Windows)
     void foo (int);
else version (OSX)
     void foo (long);
else version (linux)
     void foo (long);

Is that possible?

-- 
/Jacob Carlborg




More information about the cfe-dev mailing list