You won't be able to use the MSL C offsetof() directly since the #include
chain for <cstddef> includes a whole bunch of Mac OS stuff not supported on
the Palm OS. But you could use your own offsetof () macro. Using the MSL
version as an example:
#define offsetof(type, member) ((__std(size_t)) &(((type *) 0)->member))
__std(size_t) merely returns size_t, which in the Palm OS 3.1 SDK is defined
to be of size DWord, and UInt16 in Palm OS 3.5, I think. Therefore:
#define offsetof (type, member) ((DWord) &(((type*) 0)->member))
BTW, I don't know for sure if the SDKs actually have an equivalent function
but you may want to check that first before hacking this in.
Rgds,
Jun-Kiat Lam
Metrowerks Technical Support
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Silvia
Brunet
Sent: Tuesday, July 11, 2000 4:55 PM
To: Palm Developer Forum
Subject: CodeWarrior R6 and C utilities
I am trying to use the function offsetof() function in this call
DmWrite(ptrRecord, offsetof(DelivRecord, SignID),SIGN,sizeof(SIGN));
before I used CodeWarrior R5 and I included #include <cstddef.h>
Well, now I am upgrading my application doing some modification and
recompiling it
with CodeWarrior R6 and I get all sort of compiling errors because of
including cstddef.h
errors on _stddef.h declaration errors and all sort of really wired stuff
since this are C standard
libraries. Do I need to be using another function or other libraries that
support the offsetof()
function under CWR6???????????
HELP PLEASE
*********************************************
Silvia Brunet-Jones
Lighthouse Technologies, Inc.
www.lhtek.com
[EMAIL PROTECTED]
*********************************************
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/