=============================================================================
Nokia CodeWarrior Win32 Runtime Release Notes
=============================================================================
Version: Carbide.c++ 1.1
Date:    14 November 2007
Authors: Ed Swartz, Stanley Law
=============================================================================

This file documents the Win32-x86 Runtime directory released with CodeWarrior.

===============================================================================
Bugs Fixed in Carbide.c++ 1.1
===============================================================================

*	Fixed issue with debug heap alloc count issue to Symbian environment

===============================================================================
Changes for CW for Symbian v3.1
===============================================================================

*	The directory structure of the runtime has changed from v3.0.
	Codewarrior-specific files have been moved out of "<top>/Symbian_Support/
	Win32-x86 Support/Libraries/Runtime" into "<top>/Symbian_Support/Runtime".
	
	The primary impact of this change is that any existing projects or
	scripts that expect to find, e.g., the MSL "All" library will not find
	it under Win32-x86 Support, but under Runtime.  

===============================================================================
Bugs Fixed in CW for Symbian v3.1
===============================================================================

*	Added implementation of std::uncaught_exception() for MS C++ exception
	compatible runtime.  (MTWX11611) (24 June 2005)

===============================================================================
Bugs Fixed in CW for Symbian v3.0
===============================================================================

*	Fixed some issues with _set_se_translator() in the MW C++ exception 
	handling model.  (3 January 2005)

===============================================================================
Bugs Fixed in CWDS 9.3
===============================================================================

*	Changed some code sequences in runtime sources to avoid crashing
	newer versions of Rational Purify.  (14 April 2004)

*	Fix memory leaks triggered when DLLs are loaded into a process using
	the shared runtime (the argv[] and environ[] arrays would be
	multiply allocated) (18 May 2004)
	
*	Ensure that the UNICODE versions of DLLs can be created (there
	is no special user entry point, so the x86 Linker / Entry Point
	field must be manually set to "__wDllMainCRTStartup@12").
	(18 May 2004)
	
===============================================================================
Bugs Fixed in CWDS 9.2
===============================================================================

*   Updated CodeCompletion header file for __cplusplus macro to value 199711L.

*	Fixed bugs in runtime wildcard expansion when Unicode filenames are 
	matched.  When characters cannot be represented in the current character 
	set (i.e. ANSI), the alternate filename (8.3 format) is used.
	(12 January 2004)

*	Numerous structured exception handling bugfixes, including 
	_set_se_translator support under MS exceptions and zero-overhead
	exceptions models.  (13 January 2004)
	
==============================================================================
New Features in this Version
=============================================================================

*	Added support for the one-time construction API (see compiler notes)

*	Added several compatibility functions to the runtime library to
	enable linking against MSVC-compiled static libraries (i.e. DirectX9)
	(2 May 2003)

*	Added Metrowerks-compatible MMX/XMM intrinsics headers (mmintrin.h,
	xmmintrin.h, mm3dnow.h).  See compiler notes for details.

*	Added UNICODE-compatible startup code.  In the Win32 model, source
	code can be written for ASCII/multibyte systems or for Unicode
	systems, by using a "target" set of types and routines that change
	under the control of the UNICODE #define.  

	A short primer: in files that are sensitive to the ASCII/Unicode
	configuration, #include <tchar.h>.  Replace calls to standard
	string functions (like strlen(), strchr()) with "_tcs" versions
	(i.e. _tcslen(), _tcschr()).  Finally, use "TCHAR" or "_TCHAR"
	instead of "char", and _T("string")/_T('char') instead of "string"
	/ 'char'.

	To build a Unicode-target version of a program or DLL with
	Codewarrior, configure your sources as above, and then alter
	configuration settings as follows:

	(1) #define the symbol UNICODE in the C/C++ Preprocessor "Prefix
	Text".  

	(2) If you need to access the command line or environment strings
	in Unicode format: 

	   (a) Note the x86 Linker / Entry Point default setting (a string
	   like "_mainCRTStartup" should be present), modify this setting
	   to User-defined, and manually enter the same string, prefixing
	   "w" after the leading underscore.

	   (b) Use an alternate main symbol (usually with "_w" or with "_t"
	   to dynamically select based on UNICODE).

	   For console applications:  

	   		Entry point:	_mainCRTStartup --> _wmainCRTStartup
			Main program:	main() --> wmain() or _tmain()

	   For GUI applications:

		    Entry point:	_WinMainCRTStartup --> _wWinMainCRTStartup
		    Main program:	WinMain() --> wWinMain() or _tWinMain()

	   For DLLs:

		    Entry point:	_DllMainCRTStartup --> _wDllMainCRTStartup
		    Main entry:		still DllMain()

	   The command-line arguments are stored in __argv/__wargv
	   (__targv), with a count __argc.  The entire string is
	   _acmdln/_wcmdln (_tcmdln).  Environment strings are stored in
	   _environ/ _wenviron (_tenviron).

