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


d0_pointers

Description:

Specifies which register should be used to hold function result pointers.

Compatibility:

This pragma is compatible with the following platform targets:

68K

PowerPC
NEC V800
Intel x86
MIPS
Embedded 68K

Prototype:
  #pragma d0_pointers Remarks:

This pragma applies to 68K programming only.

This pragma lets 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, turn on the d0_pointers pragma. After you declare those functions, turn off the pragma to start declaring or defining Metrowerks C and C++ functions.

In Listing 8.2, 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 d0_pointers on     // set for Toolbox calls
#include <Sound.h>
#pragma d0_pointers reset // set for my 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 background 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 "pointers_in_A0, pointers_in_D0."

This pragma does not correspond to any option in the 68K Processor 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