Commit 8d39c7d8 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp90: Accept more base classes in DEFINE_RTTI_DATA macro.

parent 9f9a4a18
......@@ -96,7 +96,7 @@ void * __thiscall MSVCP_type_info_vector_dtor(type_info * _this, unsigned int fl
return _this;
}
DEFINE_RTTI_DATA( type_info, 0, 0, NULL, NULL, NULL, ".?AVtype_info@@" );
DEFINE_RTTI_DATA0( type_info, 0, ".?AVtype_info@@" );
DEFINE_THISCALL_WRAPPER(MSVCP_exception_ctor, 8)
exception* __thiscall MSVCP_exception_ctor(exception *this, const char **name)
......@@ -160,7 +160,7 @@ void * __thiscall MSVCP_exception_vector_dtor(exception *this, unsigned int flag
return this;
}
DEFINE_RTTI_DATA(exception, 0, 0, NULL, NULL, NULL, ".?AVexception@std@@");
DEFINE_RTTI_DATA0(exception, 0, ".?AVexception@std@@");
static const cxx_type_info exception_cxx_type_info = {
0,
......@@ -241,7 +241,7 @@ const char* __thiscall MSVCP_what_exception(exception * this)
return this->name ? this->name : "Unknown exception";
}
DEFINE_RTTI_DATA(bad_alloc, 0, 1, &exception_rtti_base_descriptor, NULL, NULL, ".?AVbad_alloc@std@@");
DEFINE_RTTI_DATA1(bad_alloc, 0, &exception_rtti_base_descriptor, ".?AVbad_alloc@std@@");
static const cxx_type_info bad_alloc_cxx_type_info = {
0,
......@@ -332,7 +332,7 @@ const char* __thiscall MSVCP_logic_error_what(logic_error *this)
return MSVCP_basic_string_char_c_str(&this->str);
}
DEFINE_RTTI_DATA(logic_error, 0, 1, &exception_rtti_base_descriptor, NULL, NULL, ".?AVlogic_error@std@@");
DEFINE_RTTI_DATA1(logic_error, 0, &exception_rtti_base_descriptor, ".?AVlogic_error@std@@");
static const cxx_type_info logic_error_cxx_type_info = {
0,
......@@ -389,7 +389,7 @@ void* __thiscall MSVCP_length_error_vector_dtor(
return MSVCP_logic_error_vector_dtor(this, flags);
}
DEFINE_RTTI_DATA(length_error, 0, 2, &logic_error_rtti_base_descriptor, &exception_rtti_base_descriptor, NULL, ".?AVlength_error@std@@");
DEFINE_RTTI_DATA2(length_error, 0, &logic_error_rtti_base_descriptor, &exception_rtti_base_descriptor, ".?AVlength_error@std@@");
static const cxx_type_info length_error_cxx_type_info = {
0,
......@@ -446,7 +446,7 @@ void* __thiscall MSVCP_out_of_range_vector_dtor(
return MSVCP_logic_error_vector_dtor(this, flags);
}
DEFINE_RTTI_DATA(out_of_range, 0, 2, &logic_error_rtti_base_descriptor, &exception_rtti_base_descriptor, NULL, ".?AVout_of_range@std@@");
DEFINE_RTTI_DATA2(out_of_range, 0, &logic_error_rtti_base_descriptor, &exception_rtti_base_descriptor, ".?AVout_of_range@std@@");
static const cxx_type_info out_of_range_cxx_type_info = {
0,
......@@ -503,7 +503,7 @@ void* __thiscall MSVCP_invalid_argument_vector_dtor(
return MSVCP_logic_error_vector_dtor(this, flags);
}
DEFINE_RTTI_DATA(invalid_argument, 0, 2, &logic_error_rtti_base_descriptor, &exception_rtti_base_descriptor, NULL, ".?AVinvalid_argument@std@@");
DEFINE_RTTI_DATA2(invalid_argument, 0, &logic_error_rtti_base_descriptor, &exception_rtti_base_descriptor, ".?AVinvalid_argument@std@@");
static const cxx_type_info invalid_argument_cxx_type_info = {
0,
......@@ -594,7 +594,7 @@ const char* __thiscall MSVCP_runtime_error_what(runtime_error *this)
return MSVCP_basic_string_char_c_str(&this->str);
}
DEFINE_RTTI_DATA(runtime_error, 0, 1, &exception_rtti_base_descriptor, NULL, NULL, ".?AVruntime_error@std@@");
DEFINE_RTTI_DATA1(runtime_error, 0, &exception_rtti_base_descriptor, ".?AVruntime_error@std@@");
static const cxx_type_info runtime_error_cxx_type_info = {
0,
......@@ -665,7 +665,7 @@ const char* __thiscall MSVCP_failure_what(failure *this)
return MSVCP_runtime_error_what(this);
}
DEFINE_RTTI_DATA(failure, 0, 1, &runtime_error_rtti_base_descriptor, &exception_rtti_base_descriptor, NULL, ".?AVfailure@std@@");
DEFINE_RTTI_DATA2(failure, 0, &runtime_error_rtti_base_descriptor, &exception_rtti_base_descriptor, ".?AVfailure@std@@");
static const cxx_type_info failure_cxx_type_info = {
0,
......
......@@ -255,26 +255,26 @@ const int basic_istream_char_vbtable[] = {0, sizeof(basic_istream_char)};
/* ??_7?$basic_istream@DU?$char_traits@D@std@@@std@@6B@ */
extern const vtable_ptr MSVCP_basic_istream_char_vtable;
DEFINE_RTTI_DATA(iosb, 0, 0, NULL, NULL, NULL, ".?AV?$_Iosb@H@std@@");
DEFINE_RTTI_DATA(ios_base, 0, 1, &iosb_rtti_base_descriptor, NULL, NULL, ".?AV?$_Iosb@H@std@@");
DEFINE_RTTI_DATA(basic_ios_char, 0, 2, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
NULL, ".?AV?$basic_ios@DU?$char_traits@D@std@@@std@@");
DEFINE_RTTI_DATA(basic_ios_wchar, 0, 2, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
NULL, ".?AV?$basic_ios@_WU?$char_traits@_W@std@@@std@@");
DEFINE_RTTI_DATA(basic_ios_short, 0, 2, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
NULL, ".?AV?$basic_ios@GU?$char_traits@G@std@@@std@@");
DEFINE_RTTI_DATA(basic_streambuf_char, 0, 0, NULL, NULL, NULL,
DEFINE_RTTI_DATA0(iosb, 0, ".?AV?$_Iosb@H@std@@");
DEFINE_RTTI_DATA1(ios_base, 0, &iosb_rtti_base_descriptor, ".?AV?$_Iosb@H@std@@");
DEFINE_RTTI_DATA2(basic_ios_char, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
".?AV?$basic_ios@DU?$char_traits@D@std@@@std@@");
DEFINE_RTTI_DATA2(basic_ios_wchar, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
".?AV?$basic_ios@_WU?$char_traits@_W@std@@@std@@");
DEFINE_RTTI_DATA2(basic_ios_short, 0, &ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
".?AV?$basic_ios@GU?$char_traits@G@std@@@std@@");
DEFINE_RTTI_DATA0(basic_streambuf_char, 0,
".?AV?$basic_streambuf@DU?$char_traits@D@std@@@std@@");
DEFINE_RTTI_DATA(basic_streambuf_wchar, 0, 0, NULL, NULL, NULL,
DEFINE_RTTI_DATA0(basic_streambuf_wchar, 0,
".?AV?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@");
DEFINE_RTTI_DATA(basic_streambuf_short, 0, 0, NULL, NULL, NULL,
DEFINE_RTTI_DATA0(basic_streambuf_short, 0,
".?AV?$basic_streambuf@GU?$char_traits@G@std@@@std@@");
DEFINE_RTTI_DATA(basic_filebuf_char, 0, 1, &basic_streambuf_char_rtti_base_descriptor,
NULL, NULL, ".?AV?$basic_filebuf@DU?$char_traits@D@std@@@std@@");
DEFINE_RTTI_DATA(basic_ostream_char, sizeof(basic_ostream_char), 3, &basic_ios_char_rtti_base_descriptor,
DEFINE_RTTI_DATA1(basic_filebuf_char, 0, &basic_streambuf_char_rtti_base_descriptor,
".?AV?$basic_filebuf@DU?$char_traits@D@std@@@std@@");
DEFINE_RTTI_DATA3(basic_ostream_char, sizeof(basic_ostream_char), &basic_ios_char_rtti_base_descriptor,
&ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
".?AV?$basic_ostream@DU?$char_traits@D@std@@@std@@");
DEFINE_RTTI_DATA(basic_istream_char, sizeof(basic_istream_char), 3, &basic_ios_char_rtti_base_descriptor,
DEFINE_RTTI_DATA3(basic_istream_char, sizeof(basic_istream_char), &basic_ios_char_rtti_base_descriptor,
&ios_base_rtti_base_descriptor, &iosb_rtti_base_descriptor,
".?AV?$basic_istream@DU?$char_traits@D@std@@@std@@");
......
......@@ -4626,22 +4626,22 @@ locale* __cdecl locale_global(locale *ret, const locale *loc)
return ret;
}
DEFINE_RTTI_DATA(locale_facet, 0, 0, NULL, NULL, NULL, ".?AVfacet@locale@std@@");
DEFINE_RTTI_DATA(collate_char, 0, 1, &locale_facet_rtti_base_descriptor, NULL, NULL, ".?AV?$collate@D@std@@");
DEFINE_RTTI_DATA(collate_wchar, 0, 1, &locale_facet_rtti_base_descriptor, NULL, NULL, ".?AV?$collate@_W@std@@");
DEFINE_RTTI_DATA(collate_short, 0, 1, &locale_facet_rtti_base_descriptor, NULL, NULL, ".?AV?$collate@G@std@@");
DEFINE_RTTI_DATA(ctype_base, 0, 1, &locale_facet_rtti_base_descriptor, NULL, NULL, ".?AUctype_base@std@@");
DEFINE_RTTI_DATA(ctype_char, 0, 2, &ctype_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, NULL, ".?AV?$ctype@D@std@@");
DEFINE_RTTI_DATA(ctype_wchar, 0, 2, &ctype_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, NULL, ".?AV?$ctype@_W@std@@");
DEFINE_RTTI_DATA(ctype_short, 0, 2, &ctype_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, NULL, ".?AV?$ctype@G@std@@");
DEFINE_RTTI_DATA(codecvt_base, 0, 1, &locale_facet_rtti_base_descriptor, NULL, NULL, ".?AVcodecvt_base@std@@");
DEFINE_RTTI_DATA(codecvt_char, 0, 2, &codecvt_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, NULL, ".?AV?$codecvt@DDH@std@@");
DEFINE_RTTI_DATA(numpunct_char, 0, 1, &locale_facet_rtti_base_descriptor, NULL, NULL, ".?AV?$numpunct@D@std@@");
DEFINE_RTTI_DATA(numpunct_wchar, 0, 1, &locale_facet_rtti_base_descriptor, NULL, NULL, ".?AV?$numpunct@_W@std@@");
DEFINE_RTTI_DATA(numpunct_short, 0, 1, &locale_facet_rtti_base_descriptor, NULL, NULL, ".?AV?$numpunct@G@std@@");
DEFINE_RTTI_DATA(num_get_char, 0, 1, &locale_facet_rtti_base_descriptor, NULL, NULL, ".?AV?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@");
DEFINE_RTTI_DATA(num_get_wchar, 0, 1, &locale_facet_rtti_base_descriptor, NULL, NULL, ".?AV?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@");
DEFINE_RTTI_DATA(num_get_short, 0, 1, &locale_facet_rtti_base_descriptor, NULL, NULL, ".?AV?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@");
DEFINE_RTTI_DATA0(locale_facet, 0, ".?AVfacet@locale@std@@");
DEFINE_RTTI_DATA1(collate_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@D@std@@");
DEFINE_RTTI_DATA1(collate_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@_W@std@@");
DEFINE_RTTI_DATA1(collate_short, 0, &locale_facet_rtti_base_descriptor, ".?AV?$collate@G@std@@");
DEFINE_RTTI_DATA1(ctype_base, 0, &locale_facet_rtti_base_descriptor, ".?AUctype_base@std@@");
DEFINE_RTTI_DATA2(ctype_char, 0, &ctype_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$ctype@D@std@@");
DEFINE_RTTI_DATA2(ctype_wchar, 0, &ctype_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$ctype@_W@std@@");
DEFINE_RTTI_DATA2(ctype_short, 0, &ctype_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$ctype@G@std@@");
DEFINE_RTTI_DATA1(codecvt_base, 0, &locale_facet_rtti_base_descriptor, ".?AVcodecvt_base@std@@");
DEFINE_RTTI_DATA2(codecvt_char, 0, &codecvt_base_rtti_base_descriptor, &locale_facet_rtti_base_descriptor, ".?AV?$codecvt@DDH@std@@");
DEFINE_RTTI_DATA1(numpunct_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$numpunct@D@std@@");
DEFINE_RTTI_DATA1(numpunct_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$numpunct@_W@std@@");
DEFINE_RTTI_DATA1(numpunct_short, 0, &locale_facet_rtti_base_descriptor, ".?AV?$numpunct@G@std@@");
DEFINE_RTTI_DATA1(num_get_char, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_get@DV?$istreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@");
DEFINE_RTTI_DATA1(num_get_wchar, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_get@_WV?$istreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@");
DEFINE_RTTI_DATA1(num_get_short, 0, &locale_facet_rtti_base_descriptor, ".?AV?$num_get@GV?$istreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@");
#ifndef __GNUC__
void __asm_dummy_vtables(void) {
......
......@@ -82,7 +82,7 @@ extern void* (__cdecl *MSVCRT_set_new_handler)(void*);
#endif /* _WIN64 */
#define DEFINE_RTTI_DATA(name, off, base_classes, cl1, cl2, cl3, mangled_name) \
#define DEFINE_RTTI_DATA(name, off, base_classes, cl1, cl2, cl3, cl4, mangled_name) \
static const type_info name ## _type_info = { \
&MSVCP_type_info_vtable, \
NULL, \
......@@ -101,7 +101,8 @@ static const rtti_base_array name ## _rtti_base_array = { \
&name ## _rtti_base_descriptor, \
cl1, \
cl2, \
cl3 \
cl3, \
cl4 \
} \
}; \
\
......@@ -120,6 +121,17 @@ const rtti_object_locator name ## _rtti = { \
&name ## _hierarchy \
}
#define DEFINE_RTTI_DATA0(name, off, mangled_name) \
DEFINE_RTTI_DATA(name, off, 0, NULL, NULL, NULL, NULL, mangled_name)
#define DEFINE_RTTI_DATA1(name, off, cl1, mangled_name) \
DEFINE_RTTI_DATA(name, off, 0, cl1, NULL, NULL, NULL, mangled_name)
#define DEFINE_RTTI_DATA2(name, off, cl1, cl2, mangled_name) \
DEFINE_RTTI_DATA(name, off, 0, cl1, cl2, NULL, NULL, mangled_name)
#define DEFINE_RTTI_DATA3(name, off, cl1, cl2, cl3, mangled_name) \
DEFINE_RTTI_DATA(name, off, 0, cl1, cl2, cl3, NULL, mangled_name)
#define DEFINE_RTTI_DATA4(name, off, cl1, cl2, cl3, cl4, mangled_name) \
DEFINE_RTTI_DATA(name, off, 0, cl1, cl2, cl3, cl4, mangled_name)
#ifdef __i386__
#define CALL_VTBL_FUNC(this, off, ret, type, args) ((ret (WINAPI*)type)&vtbl_wrapper_##off)args
......@@ -198,7 +210,7 @@ typedef struct _rtti_base_descriptor
typedef struct _rtti_base_array
{
const rtti_base_descriptor *bases[4]; /* First element is the class itself */
const rtti_base_descriptor *bases[5]; /* First element is the class itself */
} rtti_base_array;
typedef struct _rtti_object_hierarchy
......
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