Need help detecting PowerPC and Intel on Mac
I have a small c++ universal binary which opens a resource file. I am having trouble because when a resource file is opened on a PowerPC machine, it reads wrong because of the big-endian to little-endian difference. Is there a way that I can detect this in code so I can swap the endian when running on PowerPC. Thanks!
David
Apple already provides some byte swapping routines
http://developer.apple.com/documentation/Carbon/reference/CoreEndianReference/Reference/reference.html
if you really want to do it yourself however, I believe the macros are __ppc__ and __ppc64__
http://developer.apple.com/documentation/Carbon/reference/CoreEndianReference/Reference/reference.html
if you really want to do it yourself however, I believe the macros are __ppc__ and __ppc64__
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement