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


mpwc_newline

Description:

Controls the use of newline character convention used by Apple's MPW C.

Compatibility:

This pragma is compatible with the following platform targets:

68K

PowerPC

NEC V800

Intel x86

MIPS

Embedded 68K

Prototype:
  #pragma mpwc_newline on | off | reset Remarks:

If you turn on the pragma mpwc_newline, the compiler uses the MPW conventions for the '\n' and '\r' characters. If this pragma is off, the compiler uses the Metrowerks C and C++ conventions for these characters.

In MPW, '\n' is a Carriage Return (0x0D) and '\r' is a Line Feed (0x0A). In Metrowerks C and C++, they're reversed: '\n' is a Line Feed and '\r' is a Carriage Return.

If you want to turn this pragma on, be sure you use the ANSI C and C++ libraries that were compiled with this option on. The 68K versions of these libraries are marked with an NL; for example, MSL C.68K (NL_2i).Lib. The PowerPC versions of these libraries are marked with NL; for example, MSL C.PPC (NL).Lib.

If you turn this pragma on and use the standard ANSI C and C++ libraries, you won't be able to read and write '\n' and '\r' properly. For example, printing '\n' brings you to the beginning of the current line instead of inserting a newline.

This pragma corresponds to the Map Newlines to CR option in the C/C++ Language Panel. To check whether this option is on, use __option (mpwc_newline), 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