Re: deprecated FOUR_CHAR_CODE and macintel
Re: deprecated FOUR_CHAR_CODE and macintel
- Subject: Re: deprecated FOUR_CHAR_CODE and macintel
- From: Eric Albert <email@hidden>
- Date: Thu, 12 Jan 2006 10:46:32 -0800
On Jan 12, 2006, at 3:35 AM, Olivier Tristan wrote:
I've just seen that FOUR_CHAR_CODE do not handle endianess on macintel
just as written in the docs.
By the way it's so used in general in mac apps that I find this a bit
lame but whatever...
So I was wondering which function should I use to get the same results
and which handle endianess of course ?
This is a very common misconception. FOUR_CHAR_CODE has never done
anything useful on the Mac at all. If you look carefully at
ConditionalMacros.h (or whichever header defines it), you'll see that
it only does anything on MIPS or something like that -- some
architecture for which Apple has no products. I don't even know why
the macro exists.
In other words, everything that you write as FOUR_CHAR_CODE('ABCD') is
exactly equivalent to 'ABCD', and has always been that way. And that's
just a 32-bit integer. We've worked hard to make nearly all APIs in
the system take native-endian arguments, so in just about every case
you don't need to byte-swap four-char codes. The exceptions to this
are documented in the Universal Binary Programming Guidelines, as are
the APIs you can use to byte-swap 32-bit integers.
Hope this helps,
Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden