From: Ron Liechty (mwron@metrowerks.com)

CodeWarriors,

With CW/11 Metrowerks has changed the default ANSI C and C++ Libraries from
a version licensed from Plum-Hall to Metrowerks owned libraries. These
Libraries all source codes as well as projects you can modify to build
custom libraries are located in the Metrowerks Standard Library folder, and
are referred to as MSL C and MSL C++. We are still providing (and will
continue to provide for some time) the older versions of the ANSI C and C++
libraries. These are located on the CodeWarrior Tools CD in the Metrowerks
CodeWarrior : ( Obsolete ANSI Libraries) folder.

Providing our own libraries allows us to ship the source code so users that
want to build their own custom libraries or fine tune the provided code may
do so. Furthermore, the Proposed ANSI/ISO Standard for C++ is now in the
final stages and this new MSL C++ Library is more compliant than the
previous Plum Hall version.

If you are updating older projects moving to these versions may have little
effect or may mean several simple changes will need to be made.

Please Read all release notes and the FAQ’s appended to this note.

NOTE: Before updating any project make sure you save a copy of your old
project first. The updater will not do this. This is critical if you have
problems and wish to go back to the previous ANSI libraries.

NO ANSI LIBRARIES USED.

If you do not use the ANSI library routines in your project you may delete
them from your project if they are present along with any SIOUX library.
You may need to remove these access paths.

Optionally you may want to change the runtime library from CPlusPlus.Lib
(for 68k) to MSL Runtime68k.LIb or change MWCRuntime.lib to MSL
RuntimePPC.Lib (for PowerPC). The older runtimes are still provided but
this change now may be useful for future uses. However to do this you will
need to add abort_exit.c to the MSL runtime project and rebuild the
project, it was forgotten in the last drop onto the CD.

ANSI C LIBRARIES USED

If you use the ANSI C libraries in your project you will need to replace
the ANSI C versions with the MSL Versions. If you are using 68k libraries
only certain versions are provided. You may have to build your own
libraries to conform to your project settings. (see FAQ below). SIOUX
console input and output is built into MSL C Library a separate library
is no longer needed.

If you have any libraries in your project that were linked against the
older headers or libraries you will need to rebuild them or revert back to
the older libraries.

You will have to change the runtime library from CPlusPlus.Lib (for 68k)
to MSL Runtime68k.LIb or change MWCRuntime.lib to MSL RuntimePPC.Lib for
the PowerPC projects.

You will need to adjust your Access paths to point to the Metrowerks
CodeWarrior : Metrowerks Standard Library : MSL C folder. If recursion is
off you will also want to set it for the MSL C : MSL Common : Public
Includes and MSL C : MSL Mac : Public Includes folders. You may need to
but probably will not need to adjust the access paths for the missing ANSI
Libraries.

If you use only ANSI C Libraries and no MacToolbox make sure your projects
prefix file is set to ansi_prefix.mac.h (this setting is made in your
project preferences : C/C++ Language settings.

If you use MacToolbox and ANSI C you will need to create a prefix file.
The easiest way is to create your own precompile header using the
ansi_prefix.mac.h file in the Metrowerks Standard Libraries : MSL C : MSL
Mac : Public Includes folder.

Un-comment the precompiler directives and the #include (MacHeaders.c)
lines, select precompile from your project menu and grab a cup of coffee.
When it has finished it will ask for a name, save it with a descriptive
name and use it for your prefix file.

For more information on creating a precompiled header read the IDE Users
Guide page 300 Creating Precompiled Headers.

ANSI C++ LIBRARIES USED

If you are using ANSI C++ Libraries you must do the all of the above for
ANSI C libarries plus add the Metrowerks Standard Library : MSL C++ and
Metrowerks Standard Library : MSL C++ : Library Support folders to your
access paths.

You will need to replace the ANSI C++ library with the appropriate MSL C++
Library.

If you wish to use the enable Bool support option you will need to rebuild
your MSL C++ Library. If a version of the Library is not provided for your
settings you will also have to build a custom C++ Library (see FAQ below)
It is suggested you rebuild this library with inlining off until a patch is
released for the C/C++ Compiler.

POWERPLANT WITH ANSI

You will need to do all of the above for ANSI C and ANSI C++ plus you may
need to do the following

You should recompile your precompiled header files to have matching
settings. This can be accomplished by the use of custom precompiled header
files (or if you already use one, you should be in good shape).

For the PP Classes you can do this to create your precompiled header file.

Find the Project Stationary folder in the Basic PowerPlant stationary
folder (68k or PPC, doesn’t matter). You’ll see 2 files in there
“MyPP_DebugHeaders.pch++/.h”. COPY those two files to your project’s
folder. Add the .pch++ file to your project. Go into your project’s
Project Settings, C/C++ Language Settings. In the Prefix File edit field
enter “MyPP_DebugHeaders.h” (no quotes).

Don’t forget to put a
#include (ansi_prefix.mac.h)
or
#include (ansi_parms.h)
#define __dest_os __mac_os

in your project somewhere. For some people, putting it into the
“MyPP_DebugHeaders.h” file works fine. For others, they put it into the
.pch++ file.

INSTALLING PREVIOUS VERSION OF ANSI C/C++

If you do not wish to update to the MSL C or MSL C++ Libraries you may
chose to reinstall the older versions. This is recommended for those who
are maintaining older code.

copy the folders ANSI Headers and STL Headers from the Tools CD Metrowerks
CodeWarrior : (Obsolete ANSI Libraries) : INTO MacOS Support folder : INTO
Headers folder
into the Metrowerks CodeWarrior : MacOS Support : Headers folder on your
hard drive

copy the folders ANSI 68K, ANSI PPC and SIOUX from the Tools CD Metrowerks
CodeWarrior : (Obsolete ANSI Libraries) : INTO MacOS Support folder : INTO
Libraries folder
into the Metrowerks CodeWarrior : MacOS Support : Libraries folder on your
hard drive

You may chose to copy old project stationery from the CW/10 version of
CodeWarrior or save and existing project in your Metrowerks CodeWarrior
(Project Stationery) folder in the appropriate sub folder as a stationery.

FAQ’s ABOUT METROWERKS STANDARD LIBRARY

Q: I need an A4 version of my library but none is provided what should I do.

A: Metrowerks will soon provide several more libraries on our web site for
downloading or you may want to create your own custom library.

HOW TO BUILD YOUR OWN LIBRARIES

Open the MSL folder and in the MSL C or MSL C++ folder you will find a
project for example MSL C.68K.u. Open this project and change the
following settings.

Project Preferences
Give this library a descriptive name I suggest you use the Metrowerks
naming conventions but are free to use any name. If you are creating an A4
relative library you need to set this in this preference.

C/C++ Language Preferences
Set these preferences to conform to your projects settings. Note in PowerPC
projects now the enable bool support requires coinciding library settings.
We currently recommend that inlining be turned off until a patch is
released soon.

68k Processor Preferences
Set these preferences to match your project settings.

)From the Project Menu select make.

