I notice that WINE has a clone of MSVCRT. I also know that MSVCRT exports some C++ symbols. How does WINE and its clone of MSVCRT and its build system handle the differences in name mangling between MSVCRT and GCC?
Also, how does it handle the differences between the different class formats?
Also, is the MSVCRT provided by WINE portable to all platforms and/or useable with winelib?
I looked at the source code for WINE MSVCRT and I couldnt see how it all works.
On Wed, 2003-07-16 at 15:00, Jonathan Wilson wrote:
I notice that WINE has a clone of MSVCRT. I also know that MSVCRT exports some C++ symbols. How does WINE and its clone of MSVCRT and its build system handle the differences in name mangling between MSVCRT and GCC?
If you look in the spec file, you will see that MSVCRT is actually implemented in C, and the mangling is done manually. The mangled symbols are then mapped to C functions, with register translation code to access stuff like "this".
Also, how does it handle the differences between the different class formats?
At the assembler level, when need be.
Also, is the MSVCRT provided by WINE portable to all platforms and/or useable with winelib?
It's as portable as Wine is (ie fairly portable).
I looked at the source code for WINE MSVCRT and I couldnt see how it all works.
Example:
In the spec file:
@ cdecl -i386 -norelay ??0exception@@QAE@ABQBD@Z(ptr) __thiscall_MSVCRT_exception_ctor
DEFINE_THISCALL_WRAPPER(MSVCRT_exception_ctor); exception * __stdcall MSVCRT_exception_ctor(exception * _this, const char ** name) { TRACE("(%p %s)\n",_this,*name); _this->vtable = MSVCRT_exception_vtable; _this->name = MSVCRT_operator_new(strlen(*name)+1); if (_this->name) strcpy( _this->name, *name ); _this->do_free = TRUE; return _this; }
"thiscall" is the C++ calling convention, where the object reference is stored in ECX (i think).
Jonathan Wilson wrote:
I notice that WINE has a clone of MSVCRT. I also know that MSVCRT exports some C++ symbols. How does WINE and its clone of MSVCRT and its build system handle the differences in name mangling between MSVCRT and GCC?
MSVCRT is the the C (and C++) run time library for MS Visual C/C++ compiler. It's not intended as gcc's CRT (which got linked anyway to any winelib program).
A+