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


export

Description:

Controls items to export from a module.

Compatibility:

This pragma is compatible with the following platform targets:

68K

PowerPC

NEC V800
Intel x86
MIPS
Embedded 68K

Prototype:
  #pragma export on | off | reset | list names Remarks:

This pragma applies to Mac OS programming only.

The pragma export gives you another way to export symbols besides using a .exp file. To export symbols with this pragma, choose Use #pragma from the Export Symbols menu in the PowerPC PEF or CFM68K settings panel. Then turn on this pragma to export variables and functions declared or defined in this file. If you choose any other option from the Export Symbols menu, the compiler ignores this pragma.

If you want to export all the functions and variables declared or defined within a certain range, use #pragma export on at the beginning of the range and use #pragma export off at the end of the range. If you want to export all the functions and variables in a list, use #pragma export list. If you want to export a single variable or function, use __declspec(export) at the beginning of the declaration

For example, Listing 8.3 uses #pragma export on and off to export the variable w and the functions a1() and b1().

Example of #pragma export on:
#pragma export on
int a1(int x, double y);
double b1(int z);
int w;
#pragma export off

Listing 8.4 uses #pragma export list to export the symbols.

Example of #pragma export list:
int a1(int x, double y);
double b1(int z);
int w;
#pragma export list a1, b1, w

Listing 8.5 uses __declspec(export) to export the symbols.

Example of __declspec(internal):
__declspec(export) int a1(int x, double y);
__declspec(export) double b1(int z);
__declspec(export) int w;

This pragma does not correspond to an option in any settings panel. To check whether this option is on, use __option(export), 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