[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


pointers_in_A0, pointers_in_D0

Description:

Controls which calling convention to use.

Compatibility:

This pragma is compatible with the following platform targets:

68K

PowerPC
NEC V800
Intel x86
MIPS

Embedded 68K

Prototype:
  #pragma pointers_in_A0
  #pragma pointers_in_D0 Remarks:

These pragmas are available for Mac OS on 68K processors only.

These pragmas let you choose between two calling conventions: the convention for MPW and Macintosh Toolbox routines and the convention for Metrowerks C and C++ routines. In the MPW and Macintosh Toolbox calling convention, functions return pointers in the register D0. In the Metrowerks C and C++ convention, functions return pointers in the register A0.

When you declare functions from the Macintosh Toolbox or a library compiled with MPW, use the pragma pointers_in_D0. After you declare those functions, use the pragma pointers_in_A0 to start declaring or defining Metrowerks C and C++ functions.

In Listing 8.10, the Toolbox functions in Sound.h return pointers in D0 and the user-defined functions in Myheader.h use A0.

Using #pragma pointers_in_A0 and #pragma pointers_in_D0:
#pragma pointers_in_D0 // set for Toolbox calls
#include <Sound.h>
#pragma pointers_in_A0 // set for my own routines
#include "Myheader.h"

The pragmas pointers_in_A0 and pointers_in_D0 have much the same meaning as d0_pointers and are available for backwards compatibility. The pragma pointers_in_A0 corresponds to #pragma d0_pointers off and the pragma pointers_in_D0 corresponds to #pragma d0_pointers on. The pragma d0_pointers is recommended for new code since it supports the reset argument. For more information, see "d0_pointers."

This pragma does not correspond to any option in the settings panel. To check whether this option is on, use the __option (d0_pointers), described in "Checking Options."


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 17, 2000