"Scott Johnson (Bellevue)" <[EMAIL PROTECTED]> wrote in message
news:33902@palm-dev-forum...
>
> In SDK 3.5 the trap numbers for core traps are defined in an enum called
> SysTrapNumber and Intl Mgr functions by an enum called IntlSelector.  (At
> least for CodeWarrior users; more on that below.)  These enums are handy
> because my C++ code overloads a certain constructor function on those two
> enum types.  In fact this usage is documented in my PalmSource 99 slides
at:
>
http://www.palmos.com/dev/news/events/palmsource/1999/data/track3/320_new.pd
> f
>
> But now in SDK 4.0 DR2, both those enums have been changed to a pile of
> individual #define macros.  And actually in 3.5, they were already
> separately defined as macros for the GCC compiler.  (Why?  Paging Dr.
> Marshall!  Does GCC not do enums properly in this case?)
>
> Anyway, this breaks my nice clean code that relied on SysTrapNumber and
> IntlSelector being distinct and overloadable types.  Now SysTrapNumber is
> gone and IntlSelector is just a typedef for UInt16.  I'm sure there's a
good
> reason for the change, but I'd like to learn just what it is.  I'm
guessing
> it's just to simplify to a single definition, accommodating GCC's apparent
> problem with these being enums.

Arghh, Scott... I can see this being frustrating.  However, I think I could
also explain why GCC wouldn't use the enum.  The enum definition is
something only understood by the C/C++ compiler.  Since the headers
implement the systraps on GCC using GCC's inline assembly which really is
just passed verbatim to the GNU assembler.  When GAS sees the code, the enum
would have no meaning, but a number expanded from a macro would work just
fine.

--
Ben Combee
Veriprise Wireless <http://www.veriprise.com>



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

Reply via email to