Possibilities with the Preprocessor API

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?

Yes. Look into PPCallbacks…

Thanks, I'll have a look.