Each target in the project file can specify a "prefix file" that
automatically gets included when that target is built. You can set up a
prefix file for your Palm OS targets that defines __palmos__.
I know this isn't exactly what you're asking for, but it's pretty darn
close.
-- Keith Rollin
-- Palm OS Emulator engineer
"David Williams" <[EMAIL PROTECTED]> on 05/12/99 02:34:50 PM
Please respond to [EMAIL PROTECTED]
Sent by: "David Williams" <[EMAIL PROTECTED]>
To: Michael Yam <[EMAIL PROTECTED]>
cc: [EMAIL PROTECTED] (Keith Rollin/HQ/3Com)
Subject: Re: does CodeWarrior predefine a preprocessor symbol when
building for Palm?
Jun-Kiat Lam wrote:
>
> ....<Pilot.h> uses __PALMOS_TRAPS__....
Michael Yam wrote:
>
> #if defined (EMULATION_LEVEL) && (EMULATION_LEVEL == EMULATION_NONE)
> ..
> #endif
> Those symbols are defined when compiling Palm OS applications.
These are all good suggestions, the problem with them is that all of these
macros are defined _in_ the Palm header files. We write a lot of code that
needs to be compiled on multiple platforms (PalmOS, WindowsCE/95/NT, Unix).
It
would be nice if the inclusion of the Palm headers themselves could be made
conditional based on the compiler's built in knowledge of the environment.
Like so:
#ifdef __palmos__
#include <Pilot.h>
#endif
where __palmos__ is predefined by the compiler.
djw