reactos/lib/msvcrt/wine
diff -u -r1.1 -r1.2
--- cpp.c 24 Dec 2003 23:20:08 -0000 1.1
+++ cpp.c 19 Mar 2004 22:58:10 -0000 1.2
@@ -96,13 +96,20 @@
#ifdef __i386__ /* thiscall functions are i386-specific */
-#define DEFINE_THISCALL_WRAPPER(func) \
+#define DEFINE_THISCALL_WRAPPER0(func) \
extern void __thiscall_ ## func(); \
__ASM_GLOBAL_FUNC(__thiscall_ ## func, \
"popl %eax\n\t" \
"pushl %ecx\n\t" \
"pushl %eax\n\t" \
- "jmp " __ASM_NAME(#func) )
+ "jmp " __ASM_NAME(#func) "@4" )
+#define DEFINE_THISCALL_WRAPPER1(func) \
+ extern void __thiscall_ ## func(); \
+ __ASM_GLOBAL_FUNC(__thiscall_ ## func, \
+ "popl %eax\n\t" \
+ "pushl %ecx\n\t" \
+ "pushl %eax\n\t" \
+ "jmp " __ASM_NAME(#func) "@8" )
const exception_vtable MSVCRT_exception_vtable;
const exception_vtable MSVCRT_bad_typeid_vtable;
@@ -132,7 +139,7 @@
/******************************************************************
* ??0exception@@QAE@ABQBD@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_exception_ctor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_exception_ctor);
exception * __stdcall MSVCRT_exception_ctor(exception * _this, const char ** name)
{
TRACE("(%p,%s)\n", _this, *name);
@@ -143,7 +150,7 @@
/******************************************************************
* ??0exception@@QAE@ABV0@@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_exception_copy_ctor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_exception_copy_ctor);
exception * __stdcall MSVCRT_exception_copy_ctor(exception * _this, const exception * rhs)
{
TRACE("(%p,%p)\n", _this, rhs);
@@ -163,7 +170,7 @@
/******************************************************************
* ??0exception@@QAE@XZ (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_exception_default_ctor);
+DEFINE_THISCALL_WRAPPER0(MSVCRT_exception_default_ctor);
exception * __stdcall MSVCRT_exception_default_ctor(exception * _this)
{
static const char* empty = NULL;
@@ -176,7 +183,7 @@
/******************************************************************
* ??1exception@@UAE@XZ (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_exception_dtor);
+DEFINE_THISCALL_WRAPPER0(MSVCRT_exception_dtor);
void __stdcall MSVCRT_exception_dtor(exception * _this)
{
TRACE("(%p)\n", _this);
@@ -188,7 +195,7 @@
/******************************************************************
* ??4exception@@QAEAAV0@ABV0@@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_exception_opequals);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_exception_opequals);
exception * __stdcall MSVCRT_exception_opequals(exception * _this, const exception * rhs)
{
TRACE("(%p %p)\n", _this, rhs);
@@ -204,7 +211,7 @@
/******************************************************************
* ??_Eexception@@UAEPAXI@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_exception_vector_dtor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_exception_vector_dtor);
void * __stdcall MSVCRT_exception_vector_dtor(exception * _this, unsigned int flags)
{
TRACE("(%p %x)\n", _this, flags);
@@ -227,7 +234,7 @@
/******************************************************************
* ??_Gexception@@UAEPAXI@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_exception_scalar_dtor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_exception_scalar_dtor);
void * __stdcall MSVCRT_exception_scalar_dtor(exception * _this, unsigned int flags)
{
TRACE("(%p %x)\n", _this, flags);
@@ -239,7 +246,7 @@
/******************************************************************
* ?what@exception@@UBEPBDXZ (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_what_exception);
+DEFINE_THISCALL_WRAPPER0(MSVCRT_what_exception);
const char * __stdcall MSVCRT_what_exception(exception * _this)
{
TRACE("(%p) returning %s\n", _this, _this->name);
@@ -249,7 +256,7 @@
/******************************************************************
* ??0bad_typeid@@QAE@ABV0@@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_bad_typeid_copy_ctor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_typeid_copy_ctor);
bad_typeid * __stdcall MSVCRT_bad_typeid_copy_ctor(bad_typeid * _this, const bad_typeid * rhs)
{
TRACE("(%p %p)\n", _this, rhs);
@@ -261,7 +268,7 @@
/******************************************************************
* ??0bad_typeid@@QAE@PBD@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_bad_typeid_ctor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_typeid_ctor);
bad_typeid * __stdcall MSVCRT_bad_typeid_ctor(bad_typeid * _this, const char * name)
{
TRACE("(%p %s)\n", _this, name);
@@ -273,7 +280,7 @@
/******************************************************************
* ??1bad_typeid@@UAE@XZ (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_bad_typeid_dtor);
+DEFINE_THISCALL_WRAPPER0(MSVCRT_bad_typeid_dtor);
void __stdcall MSVCRT_bad_typeid_dtor(bad_typeid * _this)
{
TRACE("(%p)\n", _this);
@@ -283,7 +290,7 @@
/******************************************************************
* ??4bad_typeid@@QAEAAV0@ABV0@@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_bad_typeid_opequals);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_typeid_opequals);
bad_typeid * __stdcall MSVCRT_bad_typeid_opequals(bad_typeid * _this, const bad_typeid * rhs)
{
TRACE("(%p %p)\n", _this, rhs);
@@ -294,7 +301,7 @@
/******************************************************************
* ??_Ebad_typeid@@UAEPAXI@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_bad_typeid_vector_dtor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_typeid_vector_dtor);
void * __stdcall MSVCRT_bad_typeid_vector_dtor(bad_typeid * _this, unsigned int flags)
{
TRACE("(%p %x)\n", _this, flags);
@@ -317,7 +324,7 @@
/******************************************************************
* ??_Gbad_typeid@@UAEPAXI@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_bad_typeid_scalar_dtor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_typeid_scalar_dtor);
void * __stdcall MSVCRT_bad_typeid_scalar_dtor(bad_typeid * _this, unsigned int flags)
{
TRACE("(%p %x)\n", _this, flags);
@@ -329,7 +336,7 @@
/******************************************************************
* ??0__non_rtti_object@@QAE@ABV0@@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT___non_rtti_object_copy_ctor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT___non_rtti_object_copy_ctor);
__non_rtti_object * __stdcall MSVCRT___non_rtti_object_copy_ctor(__non_rtti_object * _this,
const __non_rtti_object * rhs)
{
@@ -342,7 +349,7 @@
/******************************************************************
* ??0__non_rtti_object@@QAE@PBD@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT___non_rtti_object_ctor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT___non_rtti_object_ctor);
__non_rtti_object * __stdcall MSVCRT___non_rtti_object_ctor(__non_rtti_object * _this,
const char * name)
{
@@ -355,7 +362,7 @@
/******************************************************************
* ??1__non_rtti_object@@UAE@XZ (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT___non_rtti_object_dtor);
+DEFINE_THISCALL_WRAPPER0(MSVCRT___non_rtti_object_dtor);
void __stdcall MSVCRT___non_rtti_object_dtor(__non_rtti_object * _this)
{
TRACE("(%p)\n", _this);
@@ -365,7 +372,7 @@
/******************************************************************
* ??4__non_rtti_object@@QAEAAV0@ABV0@@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT___non_rtti_object_opequals);
+DEFINE_THISCALL_WRAPPER1(MSVCRT___non_rtti_object_opequals);
__non_rtti_object * __stdcall MSVCRT___non_rtti_object_opequals(__non_rtti_object * _this,
const __non_rtti_object *rhs)
{
@@ -377,7 +384,7 @@
/******************************************************************
* ??_E__non_rtti_object@@UAEPAXI@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT___non_rtti_object_vector_dtor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT___non_rtti_object_vector_dtor);
void * __stdcall MSVCRT___non_rtti_object_vector_dtor(__non_rtti_object * _this, unsigned int flags)
{
TRACE("(%p %x)\n", _this, flags);
@@ -400,7 +407,7 @@
/******************************************************************
* ??_G__non_rtti_object@@UAEPAXI@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT___non_rtti_object_scalar_dtor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT___non_rtti_object_scalar_dtor);
void * __stdcall MSVCRT___non_rtti_object_scalar_dtor(__non_rtti_object * _this, unsigned int flags)
{
TRACE("(%p %x)\n", _this, flags);
@@ -412,7 +419,7 @@
/******************************************************************
* ??0bad_cast@@QAE@ABQBD@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_bad_cast_ctor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_cast_ctor);
bad_cast * __stdcall MSVCRT_bad_cast_ctor(bad_cast * _this, const char ** name)
{
TRACE("(%p %s)\n", _this, *name);
@@ -424,7 +431,7 @@
/******************************************************************
* ??0bad_cast@@QAE@ABV0@@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_bad_cast_copy_ctor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_cast_copy_ctor);
bad_cast * __stdcall MSVCRT_bad_cast_copy_ctor(bad_cast * _this, const bad_cast * rhs)
{
TRACE("(%p %p)\n", _this, rhs);
@@ -436,7 +443,7 @@
/******************************************************************
* ??1bad_cast@@UAE@XZ (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_bad_cast_dtor);
+DEFINE_THISCALL_WRAPPER0(MSVCRT_bad_cast_dtor);
void __stdcall MSVCRT_bad_cast_dtor(bad_cast * _this)
{
TRACE("(%p)\n", _this);
@@ -446,7 +453,7 @@
/******************************************************************
* ??4bad_cast@@QAEAAV0@ABV0@@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_bad_cast_opequals);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_cast_opequals);
bad_cast * __stdcall MSVCRT_bad_cast_opequals(bad_cast * _this, const bad_cast * rhs)
{
TRACE("(%p %p)\n", _this, rhs);
@@ -457,7 +464,7 @@
/******************************************************************
* ??_Ebad_cast@@UAEPAXI@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_bad_cast_vector_dtor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_cast_vector_dtor);
void * __stdcall MSVCRT_bad_cast_vector_dtor(bad_cast * _this, unsigned int flags)
{
TRACE("(%p %x)\n", _this, flags);
@@ -480,7 +487,7 @@
/******************************************************************
* ??_Gbad_cast@@UAEPAXI@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_bad_cast_scalar_dtor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_bad_cast_scalar_dtor);
void * __stdcall MSVCRT_bad_cast_scalar_dtor(bad_cast * _this, unsigned int flags)
{
TRACE("(%p %x)\n", _this, flags);
@@ -492,7 +499,7 @@
/******************************************************************
* ??8type_info@@QBEHABV0@@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_opequals_equals);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_type_info_opequals_equals);
int __stdcall MSVCRT_type_info_opequals_equals(type_info * _this, const type_info * rhs)
{
int ret = !strcmp(_this->mangled + 1, rhs->mangled + 1);
@@ -503,7 +510,7 @@
/******************************************************************
* ??9type_info@@QBEHABV0@@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_opnot_equals);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_type_info_opnot_equals);
int __stdcall MSVCRT_type_info_opnot_equals(type_info * _this, const type_info * rhs)
{
int ret = !!strcmp(_this->mangled + 1, rhs->mangled + 1);
@@ -514,7 +521,7 @@
/******************************************************************
* ?before@type_info@@QBEHABV1@@Z (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_before);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_type_info_before);
int __stdcall MSVCRT_type_info_before(type_info * _this, const type_info * rhs)
{
int ret = strcmp(_this->mangled + 1, rhs->mangled + 1) < 0;
@@ -525,7 +532,7 @@
/******************************************************************
* ??1type_info@@UAE@XZ (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_dtor);
+DEFINE_THISCALL_WRAPPER0(MSVCRT_type_info_dtor);
void __stdcall MSVCRT_type_info_dtor(type_info * _this)
{
TRACE("(%p)\n", _this);
@@ -537,7 +544,7 @@
/******************************************************************
* ?name@type_info@@QBEPBDXZ (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_name);
+DEFINE_THISCALL_WRAPPER0(MSVCRT_type_info_name);
const char * __stdcall MSVCRT_type_info_name(type_info * _this)
{
if (!_this->name)
@@ -576,7 +583,7 @@
/******************************************************************
* ?raw_name@type_info@@QBEPBDXZ (MSVCRT.@)
*/
-DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_raw_name);
+DEFINE_THISCALL_WRAPPER0(MSVCRT_type_info_raw_name);
const char * __stdcall MSVCRT_type_info_raw_name(type_info * _this)
{
TRACE("(%p) returning %s\n", _this, _this->mangled);
@@ -584,7 +591,7 @@
}
/* Unexported */
-DEFINE_THISCALL_WRAPPER(MSVCRT_type_info_vector_dtor);
+DEFINE_THISCALL_WRAPPER1(MSVCRT_type_info_vector_dtor);
void * __stdcall MSVCRT_type_info_vector_dtor(type_info * _this, unsigned int flags)
{
TRACE("(%p %x)\n", _this, flags);