• 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: Howard Rodstein <email@hidden>
  • Date: Fri, 20 Jan 2006 11:35:21 -0800

>And to follow up, it turns out there is a problem, but only for a
>special case. One of our constants is
>
>	'\0\0\e\0'
>
>which ends up being stored in the wrong order. Regular constants with
>characters in all the positions work fine.

I think this byte order problem applies to two- and three-character codes.

This worked under CodeWarrior and Visual C++:

  switch(code) {
    case 'ABCD'
	...
    case 'XYZ'
	...
    case 'PQ'
	...
  }

Xcode considers 'XYZ' and 'PQ' to be errors so we had to switch to '\0XYZ' and '\0\0PQ'.

However, Visual C++ gets the byte order wrong for '\0XYZ' and '\0\0PQ' (though not for 'ABCD').

I solved this using ifdefs but I wonder if there is a better way.

So the question is, how can one use two-, three- and four-character codes on Mac and Windows without getting warnings or wrong byte order?

Howard Rodstein
WaveMetrics

 _______________________________________________
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: Markus Hitter <email@hidden>
  • Prev by Date: Re: Exception on a simple arithmetic problem
  • Next by Date: Re: Fix & Continue still broken?
  • Previous by thread: Re: deprecated FOUR_CHAR_CODE and macintel
  • Next by thread: Re: deprecated FOUR_CHAR_CODE and macintel
  • Index(es):
    • Date
    • Thread