Jeff Collett <[EMAIL PROTECTED]> wrote:
> Would
> # pragma once work?

Of course not.

The problem here is that PilRC contains only a rudimentary preprocessor.
That's not too surprising, because PilRC's interests lie in being a
resource compiler, not a preprocessor.

"#define" is about the most commonly used feature in this preprocessor,
and the problem that's been encountered is that PilRC supports only a
subset of the expressiveness of the full C preprocessor's #define.
"#pragma once" is an obscure directive supported as an extension by
a few C preprocessors, and you can be sure that PilRC does not support
it, nor IMHO should it.

It'll probably be worth extending PilRC's subset so that "#define blah"
is accepted, even though "#define blah 1" is an entirely adequate work-
around.  Then next month someone will want macros with parameters.  And
next year someone else will want #pragma once.  Where does it all stop?
IMHO it would be a waste of effort to try to add a full preprocessor to
PilRC; and if you're going to use PilRC's approximation of a preprocessor
you probably need to learn to live with its limitations.

People who want the full C preprocessor know where to find it.

For example, with prc-tools 2.3 and a recent enough PilRC (a 3.0 beta
from within the last couple of weeks) you can write

        m68k-palmos-gcc -c foo.rcp

to have foo.rcp passed through a *real* preprocessor before it is given
to PilRC.  And that's the proper division of responsibilities! :-)

    John

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to