Q: The C++ Compile times are slow, I thought my computer had frozen.

A: Yes because of the way the compiler is doing inlining and the way the
MSL C++ is inlined has led to some excessive build times especially on
slower 68k machines. Metrowerks is working on a patch for this which will
be available soon. In the mean time it is suggested you build your projects
with inlining off.

You may also want to increase your disk cache in your Memory Control Panel
settings. A 1 – 2 Mb should help if you can spare it. The default is 96k
which is inadequate.

Q: The code has jumped in size

A: This is due to the inlining, Please rebuild your project and the
Library with inlining turned off. This will reduce the size to a large
extent. Metrowerks is working on the MSL C++ as well as the Compilers
inlining to reduce this. A patch will be available soon.

Q: When I compile my code with iostream I get an error in Vector.h

A: The project stationery supplied on CW/11 incorrectly has MacHeaders.h
as the prefix file. Please change this to ansi_prefix.mac.h this will
solve these problems. You may want to change the setting in your project
stationery for future use as well.

Q: My code that compiled fine with MSL in CW/10 no longer compiles with
various errors with vectors and iterators.

A : There was a major change in the container interface, and it forces
container declarations to change as follows:

OLD: vector( YOUR_OBJECT_TYPE ) vect_i0;
NEW: vector( YOUR_OBJECT_TYPE , allocator( YOUR_OBJECT_TYPE ) )
vect_i0;

Note this is for all containers, not just vectors (list, map, etc.)

Also, if you have a non-standard type (i.e. not bool, short, u short, long,
u long, long long, etc. etc. ) then you’ll need to make an iterator_traits
specialization for it right after the definition of this type (in whatever
.cpp file this type is defined). (check to make sure that you’ve included
the header (iterator.h) too)

you do this with this form

null_template
struct iterator_trait (unsigned int) {
typedef ptrdiff_t distance_type;
typedef unsigned int value_type;
typedef random_access_iterator_tag iterator_category;
};

Q: Ever since I installed the MSL I get an error in exceptions.c

A: This is not a problem with MSL this is a problem with the inlining of
the C/C++ Compiler creating more inline functions in a code block that the
internal exception handling can hold. Metrowerks is working on a patch in
the meantime turn inlining off.

Q: Since I updated to MSL my old code that worked before now reports a 32k
reference is out of range error.

A: This is due to the inlining, Metrowerks is working on a patch. In the
meantime if turning inlining in your project off does not work then you
will need to rebuild your libraries with inlining off.

Q: I used to use console.stubs.c to reduce the size of my application when
I used the ANSI libraries without Console I/O what should I do now.

A: Console.stubs.c is no longer necessary as the initializations are built
into the MSL C library and will be stripped out by the linker.

Q: I changed from MWCRuntime to MSL RuntimePPC.Lib and I now get the error.
Link Error : undefined ‘exit’ (code)
Referenced from ‘__start’ in MSL RuntimePPC.Lib

A: Just add abort_exit.c to the MSL runtime project and rebuild the
project, it was forgotten in the last drop onto the CD.

Q: I can’t use MSL and standard input extractor (cin ))) to input a zero
value.

A: Yes this is a bug in MSL C++ libraries it has been corrected and will
be on the next patch coming soon.

Q: I get an internal compiler error with operands.c

A: This is a bug in the C/C++ compiler when you implicitly convert a float
to a double, as in an assignment or arithmetic equation. This has been
corrected and will be fixed in the patch coming out soon. In the mean time
the work around is to simply use doubles instead of float types.

Ron Liechty