ADC Home > Reference Library > Technical Q&As > Legacy Documents > Mac OS 9 & Earlier >
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
|
Q How do I determine if my 68K program is running on a PPC? A The best way to do this is to use the Gestalt Selectors as described in the Universal Interface file Gestalt.h: enum { gestaltSysArchitecture = 'sysa', /* Native System Architecture */ gestalt68k = 1, /* Motorola MC68k architecture */ gestaltPowerPC = 2 /* IBM PowerPC architecture */ }; A snippet of code that uses this could look something like this in your 68K program: #include <gestalt.h> #include <stdio.h> #include <Types.h> long myattr; OSErr err; err = Gestalt( gestaltSysArchitecture, &myattr;); if (err == noErr) { if (myattr == gestaltPowerPC) { InstallExtraPPCComp(); } } else { // handle error condition } Updated: 27-September-96 |
|