Mingw32 Alternate C Runtime Library Implementation Details
- Implement using Win32 APIs
- Accept the forward-slash instead of the standard backslash in the filename
parameter in any call requiring the filename
- Accept UNC pathnames in all filename parameters
- Treat the case of input-filenames using Win32 conventions
- Use backslashes in all filenames returned from a call or written in any
buffers passed to that call within that call
- Conversion between Win32 (returned by GetLastError() call) and ANSI/POSIX
(set in errno variable) error codes
- Also support errno variable where otherwise required by ANSI standard
- Make library 100% ANSI/ISO compliant, including wide-character/Unicode
functions, locale functions, and ISO C99 functions
- Implement malloc, calloc, free, and realloc using Win32 memory fuctions
- Make library compatible with both console and GUI applications
- If an application implements WinMain and/or wWinMain, it is an GUI
application
- If an application implements main and/or wmain, it is an console
application
- Implement the appropriate CRT startup code (mainCRTStartup,
wmainCRTStartup, WinMainCRTStartup, wWinMainCRTStartup, DllMainCRTStartup)
for console applications, GUI applications, and Dynamic Link Libraries
(DLLs).
- Make all functions in this C Runtime Library multi-thread safe
- Support multiple locales
- Make source compatible with GCC, Binutils, GNU Make, GNU gzip, GNU tar,
and bzip2
- Ensure compatibility with existing Mingw32 applications, including C++
applications
- Ensure compatibility with GNU C++ library, including dynamic versions
- Write an exception handler and install it in the exception handler list at
fs:[0]. Click here to view exception handling details.
- In the default custom exception handler, translate exceptions to the
corresponding ANSI signals
- Support the SIGINT signal using the following:
- Add a default custom SetConsoleCtrlHandler routine in the CRT startup code
of console applications
- In the default custom SetConsoleCtrlHandler routine, raise a SIGINT signal
if necessary
- Support all other signals required by the current ANSI/ISO standard
- Support all math functions required by the ANSI/ISO standard, the ISO C99
standard, or the POSIX standard, including complex number operations
- Fully support the FPU in any IA-32 or AMD x86-64 version
- Fully support the floating-point capabilities of the processor in all
other processor versions
- Support Windows 95, Windows 98, Windows Me, Windows XP Home Edition,
Windows NT 4.0, Windows 2000, Windows XP Professional, and Windows .NET
Server
- NEVER MAKE ANY FUNCTIONS DEPENDENT ON ANY VERSION OF THE MICROSOFT C
RUNTIME LIBRARY OR THE CYGWIN DLL
- Support __argc, __argv, __wargv, _environ, and _wenviron in both Console and GUI
builds (can be implemented using macros)
- Make all C source files compilable with GCC
- Make all assembly files compilable with GAS
- Use no C++ in source files
- Make DLL and static versions of the runtime library
- Make compatible with the Win32 API header files in the current version of
the Microsoft Platform SDK and the Win32 API header files in the current
Mingw32 Runtime Library
Hosted by