=============================================================================
Bugs Fixed in this Version
=============================================================================

*   Added missing "isapi.cpp" to MFC_6.0.mcp (WB1-44530) (2 May 2003)

*	Fixed bug in zero-overhead exception handling involving calls
	through arrays ( arr[x]() ).  (1 July 2003)

*	Fixed bugs in wildcard argument expansion.  Directories are no 
	longer included.  If no wildcard matches are made, the original
	wildcard argument is left intact.  (5 August 2003)

*	Fixed MFC bug with olecall/inetcall implementation.  CW uses a
	different PTMF layout so we had to rewrite _AfxParseCall
	and _AfxDispatchCall.  (WB1-36211, WB1-42937)  (11 August 2003)

*	Fixed bug generating wildcard matches (setupargs.c)	when filenames
	cannot be converted to the current system locale.  Windows provides
	a filename containing '?' characters in the event of such a failure,
	which is altogether useless to an application since this makes an
	illegal filename.  The alternate ("short") filename is used instead
	in such cases.  (14 November 2003)

=============================================================================
Known Bugs and Incompatibilities in this Version
=============================================================================

*	The C++ library function "uncaught_exception()" does not work in
	the Microsoft C++ compatible exception model.  This function will 
	always return "false".

*   Structured exception handling blocks do not unwind when longjmp() is used
    inside __try...__finally.

*   Local C++ objects will not be destroyed when a Win32 exception
    causes a transfer of control out of a function to a structured
    exception handler (__try...__except):
    
    __try
    {
        char *data = new char[100000000];    // allocate a lot of memory
        *(char *)0 = 0;                      // force an exception
    }
    __except(...)
    {
        // 'data' not freed when exception thrown
    }
    
    In functions that catch SEH exceptions, it is recommended to allocate 
    any destroyable locals outside of __try blocks:
    
    struct MyClass
    {
        char *data;
        MyClass() { data = new char[100000000]; }
        ~MyClass() { delete data; }
    };
    
    // allocate a lot of memory
    MyClass x;								
    __try                char *data = new char[100000000];		
    {
        // force an exception
        *(char *)0 = 0;						
    }
    __except(...)
    {
    }
    // 'x' destroyed here
    
    When a called function may trigger a Win32 exception, it is recommended
    to use _set_se_translator (see <eh.h>) to trap the exception and issue
    a C++ exception to force unwinding:
    
    void __cdecl catch_seh_exception(DWORD code, LPEXCEPTION_POINTERS ptrs)
    {
        throw 0;                // upon catching a Win32 exception
    }
    
    void destroyfunc(void)
    {
        // set up Win32 -> C++ exception translator
        _set_se_translator(catch_seh_exception);
        try
        {
            // allocate a lot of memory
            MyClass x;
            // this call issues an exception
            dangerous_function_call();
            
            // (if not, 'x' is destroyed exiting this block)
        }                char *data = new char[100000000];		
        
        catch(...)
        {
            // Win32 exceptions translated and caught here;
            // 'x' destroyed as well
        }
    }


=============================================================================
Nokia Inc.
<http://www.forum.nokia.com/codewarrior/support>
