Loading...
Logo
Processing Forum
Hi,
is it possible to set compiler switches where are mode dependent?
I would write a application that are running on PC in JAVA MODE and on android phones in ANDROID MODE. I've been searching for an option like
#ifdef java_mode
or
#ifdef android_mode
on C.

Can I implement something like this in processing?

thankx

Replies(4)

No, but I have filed an enhancement request here to include this option.

Feel free to 'star' this issue to support the enhancement request.

I have commented your request
All right, we got a reply from Ben. Apparantly the MODE constant enhancement is covered by issue 281, but hasn't been implemented yet in the last two years. So it's accepted but low priority.
Such constant allows to change the behavior, not the compilation itself: if a method is available in one mode only, it will generate a compilation error in the other mode...
There is no pre-processing in Java (except by special softwares, then there are lot of them...)
Now, Processing offers an uniform interface, whatever the mode, so we don't need such conditional compilation.