Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

The Conversion Procedure

Start by eliminating the build warnings that your project currently generates; this will make it easier to focus on warnings that are specific to 64-bit conversion problems. Also save a copy of the project in case something goes wrong in the conversion process and you need to start over. Then in a Terminal shell run the tops conversion script Cocoa64.tops located in /Developer/Extras/64BitConversion/. You can run the script on specific source and header files, as in this example:

tops -semiverbose -scriptfile /Developer/Extras/64BitConversion/Cocoa64.tops Controller.h Controller.m CustomView.h CustomView.h

Or you can run it on all .h and .m files in your project, as in this example:

tops -semiverbose -scriptfile /Developer/Extras/64BitConversion/Cocoa64.tops `find . -name '*.[hm]' | xargs`

The -semiverbose option tells tops to show the progress of conversion for each file. For other options, check the tops man page.

As the script runs, it does the following things:

After the script completes processing all files, run the FileMerge development application on each changed file and an unchanged version of the same file. FileMerge visually highlights each modified section of code. After reading “Things to Look For During Conversion,” evaluate each of these sections plus the warnings generated by the script and make further changes if necessary.

Remember that any 64-bit change you make should help preserve binary compatibility of your project executable on 32-bit systems. You should use the constructs in Table 3-1 to mark off sections of code conditionally for each architecture: PowerPC versus Intel and 32-bit versus 64-bit.

Table 3-1  Macros for architecture conditional code

Macro

Comment

#if __LP64__

PowerPC or Intel 64-bit. You should use this for most 64-bit changes.

#ifdef __ppc__

PowerPC 32-bit

#ifdef __ppc64__

PowerPC 64-bit

#ifdef __i386__

Intel 32-bit

#ifdef __x86_64__

Intel 64-bit

#ifdef __BIG_ENDIAN__

Big endian architectures



< Previous PageNext Page > Hide TOC


Last updated: 2007-03-22




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice