[cfe-dev] Possibilities with the Preprocessor API

Manuel Klimek klimek at google.com
Sat Oct 5 06:39:17 PDT 2013


Yes. Look into PPCallbacks...


On Fri, Oct 4, 2013 at 9:35 AM, Jacob Carlborg <doob at me.com> wrote:

> 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
>
> ______________________________**_________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/**mailman/listinfo/cfe-dev<http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131005/fa9ea961/attachment.html>


More information about the cfe-dev mailing list