[79538] branches/gsoc11-rev-upgrade/base/src/pextlib1.0/Pextlib.c

Ryan Schmidt ryandesign at macports.org
Fri Jun 17 00:15:07 PDT 2011


On Jun 17, 2011, at 01:44, Joshua Root wrote:
> On 2011-6-17 10:44 , Ryan Schmidt wrote:
>> On Jun 16, 2011, at 18:41, cal at macports.org wrote:
>> 
>>> +#define MH_MAGIC    (0xfeedface)
>>> +#define MH_MAGIC_64 (0xfeedfacf)
>>> +#define FAT_MAGIC   (0xcafebabe)
>> 
>> Aren't there 5 Mach-O magic numbers?
>> 
>> 0xFEEDFACE: ppc
>> 0xFEEDFACF: ppc64
>> 0xCEFAEDFE: i386
>> 0xCFFAEDFE: x86_64
>> 0xCAFEBABE: any combination of two or more architectures
> 
> 6 since you're counting the byteswapped versions.
> #define FAT_CIGAM	0xbebafeca

I'm simply listing the 5 magic numbers I've actually seen for Mach-O files, and describing them. Does that 6th type actually exist? I have not encountered it before.


> But you only strictly need 3 and you can derive the other 3.

Sure, but it didn't look like the code did that. 


> Of course, since this code is only going to work on Mach-O platforms
> anyway, you might as well wrap the whole thing in #ifdef __MACH__ and
> include the headers mentioned in the comment.




More information about the macports-dev mailing list