Commit 6c4cddc4 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Add macro that defines type_info vtable.

parent a2d8a0ce
...@@ -27,12 +27,13 @@ ...@@ -27,12 +27,13 @@
#include "wine/exception.h" #include "wine/exception.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "msvcrt.h" #include "msvcrt.h"
#include "cppexcept.h"
#include "mtdll.h" #include "mtdll.h"
#include "cxx.h" #include "cxx.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
CREATE_TYPE_INFO_VTABLE
struct __type_info_node struct __type_info_node
{ {
void *memPtr; void *memPtr;
...@@ -626,27 +627,6 @@ const char * __thiscall type_info_raw_name(type_info * _this) ...@@ -626,27 +627,6 @@ const char * __thiscall type_info_raw_name(type_info * _this)
return _this->mangled; return _this->mangled;
} }
/* Unexported */
DEFINE_THISCALL_WRAPPER(type_info_vector_dtor,8)
void * __thiscall 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--) type_info_dtor(_this + i);
operator_delete(ptr);
}
else
{
type_info_dtor(_this);
if (flags & 1) operator_delete(_this);
}
return _this;
}
#if _MSVCR_VER >= 80 #if _MSVCR_VER >= 80
typedef exception bad_alloc; typedef exception bad_alloc;
...@@ -936,8 +916,6 @@ improper_scheduler_detach * __thiscall improper_scheduler_detach_copy_ctor( ...@@ -936,8 +916,6 @@ improper_scheduler_detach * __thiscall improper_scheduler_detach_copy_ctor(
__ASM_BLOCK_BEGIN(vtables) __ASM_BLOCK_BEGIN(vtables)
__ASM_VTABLE(type_info,
VTABLE_ADD_FUNC(type_info_vector_dtor));
__ASM_VTABLE(exception, __ASM_VTABLE(exception,
VTABLE_ADD_FUNC(exception_vector_dtor) VTABLE_ADD_FUNC(exception_vector_dtor)
VTABLE_ADD_FUNC(what_exception)); VTABLE_ADD_FUNC(what_exception));
...@@ -984,7 +962,6 @@ __ASM_VTABLE(improper_scheduler_detach, ...@@ -984,7 +962,6 @@ __ASM_VTABLE(improper_scheduler_detach,
__ASM_BLOCK_END __ASM_BLOCK_END
DEFINE_RTTI_DATA0( type_info, 0, ".?AVtype_info@@" )
#if _MSVCR_VER >= 80 #if _MSVCR_VER >= 80
DEFINE_RTTI_DATA0( exception, 0, ".?AVexception@std@@" ) DEFINE_RTTI_DATA0( exception, 0, ".?AVexception@std@@" )
DEFINE_RTTI_DATA0( exception_old, 0, ".?AVexception@@" ) DEFINE_RTTI_DATA0( exception_old, 0, ".?AVexception@@" )
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "wine/asm.h" #include "cppexcept.h"
#ifdef _WIN64 #ifdef _WIN64
...@@ -279,3 +279,32 @@ extern void *vtbl_wrapper_48; ...@@ -279,3 +279,32 @@ extern void *vtbl_wrapper_48;
#endif #endif
exception* __thiscall exception_ctor(exception*, const char**); exception* __thiscall exception_ctor(exception*, const char**);
extern const vtable_ptr type_info_vtable;
#define CREATE_TYPE_INFO_VTABLE \
DEFINE_THISCALL_WRAPPER(type_info_vector_dtor,8) \
void * __thiscall 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--) free(_this->name); \
free(ptr); \
} \
else \
{ \
free(_this->name); \
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(type_info_vector_dtor)); \
__ASM_BLOCK_END
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "winbase.h" #include "winbase.h"
#include "winternl.h" #include "winternl.h"
#include "msvcrt.h" #include "msvcrt.h"
#include "cppexcept.h"
#include "mtdll.h" #include "mtdll.h"
#include "cxx.h" #include "cxx.h"
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "winternl.h" #include "winternl.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "msvcrt.h" #include "msvcrt.h"
#include "cppexcept.h"
#include "cxx.h" #include "cxx.h"
#if _MSVCR_VER >= 100 #if _MSVCR_VER >= 100
...@@ -1097,7 +1096,6 @@ DEFINE_VTBL_WRAPPER(48); ...@@ -1097,7 +1096,6 @@ DEFINE_VTBL_WRAPPER(48);
#endif #endif
extern const vtable_ptr type_info_vtable;
DEFINE_RTTI_DATA0(Context, 0, ".?AVContext@Concurrency@@") DEFINE_RTTI_DATA0(Context, 0, ".?AVContext@Concurrency@@")
DEFINE_RTTI_DATA1(ContextBase, 0, &Context_rtti_base_descriptor, ".?AVContextBase@details@Concurrency@@") DEFINE_RTTI_DATA1(ContextBase, 0, &Context_rtti_base_descriptor, ".?AVContextBase@details@Concurrency@@")
DEFINE_RTTI_DATA2(ExternalContextBase, 0, &ContextBase_rtti_base_descriptor, DEFINE_RTTI_DATA2(ExternalContextBase, 0, &ContextBase_rtti_base_descriptor,
......
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