• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: deprecated FOUR_CHAR_CODE and macintel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: deprecated FOUR_CHAR_CODE and macintel
      • From: Lawrence Gold <email@hidden>
    • Re: deprecated FOUR_CHAR_CODE and macintel
      • From: Olivier Tristan <email@hidden>
References: 
 >deprecated FOUR_CHAR_CODE and macintel (From: Olivier Tristan <email@hidden>)

  • Prev by Date: Re: Millions of lines of "Unable to index <file>" in console
  • Next by Date: Re: Just when does an application commit to PowerPC vs. Intel?
  • Previous by thread: deprecated FOUR_CHAR_CODE and macintel
  • Next by thread: Re: deprecated FOUR_CHAR_CODE and macintel
  • Index(es):
    • Date
    • Thread