Contents

Introduction

Conceptual information and tips for writing code that runs on PowerPC-based and Intel-based Macintosh computers.

Who Should Read This Document?

Any developer who currently has an application that runs in Mac OS X will want to read this document to learn how to modify their code so that it runs natively on all current Apple hardware. Developers who have not yet written an application for the Macintosh, but are planning to do so, will want to follow the guidelines in the document to ensure that their code can run as a universal binary.

Organization of This Document

This document is organized into the following chapters:

  • Building a Universal Binary shows how to use Xcode 2.2 to build native and universal binaries, describes build options, and provides troubleshooting information for code that doesn’t run properly on an Intel-based Macintosh computer.
  • Architectural Differences outlines the major differences between the x86 and PowerPC architectures. Understanding the differences will help you to write portable code.
  • Swapping Bytes describes byte-ordering differences in detail, provides a list of byte-swapping routines, and discusses strategies for a number of scenarios that require you to swap bytes. This is a must-read chapter for all Mac OS X developers. It will help you understand how to avoid byte-ordering issues when transferring data and data files between architectures.
  • Guidelines for Specific Scenarios contains tips for a variety of situations that are not common to most applications.
  • Preparing Vector-Based Code discusses the options available for those developers who have high-performance computing needs.

This document contains the following appendixes:

Assumptions

The document assumes the following:

Conventions

The term x86 is a generic term used in some parts of this book to refer to the class of microprocessors manufactured by Intel. This book uses the term x86 as a synonym for IA-32 (Intel Architecture 32-bit).

Next

Copyright © 2005, 2009 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2009-02-04