Commit 6568a8cb authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp90: Add macro that define type_info vtable.

parent c541c1e9
...@@ -449,3 +449,35 @@ typedef struct ...@@ -449,3 +449,35 @@ typedef struct
} cxx_exception_type; } cxx_exception_type;
#endif #endif
#define CREATE_TYPE_INFO_VTABLE\
static void MSVCP_type_info_dtor(type_info * _this) \
{ \
free(_this->name); \
} \
\
DEFINE_THISCALL_WRAPPER(MSVCP_type_info_vector_dtor,8) \
void * __thiscall MSVCP_type_info_vector_dtor(type_info * _this, unsigned int flags) \
{ \
if (flags & 2) \
{ \
/* we have an array, with the number of elements stored before the first object */ \
INT_PTR i, *ptr = (INT_PTR *)_this - 1; \
\
for (i = *ptr - 1; i >= 0; i--) MSVCP_type_info_dtor(_this + i); \
free(ptr); \
} \
else \
{ \
MSVCP_type_info_dtor(_this); \
if (flags & 1) free(_this); \
} \
return _this; \
} \
\
DEFINE_RTTI_DATA0( type_info, 0, ".?AVtype_info@@" ) \
\
__ASM_BLOCK_BEGIN(type_info_vtables) \
__ASM_VTABLE(type_info, \
VTABLE_ADD_FUNC(MSVCP_type_info_vector_dtor)); \
__ASM_BLOCK_END
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(msvcp); WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
CREATE_TYPE_INFO_VTABLE
#define CLASS_IS_SIMPLE_TYPE 1 #define CLASS_IS_SIMPLE_TYPE 1
#define CLASS_HAS_VIRTUAL_BASE_CLASS 4 #define CLASS_HAS_VIRTUAL_BASE_CLASS 4
...@@ -65,34 +67,6 @@ extern const vtable_ptr MSVCP_bad_cast_vtable; ...@@ -65,34 +67,6 @@ extern const vtable_ptr MSVCP_bad_cast_vtable;
/* ??_7range_error@std@@6B@ */ /* ??_7range_error@std@@6B@ */
extern const vtable_ptr MSVCP_range_error_vtable; extern const vtable_ptr MSVCP_range_error_vtable;
static void MSVCP_type_info_dtor(type_info * _this)
{
free(_this->name);
}
/* Unexported */
DEFINE_THISCALL_WRAPPER(MSVCP_type_info_vector_dtor,8)
void * __thiscall MSVCP_type_info_vector_dtor(type_info * _this, unsigned int flags)
{
TRACE("(%p %x)\n", _this, flags);
if (flags & 2)
{
/* we have an array, with the number of elements stored before the first object */
INT_PTR i, *ptr = (INT_PTR *)_this - 1;
for (i = *ptr - 1; i >= 0; i--) MSVCP_type_info_dtor(_this + i);
MSVCRT_operator_delete(ptr);
}
else
{
MSVCP_type_info_dtor(_this);
if (flags & 1) MSVCRT_operator_delete(_this);
}
return _this;
}
DEFINE_RTTI_DATA0( type_info, 0, ".?AVtype_info@@" )
/* ??0exception@@QAE@ABQBD@Z */ /* ??0exception@@QAE@ABQBD@Z */
/* ??0exception@@QEAA@AEBQEBD@Z */ /* ??0exception@@QEAA@AEBQEBD@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_exception_ctor,8) DEFINE_THISCALL_WRAPPER(MSVCP_exception_ctor,8)
...@@ -1022,8 +996,6 @@ void __cdecl __ExceptionPtrDestroy(exception_ptr *ep) ...@@ -1022,8 +996,6 @@ void __cdecl __ExceptionPtrDestroy(exception_ptr *ep)
#endif #endif
__ASM_BLOCK_BEGIN(exception_vtables) __ASM_BLOCK_BEGIN(exception_vtables)
__ASM_VTABLE(type_info,
VTABLE_ADD_FUNC(MSVCP_type_info_vector_dtor));
EXCEPTION_VTABLE(exception, EXCEPTION_VTABLE(exception,
VTABLE_ADD_FUNC(MSVCP_exception_vector_dtor) VTABLE_ADD_FUNC(MSVCP_exception_vector_dtor)
VTABLE_ADD_FUNC(MSVCP_exception_what)); VTABLE_ADD_FUNC(MSVCP_exception_what));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment