msvcp: Sync implementations.
diff --git a/dlls/msvcp100/cxx.h b/dlls/msvcp100/cxx.h
index 956675c..a39c741 100644
--- a/dlls/msvcp100/cxx.h
+++ b/dlls/msvcp100/cxx.h
@@ -110,6 +110,32 @@
&name ## _hierarchy \
}
+#define DEFINE_CXX_DATA(type, base_no, cl1, cl2, dtor) \
+\
+static const cxx_type_info type ## _cxx_type_info = { \
+ 0, \
+ & type ##_type_info, \
+ { 0, -1, 0 }, \
+ sizeof(type), \
+ (cxx_copy_ctor)THISCALL(MSVCP_ ## type ##_copy_ctor) \
+}; \
+\
+static const cxx_type_info_table type ## _cxx_type_table = { \
+ base_no+1, \
+ { \
+ & type ## _cxx_type_info, \
+ cl1, \
+ cl2 \
+ } \
+}; \
+\
+static const cxx_exception_type type ## _cxx_type = { \
+ 0, \
+ (cxx_copy_ctor)THISCALL(dtor), \
+ NULL, \
+ & type ## _cxx_type_table \
+};
+
#else
#define DEFINE_RTTI_DATA(name, off, base_classes_no, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
@@ -176,6 +202,43 @@
name ## _rtti.object_locator = (char*)&name ## _rtti - base; \
}
+#define DEFINE_CXX_DATA(type, base_no, cl1, cl2, dtor) \
+\
+static cxx_type_info type ## _cxx_type_info = { \
+ 0, \
+ 0xdeadbeef, \
+ { 0, -1, 0 }, \
+ sizeof(type), \
+ 0xdeadbeef \
+}; \
+\
+static cxx_type_info_table type ## _cxx_type_table = { \
+ base_no+1, \
+ { \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef \
+ } \
+}; \
+\
+static cxx_exception_type type ##_cxx_type = { \
+ 0, \
+ 0xdeadbeef, \
+ 0, \
+ 0xdeadbeef \
+}; \
+\
+static void init_ ## type ## _cxx(char *base) \
+{ \
+ type ## _cxx_type_info.type_info = (char *)&type ## _type_info - base; \
+ type ## _cxx_type_info.copy_ctor = (char *)MSVCP_ ## type ## _copy_ctor - base; \
+ type ## _cxx_type_table.info[0] = (char *)&type ## _cxx_type_info - base; \
+ type ## _cxx_type_table.info[1] = (char *)cl1 - base; \
+ type ## _cxx_type_table.info[2] = (char *)cl2 - base; \
+ type ## _cxx_type.destructor = (char *)dtor - base; \
+ type ## _cxx_type.type_info_table = (char *)&type ## _cxx_type_table - base; \
+}
+
#endif
#define DEFINE_RTTI_DATA0(name, off, mangled_name) \
@@ -193,6 +256,13 @@
#define DEFINE_RTTI_DATA9(name, off, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
DEFINE_RTTI_DATA(name, off, 9, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name)
+#define DEFINE_CXX_DATA0(name, dtor) \
+ DEFINE_CXX_DATA(name, 0, NULL, NULL, dtor)
+#define DEFINE_CXX_DATA1(name, cl1, dtor) \
+ DEFINE_CXX_DATA(name, 1, cl1, NULL, dtor)
+#define DEFINE_CXX_DATA2(name, cl1, cl2, dtor) \
+ DEFINE_CXX_DATA(name, 2, cl1, cl2, dtor)
+
#ifdef __i386__
#define CALL_VTBL_FUNC(this, off, ret, type, args) ((ret (WINAPI*)type)&vtbl_wrapper_##off)args
@@ -261,6 +331,9 @@
int vbase_offset; /* offset of this pointer offset in virtual base class descriptor */
} this_ptr_offsets;
+/* dlls/msvcrt/cppexcept.h */
+typedef void (*cxx_copy_ctor)(void);
+
#ifndef __x86_64__
typedef struct _rtti_base_descriptor
@@ -293,6 +366,29 @@
const rtti_object_hierarchy *type_hierarchy;
} rtti_object_locator;
+typedef struct
+{
+ UINT flags;
+ const type_info *type_info;
+ this_ptr_offsets offsets;
+ unsigned int size;
+ cxx_copy_ctor copy_ctor;
+} cxx_type_info;
+
+typedef struct
+{
+ UINT count;
+ const cxx_type_info *info[3];
+} cxx_type_info_table;
+
+typedef struct
+{
+ UINT flags;
+ void (*destructor)(void);
+ void* /*cxx_exc_custom_handler*/ custom_handler;
+ const cxx_type_info_table *type_info_table;
+} cxx_exception_type;
+
#else
typedef struct
@@ -326,4 +422,27 @@
unsigned int object_locator;
} rtti_object_locator;
+typedef struct
+{
+ UINT flags;
+ unsigned int type_info;
+ this_ptr_offsets offsets;
+ unsigned int size;
+ unsigned int copy_ctor;
+} cxx_type_info;
+
+typedef struct
+{
+ UINT count;
+ unsigned int info[3];
+} cxx_type_info_table;
+
+typedef struct
+{
+ UINT flags;
+ unsigned int destructor;
+ unsigned int custom_handler;
+ unsigned int type_info_table;
+} cxx_exception_type;
+
#endif
diff --git a/dlls/msvcp100/exception.c b/dlls/msvcp100/exception.c
index 052e731..968d11b 100644
--- a/dlls/msvcp100/exception.c
+++ b/dlls/msvcp100/exception.c
@@ -27,37 +27,9 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
-/* dlls/msvcrt/cppexcept.h */
-typedef void (*cxx_copy_ctor)(void);
-
-/* complete information about a C++ type */
-typedef struct __cxx_type_info
-{
- UINT flags; /* flags (see CLASS_* flags below) */
- const type_info *type_info; /* C++ type info */
- this_ptr_offsets offsets; /* offsets for computing the this pointer */
- unsigned int size; /* object size */
- cxx_copy_ctor copy_ctor; /* copy constructor */
-} cxx_type_info;
#define CLASS_IS_SIMPLE_TYPE 1
#define CLASS_HAS_VIRTUAL_BASE_CLASS 4
-/* table of C++ types that apply for a given object */
-typedef struct __cxx_type_info_table
-{
- UINT count; /* number of types */
- const cxx_type_info *info[3]; /* variable length, we declare it large enough for static RTTI */
-} cxx_type_info_table;
-
-/* type information for an exception object */
-typedef struct __cxx_exception_type
-{
- UINT flags; /* TYPE_FLAG flags */
- void (*destructor)(void);/* exception object destructor */
- void* /*cxx_exc_custom_handler*/ custom_handler; /* custom handler for this exception */
- const cxx_type_info_table *type_info_table; /* list of types for this exception object */
-} cxx_exception_type;
-
void WINAPI _CxxThrowException(exception*,const cxx_exception_type*);
/* vtables */
@@ -160,30 +132,7 @@
}
DEFINE_RTTI_DATA0(exception, 0, ".?AVexception@std@@");
-
-static const cxx_type_info exception_cxx_type_info = {
- 0,
- &exception_type_info,
- { 0, -1, 0 },
- sizeof(exception),
- (cxx_copy_ctor)THISCALL(MSVCP_exception_dtor)
-};
-
-static const cxx_type_info_table exception_cxx_type_table = {
- 1,
- {
- &exception_cxx_type_info,
- NULL,
- NULL
- }
-};
-
-static const cxx_exception_type exception_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_exception_copy_ctor),
- NULL,
- &exception_cxx_type_table
-};
+DEFINE_CXX_DATA0(exception, MSVCP_exception_dtor);
/* bad_alloc class data */
typedef exception bad_alloc;
@@ -240,30 +189,7 @@
}
DEFINE_RTTI_DATA1(bad_alloc, 0, &exception_rtti_base_descriptor, ".?AVbad_alloc@std@@");
-
-static const cxx_type_info bad_alloc_cxx_type_info = {
- 0,
- &bad_alloc_type_info,
- { 0, -1, 0 },
- sizeof(bad_alloc),
- (cxx_copy_ctor)THISCALL(MSVCP_bad_alloc_copy_ctor)
-};
-
-static const cxx_type_info_table bad_alloc_cxx_type_table = {
- 2,
- {
- &bad_alloc_cxx_type_info,
- &exception_cxx_type_info,
- NULL
- }
-};
-
-static const cxx_exception_type bad_alloc_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_bad_alloc_dtor),
- NULL,
- &bad_alloc_cxx_type_table
-};
+DEFINE_CXX_DATA1(bad_alloc, &exception_cxx_type_info, MSVCP_bad_alloc_dtor);
/* logic_error class data */
typedef struct _logic_error {
@@ -330,30 +256,7 @@
}
DEFINE_RTTI_DATA1(logic_error, 0, &exception_rtti_base_descriptor, ".?AVlogic_error@std@@");
-
-static const cxx_type_info logic_error_cxx_type_info = {
- 0,
- &logic_error_type_info,
- { 0, -1, 0 },
- sizeof(logic_error),
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_copy_ctor)
-};
-
-static const cxx_type_info_table logic_error_cxx_type_table = {
- 2,
- {
- &logic_error_cxx_type_info,
- &exception_cxx_type_info,
- NULL
- }
-};
-
-static const cxx_exception_type logic_error_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
- NULL,
- &logic_error_cxx_type_table
-};
+DEFINE_CXX_DATA1(logic_error, &exception_cxx_type_info, MSVCP_logic_error_dtor);
/* length_error class data */
typedef logic_error length_error;
@@ -378,30 +281,7 @@
}
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,
- &length_error_type_info,
- { 0, -1, 0 },
- sizeof(length_error),
- (cxx_copy_ctor)THISCALL(MSVCP_length_error_copy_ctor)
-};
-
-static const cxx_type_info_table length_error_cxx_type_table = {
- 3,
- {
- &length_error_cxx_type_info,
- &logic_error_cxx_type_info,
- &exception_cxx_type_info
- }
-};
-
-static const cxx_exception_type length_error_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
- NULL,
- &length_error_cxx_type_table
-};
+DEFINE_CXX_DATA2(length_error, &logic_error_cxx_type_info, &exception_cxx_type_info, MSVCP_logic_error_dtor);
/* out_of_range class data */
typedef logic_error out_of_range;
@@ -426,30 +306,7 @@
}
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,
- &out_of_range_type_info,
- { 0, -1, 0 },
- sizeof(out_of_range),
- (cxx_copy_ctor)THISCALL(MSVCP_out_of_range_copy_ctor)
-};
-
-static const cxx_type_info_table out_of_range_cxx_type_table = {
- 3,
- {
- &out_of_range_cxx_type_info,
- &logic_error_cxx_type_info,
- &exception_cxx_type_info
- }
-};
-
-static const cxx_exception_type out_of_range_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
- NULL,
- &out_of_range_cxx_type_table
-};
+DEFINE_CXX_DATA2(out_of_range, &logic_error_cxx_type_info, &exception_cxx_type_info, MSVCP_logic_error_dtor);
/* invalid_argument class data */
typedef logic_error invalid_argument;
@@ -474,30 +331,7 @@
}
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,
- &invalid_argument_type_info,
- { 0, -1, 0 },
- sizeof(invalid_argument),
- (cxx_copy_ctor)THISCALL(MSVCP_invalid_argument_copy_ctor)
-};
-
-static const cxx_type_info_table invalid_argument_cxx_type_table = {
- 3,
- {
- &invalid_argument_cxx_type_info,
- &logic_error_cxx_type_info,
- &exception_cxx_type_info
- }
-};
-
-static const cxx_exception_type invalid_argument_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
- NULL,
- &invalid_argument_cxx_type_table
-};
+DEFINE_CXX_DATA2(invalid_argument, &logic_error_cxx_type_info, &exception_cxx_type_info, MSVCP_logic_error_dtor);
/* runtime_error class data */
typedef struct {
@@ -564,30 +398,7 @@
}
DEFINE_RTTI_DATA1(runtime_error, 0, &exception_rtti_base_descriptor, ".?AVruntime_error@std@@");
-
-static const cxx_type_info runtime_error_cxx_type_info = {
- 0,
- &runtime_error_type_info,
- { 0, -1, 0 },
- sizeof(runtime_error),
- (cxx_copy_ctor)THISCALL(MSVCP_runtime_error_copy_ctor)
-};
-
-static const cxx_type_info_table runtime_error_cxx_type_table = {
- 2,
- {
- &runtime_error_cxx_type_info,
- &exception_cxx_type_info,
- NULL
- }
-};
-
-static const cxx_exception_type runtime_error_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_runtime_error_dtor),
- NULL,
- &runtime_error_cxx_type_table
-};
+DEFINE_CXX_DATA1(runtime_error, &exception_cxx_type_info, MSVCP_runtime_error_dtor);
/* failure class data */
typedef runtime_error failure;
@@ -634,30 +445,7 @@
}
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,
- &failure_type_info,
- { 0, -1, 0 },
- sizeof(failure),
- (cxx_copy_ctor)THISCALL(MSVCP_failure_copy_ctor)
-};
-
-static const cxx_type_info_table failure_cxx_type_table = {
- 3,
- {
- &failure_cxx_type_info,
- &runtime_error_cxx_type_info,
- &exception_cxx_type_info
- }
-};
-
-static const cxx_exception_type failure_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_failure_dtor),
- NULL,
- &failure_cxx_type_table
-};
+DEFINE_CXX_DATA2(failure, &runtime_error_cxx_type_info, &exception_cxx_type_info, MSVCP_runtime_error_dtor);
#ifndef __GNUC__
void __asm_dummy_vtables(void) {
@@ -755,5 +543,14 @@
init_invalid_argument_rtti(base);
init_runtime_error_rtti(base);
init_failure_rtti(base);
+
+ init_exception_cxx(base);
+ init_bad_alloc_cxx(base);
+ init_logic_error_cxx(base);
+ init_length_error_cxx(base);
+ init_out_of_range_cxx(base);
+ init_invalid_argument_cxx(base);
+ init_runtime_error_cxx(base);
+ init_failure_cxx(base);
#endif
}
diff --git a/dlls/msvcp100/ios.c b/dlls/msvcp100/ios.c
index 8122ad1..e9573a4 100644
--- a/dlls/msvcp100/ios.c
+++ b/dlls/msvcp100/ios.c
@@ -3809,11 +3809,12 @@
{
TRACE("(%p %p %p)\n", this, ret, loc);
- if(this->strbuf)
- return basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
+ if(this->strbuf) {
+ basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
+ locale_dtor(ret);
+ }
- locale_copy_ctor(ret, loc);
- return ret;
+ return ios_base_imbue(&this->base, ret, loc);
}
/* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBED_WD@Z */
diff --git a/dlls/msvcp100/locale.c b/dlls/msvcp100/locale.c
index e1bb2a0..304f198 100644
--- a/dlls/msvcp100/locale.c
+++ b/dlls/msvcp100/locale.c
@@ -3797,7 +3797,7 @@
static inline wchar_t mb_to_wc(char ch, const _Cvtvec *cvt)
{
- int state;
+ int state = 0;
wchar_t ret;
return _Mbrtowc(&ret, &ch, 1, &state, cvt) == 1 ? ret : 0;
@@ -7182,8 +7182,11 @@
return NULL;
}
for(i=0; i<this->facet_cnt; i++)
+ {
+ this->facetvec[i] = copy->facetvec[i];
if(this->facetvec[i])
locale_facet__Incref(this->facetvec[i]);
+ }
}
MSVCP_basic_string_char_copy_ctor(&this->name, ©->name);
_Lockit_dtor(&lock);
diff --git a/dlls/msvcp60/cxx.h b/dlls/msvcp60/cxx.h
index 42e9975..d82fe25 100644
--- a/dlls/msvcp60/cxx.h
+++ b/dlls/msvcp60/cxx.h
@@ -110,6 +110,32 @@
&name ## _hierarchy \
}
+#define DEFINE_CXX_DATA(type, base_no, cl1, cl2, dtor) \
+\
+static const cxx_type_info type ## _cxx_type_info = { \
+ 0, \
+ & type ##_type_info, \
+ { 0, -1, 0 }, \
+ sizeof(type), \
+ (cxx_copy_ctor)THISCALL(MSVCP_ ## type ##_copy_ctor) \
+}; \
+\
+static const cxx_type_info_table type ## _cxx_type_table = { \
+ base_no+1, \
+ { \
+ & type ## _cxx_type_info, \
+ cl1, \
+ cl2 \
+ } \
+}; \
+\
+static const cxx_exception_type type ## _cxx_type = { \
+ 0, \
+ (cxx_copy_ctor)THISCALL(dtor), \
+ NULL, \
+ & type ## _cxx_type_table \
+};
+
#else
#define DEFINE_RTTI_DATA(name, off, base_classes_no, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
@@ -176,6 +202,43 @@
name ## _rtti.object_locator = (char*)&name ## _rtti - base; \
}
+#define DEFINE_CXX_DATA(type, base_no, cl1, cl2, dtor) \
+\
+static cxx_type_info type ## _cxx_type_info = { \
+ 0, \
+ 0xdeadbeef, \
+ { 0, -1, 0 }, \
+ sizeof(type), \
+ 0xdeadbeef \
+}; \
+\
+static cxx_type_info_table type ## _cxx_type_table = { \
+ base_no+1, \
+ { \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef \
+ } \
+}; \
+\
+static cxx_exception_type type ##_cxx_type = { \
+ 0, \
+ 0xdeadbeef, \
+ 0, \
+ 0xdeadbeef \
+}; \
+\
+static void init_ ## type ## _cxx(char *base) \
+{ \
+ type ## _cxx_type_info.type_info = (char *)&type ## _type_info - base; \
+ type ## _cxx_type_info.copy_ctor = (char *)MSVCP_ ## type ## _copy_ctor - base; \
+ type ## _cxx_type_table.info[0] = (char *)&type ## _cxx_type_info - base; \
+ type ## _cxx_type_table.info[1] = (char *)cl1 - base; \
+ type ## _cxx_type_table.info[2] = (char *)cl2 - base; \
+ type ## _cxx_type.destructor = (char *)dtor - base; \
+ type ## _cxx_type.type_info_table = (char *)&type ## _cxx_type_table - base; \
+}
+
#endif
#define DEFINE_RTTI_DATA0(name, off, mangled_name) \
@@ -193,6 +256,13 @@
#define DEFINE_RTTI_DATA9(name, off, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
DEFINE_RTTI_DATA(name, off, 9, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name)
+#define DEFINE_CXX_DATA0(name, dtor) \
+ DEFINE_CXX_DATA(name, 0, NULL, NULL, dtor)
+#define DEFINE_CXX_DATA1(name, cl1, dtor) \
+ DEFINE_CXX_DATA(name, 1, cl1, NULL, dtor)
+#define DEFINE_CXX_DATA2(name, cl1, cl2, dtor) \
+ DEFINE_CXX_DATA(name, 2, cl1, cl2, dtor)
+
#ifdef __i386__
#define CALL_VTBL_FUNC(this, off, ret, type, args) ((ret (WINAPI*)type)&vtbl_wrapper_##off)args
@@ -258,6 +328,9 @@
int vbase_offset; /* offset of this pointer offset in virtual base class descriptor */
} this_ptr_offsets;
+/* dlls/msvcrt/cppexcept.h */
+typedef void (*cxx_copy_ctor)(void);
+
#ifndef __x86_64__
typedef struct _rtti_base_descriptor
@@ -290,6 +363,29 @@
const rtti_object_hierarchy *type_hierarchy;
} rtti_object_locator;
+typedef struct
+{
+ UINT flags;
+ const type_info *type_info;
+ this_ptr_offsets offsets;
+ unsigned int size;
+ cxx_copy_ctor copy_ctor;
+} cxx_type_info;
+
+typedef struct
+{
+ UINT count;
+ const cxx_type_info *info[3];
+} cxx_type_info_table;
+
+typedef struct
+{
+ UINT flags;
+ void (*destructor)(void);
+ void* /*cxx_exc_custom_handler*/ custom_handler;
+ const cxx_type_info_table *type_info_table;
+} cxx_exception_type;
+
#else
typedef struct
@@ -323,4 +419,27 @@
unsigned int object_locator;
} rtti_object_locator;
+typedef struct
+{
+ UINT flags;
+ unsigned int type_info;
+ this_ptr_offsets offsets;
+ unsigned int size;
+ unsigned int copy_ctor;
+} cxx_type_info;
+
+typedef struct
+{
+ UINT count;
+ unsigned int info[3];
+} cxx_type_info_table;
+
+typedef struct
+{
+ UINT flags;
+ unsigned int destructor;
+ unsigned int custom_handler;
+ unsigned int type_info_table;
+} cxx_exception_type;
+
#endif
diff --git a/dlls/msvcp60/exception.c b/dlls/msvcp60/exception.c
index 9e88e01..9d89fbb 100644
--- a/dlls/msvcp60/exception.c
+++ b/dlls/msvcp60/exception.c
@@ -27,37 +27,9 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
-/* dlls/msvcrt/cppexcept.h */
-typedef void (*cxx_copy_ctor)(void);
-
-/* complete information about a C++ type */
-typedef struct __cxx_type_info
-{
- UINT flags; /* flags (see CLASS_* flags below) */
- const type_info *type_info; /* C++ type info */
- this_ptr_offsets offsets; /* offsets for computing the this pointer */
- unsigned int size; /* object size */
- cxx_copy_ctor copy_ctor; /* copy constructor */
-} cxx_type_info;
#define CLASS_IS_SIMPLE_TYPE 1
#define CLASS_HAS_VIRTUAL_BASE_CLASS 4
-/* table of C++ types that apply for a given object */
-typedef struct __cxx_type_info_table
-{
- UINT count; /* number of types */
- const cxx_type_info *info[3]; /* variable length, we declare it large enough for static RTTI */
-} cxx_type_info_table;
-
-/* type information for an exception object */
-typedef struct __cxx_exception_type
-{
- UINT flags; /* TYPE_FLAG flags */
- void (*destructor)(void);/* exception object destructor */
- void* /*cxx_exc_custom_handler*/ custom_handler; /* custom handler for this exception */
- const cxx_type_info_table *type_info_table; /* list of types for this exception object */
-} cxx_exception_type;
-
void WINAPI _CxxThrowException(exception*,const cxx_exception_type*);
/* vtables */
@@ -165,6 +137,7 @@
}
DEFINE_RTTI_DATA0(exception, 0, ".?AVexception@std@@");
+DEFINE_CXX_DATA0(exception, MSVCP_exception_dtor);
/* ?_Doraise@bad_alloc@std@@MBEXXZ */
/* ?_Doraise@bad_alloc@std@@MEBAXXZ */
@@ -189,30 +162,6 @@
return this->name ? this->name : "Unknown exception";
}
-static const cxx_type_info exception_cxx_type_info = {
- 0,
- &exception_type_info,
- { 0, -1, 0 },
- sizeof(exception),
- (cxx_copy_ctor)THISCALL(MSVCP_exception_dtor)
-};
-
-static const cxx_type_info_table exception_cxx_type_table = {
- 1,
- {
- &exception_cxx_type_info,
- NULL,
- NULL
- }
-};
-
-static const cxx_exception_type exception_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_exception_copy_ctor),
- NULL,
- &exception_cxx_type_table
-};
-
/* bad_alloc class data */
typedef exception bad_alloc;
@@ -285,30 +234,7 @@
}
DEFINE_RTTI_DATA1(bad_alloc, 0, &exception_rtti_base_descriptor, ".?AVbad_alloc@std@@");
-
-static const cxx_type_info bad_alloc_cxx_type_info = {
- 0,
- &bad_alloc_type_info,
- { 0, -1, 0 },
- sizeof(bad_alloc),
- (cxx_copy_ctor)THISCALL(MSVCP_bad_alloc_copy_ctor)
-};
-
-static const cxx_type_info_table bad_alloc_cxx_type_table = {
- 2,
- {
- &bad_alloc_cxx_type_info,
- &exception_cxx_type_info,
- NULL
- }
-};
-
-static const cxx_exception_type bad_alloc_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_bad_alloc_dtor),
- NULL,
- &bad_alloc_cxx_type_table
-};
+DEFINE_CXX_DATA1(bad_alloc, &exception_cxx_type_info, MSVCP_bad_alloc_dtor);
/* logic_error class data */
typedef struct {
@@ -405,30 +331,7 @@
}
DEFINE_RTTI_DATA1(logic_error, 0, &exception_rtti_base_descriptor, ".?AVlogic_error@std@@");
-
-static const cxx_type_info logic_error_cxx_type_info = {
- 0,
- &logic_error_type_info,
- { 0, -1, 0 },
- sizeof(logic_error),
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_copy_ctor)
-};
-
-static const cxx_type_info_table logic_error_cxx_type_table = {
- 2,
- {
- &logic_error_cxx_type_info,
- &exception_cxx_type_info,
- NULL
- }
-};
-
-static const cxx_exception_type logic_error_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
- NULL,
- &logic_error_cxx_type_table
-};
+DEFINE_CXX_DATA1(logic_error, &exception_cxx_type_info, MSVCP_logic_error_dtor);
/* length_error class data */
typedef logic_error length_error;
@@ -473,30 +376,7 @@
}
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,
- &length_error_type_info,
- { 0, -1, 0 },
- sizeof(length_error),
- (cxx_copy_ctor)THISCALL(MSVCP_length_error_copy_ctor)
-};
-
-static const cxx_type_info_table length_error_cxx_type_table = {
- 3,
- {
- &length_error_cxx_type_info,
- &logic_error_cxx_type_info,
- &exception_cxx_type_info
- }
-};
-
-static const cxx_exception_type length_error_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
- NULL,
- &length_error_cxx_type_table
-};
+DEFINE_CXX_DATA2(length_error, &logic_error_cxx_type_info, &exception_cxx_type_info, MSVCP_logic_error_dtor);
/* out_of_range class data */
typedef logic_error out_of_range;
@@ -541,30 +421,7 @@
}
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,
- &out_of_range_type_info,
- { 0, -1, 0 },
- sizeof(out_of_range),
- (cxx_copy_ctor)THISCALL(MSVCP_out_of_range_copy_ctor)
-};
-
-static const cxx_type_info_table out_of_range_cxx_type_table = {
- 3,
- {
- &out_of_range_cxx_type_info,
- &logic_error_cxx_type_info,
- &exception_cxx_type_info
- }
-};
-
-static const cxx_exception_type out_of_range_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
- NULL,
- &out_of_range_cxx_type_table
-};
+DEFINE_CXX_DATA2(out_of_range, &logic_error_cxx_type_info, &exception_cxx_type_info, MSVCP_logic_error_dtor);
/* invalid_argument class data */
typedef logic_error invalid_argument;
@@ -589,30 +446,7 @@
}
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,
- &invalid_argument_type_info,
- { 0, -1, 0 },
- sizeof(invalid_argument),
- (cxx_copy_ctor)THISCALL(MSVCP_invalid_argument_copy_ctor)
-};
-
-static const cxx_type_info_table invalid_argument_cxx_type_table = {
- 3,
- {
- &invalid_argument_cxx_type_info,
- &logic_error_cxx_type_info,
- &exception_cxx_type_info
- }
-};
-
-static const cxx_exception_type invalid_argument_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
- NULL,
- &invalid_argument_cxx_type_table
-};
+DEFINE_CXX_DATA2(invalid_argument, &logic_error_cxx_type_info, &exception_cxx_type_info, MSVCP_logic_error_dtor);
/* runtime_error class data */
typedef logic_error runtime_error;
@@ -665,30 +499,7 @@
}
DEFINE_RTTI_DATA1(runtime_error, 0, &exception_rtti_base_descriptor, ".?AVruntime_error@std@@");
-
-static const cxx_type_info runtime_error_cxx_type_info = {
- 0,
- &runtime_error_type_info,
- { 0, -1, 0 },
- sizeof(runtime_error),
- (cxx_copy_ctor)THISCALL(MSVCP_runtime_error_copy_ctor)
-};
-
-static const cxx_type_info_table runtime_error_cxx_type_table = {
- 2,
- {
- &runtime_error_cxx_type_info,
- &exception_cxx_type_info,
- NULL
- }
-};
-
-static const cxx_exception_type runtime_error_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
- NULL,
- &runtime_error_cxx_type_table
-};
+DEFINE_CXX_DATA1(runtime_error, &exception_cxx_type_info, MSVCP_logic_error_dtor);
/* ?what@runtime_error@std@@UBEPBDXZ */
/* ?what@runtime_error@std@@UEBAPEBDXZ */
@@ -744,30 +555,7 @@
}
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,
- &failure_type_info,
- { 0, -1, 0 },
- sizeof(failure),
- (cxx_copy_ctor)THISCALL(MSVCP_failure_copy_ctor)
-};
-
-static const cxx_type_info_table failure_cxx_type_table = {
- 3,
- {
- &failure_cxx_type_info,
- &runtime_error_cxx_type_info,
- &exception_cxx_type_info
- }
-};
-
-static const cxx_exception_type failure_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_failure_dtor),
- NULL,
- &failure_cxx_type_table
-};
+DEFINE_CXX_DATA2(failure, &runtime_error_cxx_type_info, &exception_cxx_type_info, MSVCP_logic_error_dtor);
#ifndef __GNUC__
void __asm_dummy_vtables(void) {
@@ -872,5 +660,14 @@
init_invalid_argument_rtti(base);
init_runtime_error_rtti(base);
init_failure_rtti(base);
+
+ init_exception_cxx(base);
+ init_bad_alloc_cxx(base);
+ init_logic_error_cxx(base);
+ init_length_error_cxx(base);
+ init_out_of_range_cxx(base);
+ init_invalid_argument_cxx(base);
+ init_runtime_error_cxx(base);
+ init_failure_cxx(base);
#endif
}
diff --git a/dlls/msvcp60/ios.c b/dlls/msvcp60/ios.c
index 43bd10b..ba6299c 100644
--- a/dlls/msvcp60/ios.c
+++ b/dlls/msvcp60/ios.c
@@ -5046,11 +5046,12 @@
{
TRACE("(%p %p %p)\n", this, ret, loc);
- if(this->strbuf)
- return basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
+ if(this->strbuf) {
+ basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
+ locale_dtor(ret);
+ }
- locale_copy_ctor(ret, loc);
- return ret;
+ return ios_base_imbue(&this->base, ret, loc);
}
/* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBED_WD@Z */
diff --git a/dlls/msvcp60/locale.c b/dlls/msvcp60/locale.c
index 4471096..fc1f0ec 100644
--- a/dlls/msvcp60/locale.c
+++ b/dlls/msvcp60/locale.c
@@ -3948,7 +3948,7 @@
static inline wchar_t mb_to_wc(char ch, const _Cvtvec *cvt)
{
- int state;
+ int state = 0;
wchar_t ret;
return _Mbrtowc(&ret, &ch, 1, &state, cvt) == 1 ? ret : 0;
@@ -7201,8 +7201,11 @@
return NULL;
}
for(i=0; i<this->facet_cnt; i++)
+ {
+ this->facetvec[i] = copy->facetvec[i];
if(this->facetvec[i])
locale_facet__Incref(this->facetvec[i]);
+ }
}
basic_string_char_copy_ctor(&this->name, ©->name);
_Lockit_dtor(&lock);
diff --git a/dlls/msvcp71/cxx.h b/dlls/msvcp71/cxx.h
index de934ce..3b2491f 100644
--- a/dlls/msvcp71/cxx.h
+++ b/dlls/msvcp71/cxx.h
@@ -110,6 +110,32 @@
&name ## _hierarchy \
}
+#define DEFINE_CXX_DATA(type, base_no, cl1, cl2, dtor) \
+\
+static const cxx_type_info type ## _cxx_type_info = { \
+ 0, \
+ & type ##_type_info, \
+ { 0, -1, 0 }, \
+ sizeof(type), \
+ (cxx_copy_ctor)THISCALL(MSVCP_ ## type ##_copy_ctor) \
+}; \
+\
+static const cxx_type_info_table type ## _cxx_type_table = { \
+ base_no+1, \
+ { \
+ & type ## _cxx_type_info, \
+ cl1, \
+ cl2 \
+ } \
+}; \
+\
+static const cxx_exception_type type ## _cxx_type = { \
+ 0, \
+ (cxx_copy_ctor)THISCALL(dtor), \
+ NULL, \
+ & type ## _cxx_type_table \
+};
+
#else
#define DEFINE_RTTI_DATA(name, off, base_classes_no, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
@@ -176,6 +202,43 @@
name ## _rtti.object_locator = (char*)&name ## _rtti - base; \
}
+#define DEFINE_CXX_DATA(type, base_no, cl1, cl2, dtor) \
+\
+static cxx_type_info type ## _cxx_type_info = { \
+ 0, \
+ 0xdeadbeef, \
+ { 0, -1, 0 }, \
+ sizeof(type), \
+ 0xdeadbeef \
+}; \
+\
+static cxx_type_info_table type ## _cxx_type_table = { \
+ base_no+1, \
+ { \
+ 0xdeadbeef, \
+ 0xdeadbeef, \
+ 0xdeadbeef \
+ } \
+}; \
+\
+static cxx_exception_type type ##_cxx_type = { \
+ 0, \
+ 0xdeadbeef, \
+ 0, \
+ 0xdeadbeef \
+}; \
+\
+static void init_ ## type ## _cxx(char *base) \
+{ \
+ type ## _cxx_type_info.type_info = (char *)&type ## _type_info - base; \
+ type ## _cxx_type_info.copy_ctor = (char *)MSVCP_ ## type ## _copy_ctor - base; \
+ type ## _cxx_type_table.info[0] = (char *)&type ## _cxx_type_info - base; \
+ type ## _cxx_type_table.info[1] = (char *)cl1 - base; \
+ type ## _cxx_type_table.info[2] = (char *)cl2 - base; \
+ type ## _cxx_type.destructor = (char *)dtor - base; \
+ type ## _cxx_type.type_info_table = (char *)&type ## _cxx_type_table - base; \
+}
+
#endif
#define DEFINE_RTTI_DATA0(name, off, mangled_name) \
@@ -193,6 +256,13 @@
#define DEFINE_RTTI_DATA9(name, off, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name) \
DEFINE_RTTI_DATA(name, off, 9, cl1, cl2, cl3, cl4, cl5, cl6, cl7, cl8, cl9, mangled_name)
+#define DEFINE_CXX_DATA0(name, dtor) \
+ DEFINE_CXX_DATA(name, 0, NULL, NULL, dtor)
+#define DEFINE_CXX_DATA1(name, cl1, dtor) \
+ DEFINE_CXX_DATA(name, 1, cl1, NULL, dtor)
+#define DEFINE_CXX_DATA2(name, cl1, cl2, dtor) \
+ DEFINE_CXX_DATA(name, 2, cl1, cl2, dtor)
+
#ifdef __i386__
#define CALL_VTBL_FUNC(this, off, ret, type, args) ((ret (WINAPI*)type)&vtbl_wrapper_##off)args
@@ -259,6 +329,9 @@
int vbase_offset; /* offset of this pointer offset in virtual base class descriptor */
} this_ptr_offsets;
+/* dlls/msvcrt/cppexcept.h */
+typedef void (*cxx_copy_ctor)(void);
+
#ifndef __x86_64__
typedef struct _rtti_base_descriptor
@@ -291,6 +364,29 @@
const rtti_object_hierarchy *type_hierarchy;
} rtti_object_locator;
+typedef struct
+{
+ UINT flags;
+ const type_info *type_info;
+ this_ptr_offsets offsets;
+ unsigned int size;
+ cxx_copy_ctor copy_ctor;
+} cxx_type_info;
+
+typedef struct
+{
+ UINT count;
+ const cxx_type_info *info[3];
+} cxx_type_info_table;
+
+typedef struct
+{
+ UINT flags;
+ void (*destructor)(void);
+ void* /*cxx_exc_custom_handler*/ custom_handler;
+ const cxx_type_info_table *type_info_table;
+} cxx_exception_type;
+
#else
typedef struct
@@ -324,4 +420,27 @@
unsigned int object_locator;
} rtti_object_locator;
+typedef struct
+{
+ UINT flags;
+ unsigned int type_info;
+ this_ptr_offsets offsets;
+ unsigned int size;
+ unsigned int copy_ctor;
+} cxx_type_info;
+
+typedef struct
+{
+ UINT count;
+ unsigned int info[3];
+} cxx_type_info_table;
+
+typedef struct
+{
+ UINT flags;
+ unsigned int destructor;
+ unsigned int custom_handler;
+ unsigned int type_info_table;
+} cxx_exception_type;
+
#endif
diff --git a/dlls/msvcp71/exception.c b/dlls/msvcp71/exception.c
index 052e731..968d11b 100644
--- a/dlls/msvcp71/exception.c
+++ b/dlls/msvcp71/exception.c
@@ -27,37 +27,9 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
-/* dlls/msvcrt/cppexcept.h */
-typedef void (*cxx_copy_ctor)(void);
-
-/* complete information about a C++ type */
-typedef struct __cxx_type_info
-{
- UINT flags; /* flags (see CLASS_* flags below) */
- const type_info *type_info; /* C++ type info */
- this_ptr_offsets offsets; /* offsets for computing the this pointer */
- unsigned int size; /* object size */
- cxx_copy_ctor copy_ctor; /* copy constructor */
-} cxx_type_info;
#define CLASS_IS_SIMPLE_TYPE 1
#define CLASS_HAS_VIRTUAL_BASE_CLASS 4
-/* table of C++ types that apply for a given object */
-typedef struct __cxx_type_info_table
-{
- UINT count; /* number of types */
- const cxx_type_info *info[3]; /* variable length, we declare it large enough for static RTTI */
-} cxx_type_info_table;
-
-/* type information for an exception object */
-typedef struct __cxx_exception_type
-{
- UINT flags; /* TYPE_FLAG flags */
- void (*destructor)(void);/* exception object destructor */
- void* /*cxx_exc_custom_handler*/ custom_handler; /* custom handler for this exception */
- const cxx_type_info_table *type_info_table; /* list of types for this exception object */
-} cxx_exception_type;
-
void WINAPI _CxxThrowException(exception*,const cxx_exception_type*);
/* vtables */
@@ -160,30 +132,7 @@
}
DEFINE_RTTI_DATA0(exception, 0, ".?AVexception@std@@");
-
-static const cxx_type_info exception_cxx_type_info = {
- 0,
- &exception_type_info,
- { 0, -1, 0 },
- sizeof(exception),
- (cxx_copy_ctor)THISCALL(MSVCP_exception_dtor)
-};
-
-static const cxx_type_info_table exception_cxx_type_table = {
- 1,
- {
- &exception_cxx_type_info,
- NULL,
- NULL
- }
-};
-
-static const cxx_exception_type exception_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_exception_copy_ctor),
- NULL,
- &exception_cxx_type_table
-};
+DEFINE_CXX_DATA0(exception, MSVCP_exception_dtor);
/* bad_alloc class data */
typedef exception bad_alloc;
@@ -240,30 +189,7 @@
}
DEFINE_RTTI_DATA1(bad_alloc, 0, &exception_rtti_base_descriptor, ".?AVbad_alloc@std@@");
-
-static const cxx_type_info bad_alloc_cxx_type_info = {
- 0,
- &bad_alloc_type_info,
- { 0, -1, 0 },
- sizeof(bad_alloc),
- (cxx_copy_ctor)THISCALL(MSVCP_bad_alloc_copy_ctor)
-};
-
-static const cxx_type_info_table bad_alloc_cxx_type_table = {
- 2,
- {
- &bad_alloc_cxx_type_info,
- &exception_cxx_type_info,
- NULL
- }
-};
-
-static const cxx_exception_type bad_alloc_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_bad_alloc_dtor),
- NULL,
- &bad_alloc_cxx_type_table
-};
+DEFINE_CXX_DATA1(bad_alloc, &exception_cxx_type_info, MSVCP_bad_alloc_dtor);
/* logic_error class data */
typedef struct _logic_error {
@@ -330,30 +256,7 @@
}
DEFINE_RTTI_DATA1(logic_error, 0, &exception_rtti_base_descriptor, ".?AVlogic_error@std@@");
-
-static const cxx_type_info logic_error_cxx_type_info = {
- 0,
- &logic_error_type_info,
- { 0, -1, 0 },
- sizeof(logic_error),
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_copy_ctor)
-};
-
-static const cxx_type_info_table logic_error_cxx_type_table = {
- 2,
- {
- &logic_error_cxx_type_info,
- &exception_cxx_type_info,
- NULL
- }
-};
-
-static const cxx_exception_type logic_error_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
- NULL,
- &logic_error_cxx_type_table
-};
+DEFINE_CXX_DATA1(logic_error, &exception_cxx_type_info, MSVCP_logic_error_dtor);
/* length_error class data */
typedef logic_error length_error;
@@ -378,30 +281,7 @@
}
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,
- &length_error_type_info,
- { 0, -1, 0 },
- sizeof(length_error),
- (cxx_copy_ctor)THISCALL(MSVCP_length_error_copy_ctor)
-};
-
-static const cxx_type_info_table length_error_cxx_type_table = {
- 3,
- {
- &length_error_cxx_type_info,
- &logic_error_cxx_type_info,
- &exception_cxx_type_info
- }
-};
-
-static const cxx_exception_type length_error_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
- NULL,
- &length_error_cxx_type_table
-};
+DEFINE_CXX_DATA2(length_error, &logic_error_cxx_type_info, &exception_cxx_type_info, MSVCP_logic_error_dtor);
/* out_of_range class data */
typedef logic_error out_of_range;
@@ -426,30 +306,7 @@
}
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,
- &out_of_range_type_info,
- { 0, -1, 0 },
- sizeof(out_of_range),
- (cxx_copy_ctor)THISCALL(MSVCP_out_of_range_copy_ctor)
-};
-
-static const cxx_type_info_table out_of_range_cxx_type_table = {
- 3,
- {
- &out_of_range_cxx_type_info,
- &logic_error_cxx_type_info,
- &exception_cxx_type_info
- }
-};
-
-static const cxx_exception_type out_of_range_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
- NULL,
- &out_of_range_cxx_type_table
-};
+DEFINE_CXX_DATA2(out_of_range, &logic_error_cxx_type_info, &exception_cxx_type_info, MSVCP_logic_error_dtor);
/* invalid_argument class data */
typedef logic_error invalid_argument;
@@ -474,30 +331,7 @@
}
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,
- &invalid_argument_type_info,
- { 0, -1, 0 },
- sizeof(invalid_argument),
- (cxx_copy_ctor)THISCALL(MSVCP_invalid_argument_copy_ctor)
-};
-
-static const cxx_type_info_table invalid_argument_cxx_type_table = {
- 3,
- {
- &invalid_argument_cxx_type_info,
- &logic_error_cxx_type_info,
- &exception_cxx_type_info
- }
-};
-
-static const cxx_exception_type invalid_argument_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_logic_error_dtor),
- NULL,
- &invalid_argument_cxx_type_table
-};
+DEFINE_CXX_DATA2(invalid_argument, &logic_error_cxx_type_info, &exception_cxx_type_info, MSVCP_logic_error_dtor);
/* runtime_error class data */
typedef struct {
@@ -564,30 +398,7 @@
}
DEFINE_RTTI_DATA1(runtime_error, 0, &exception_rtti_base_descriptor, ".?AVruntime_error@std@@");
-
-static const cxx_type_info runtime_error_cxx_type_info = {
- 0,
- &runtime_error_type_info,
- { 0, -1, 0 },
- sizeof(runtime_error),
- (cxx_copy_ctor)THISCALL(MSVCP_runtime_error_copy_ctor)
-};
-
-static const cxx_type_info_table runtime_error_cxx_type_table = {
- 2,
- {
- &runtime_error_cxx_type_info,
- &exception_cxx_type_info,
- NULL
- }
-};
-
-static const cxx_exception_type runtime_error_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_runtime_error_dtor),
- NULL,
- &runtime_error_cxx_type_table
-};
+DEFINE_CXX_DATA1(runtime_error, &exception_cxx_type_info, MSVCP_runtime_error_dtor);
/* failure class data */
typedef runtime_error failure;
@@ -634,30 +445,7 @@
}
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,
- &failure_type_info,
- { 0, -1, 0 },
- sizeof(failure),
- (cxx_copy_ctor)THISCALL(MSVCP_failure_copy_ctor)
-};
-
-static const cxx_type_info_table failure_cxx_type_table = {
- 3,
- {
- &failure_cxx_type_info,
- &runtime_error_cxx_type_info,
- &exception_cxx_type_info
- }
-};
-
-static const cxx_exception_type failure_cxx_type = {
- 0,
- (cxx_copy_ctor)THISCALL(MSVCP_failure_dtor),
- NULL,
- &failure_cxx_type_table
-};
+DEFINE_CXX_DATA2(failure, &runtime_error_cxx_type_info, &exception_cxx_type_info, MSVCP_runtime_error_dtor);
#ifndef __GNUC__
void __asm_dummy_vtables(void) {
@@ -755,5 +543,14 @@
init_invalid_argument_rtti(base);
init_runtime_error_rtti(base);
init_failure_rtti(base);
+
+ init_exception_cxx(base);
+ init_bad_alloc_cxx(base);
+ init_logic_error_cxx(base);
+ init_length_error_cxx(base);
+ init_out_of_range_cxx(base);
+ init_invalid_argument_cxx(base);
+ init_runtime_error_cxx(base);
+ init_failure_cxx(base);
#endif
}
diff --git a/dlls/msvcp71/ios.c b/dlls/msvcp71/ios.c
index 32e3941..830d730 100644
--- a/dlls/msvcp71/ios.c
+++ b/dlls/msvcp71/ios.c
@@ -5211,11 +5211,12 @@
{
TRACE("(%p %p %p)\n", this, ret, loc);
- if(this->strbuf)
- return basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
+ if(this->strbuf) {
+ basic_streambuf_wchar_pubimbue(this->strbuf, ret, loc);
+ locale_dtor(ret);
+ }
- locale_copy_ctor(ret, loc);
- return ret;
+ return ios_base_imbue(&this->base, ret, loc);
}
/* ?narrow@?$basic_ios@_WU?$char_traits@_W@std@@@std@@QBED_WD@Z */
@@ -10936,19 +10937,17 @@
return this;
}
-/* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PBGHH@Z */
-/* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBGHH@Z */
/* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PB_WHH@Z */
/* ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEB_WHH@Z */
-DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name_wchar, 20)
-basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name_wchar(basic_fstream_wchar *this,
- const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
+DEFINE_THISCALL_WRAPPER(basic_fstream_wchar_ctor_name, 20)
+basic_fstream_wchar* __thiscall basic_fstream_wchar_ctor_name(basic_fstream_wchar *this,
+ const char *name, int mode, int prot, MSVCP_bool virt_init)
{
- TRACE("(%p %s %d %d %d)\n", this, debugstr_w(name), mode, prot, virt_init);
+ TRACE("(%p %s %d %d %d)\n", this, name, mode, prot, virt_init);
basic_fstream_wchar_ctor(this, virt_init);
- if(!basic_filebuf_wchar_open_wchar(&this->filebuf, name, mode, prot)) {
+ if(!basic_filebuf_wchar_open(&this->filebuf, name, mode, prot)) {
basic_ios_wchar *basic_ios = basic_istream_wchar_get_basic_ios(&this->base.base1);
basic_ios_wchar_setstate(basic_ios, IOSTATE_failbit);
}
@@ -10957,13 +10956,11 @@
/* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBGHH@Z */
/* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBGHH@Z */
-/* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PB_WHH@Z */
-/* ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEB_WHH@Z */
-DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name_wchar, 20)
-basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name_wchar(basic_fstream_wchar *this,
- const wchar_t *name, int mode, int prot, MSVCP_bool virt_init)
+DEFINE_THISCALL_WRAPPER(basic_fstream_short_ctor_name, 20)
+basic_fstream_wchar* __thiscall basic_fstream_short_ctor_name(basic_fstream_wchar *this,
+ const char *name, int mode, int prot, MSVCP_bool virt_init)
{
- basic_fstream_wchar_ctor_name_wchar(this, name, mode, prot, virt_init);
+ basic_fstream_wchar_ctor_name(this, name, mode, prot, virt_init);
basic_istream_wchar_get_basic_ios(&this->base.base1)->base.vtable = &MSVCP_basic_fstream_short_vtable;
return this;
}
diff --git a/dlls/msvcp71/locale.c b/dlls/msvcp71/locale.c
index 8572b3e..3a52271 100644
--- a/dlls/msvcp71/locale.c
+++ b/dlls/msvcp71/locale.c
@@ -4215,7 +4215,7 @@
static inline wchar_t mb_to_wc(char ch, const _Cvtvec *cvt)
{
- int state;
+ int state = 0;
wchar_t ret;
return _Mbrtowc(&ret, &ch, 1, &state, cvt) == 1 ? ret : 0;
@@ -7574,8 +7574,11 @@
return NULL;
}
for(i=0; i<this->facet_cnt; i++)
+ {
+ this->facetvec[i] = copy->facetvec[i];
if(this->facetvec[i])
locale_facet__Incref(this->facetvec[i]);
+ }
}
MSVCP_basic_string_char_copy_ctor(&this->name, ©->name);
_Lockit_dtor(&lock);
diff --git a/dlls/msvcp71/msvcp71.spec b/dlls/msvcp71/msvcp71.spec
index 4dd122c..a8c3869 100644
--- a/dlls/msvcp71/msvcp71.spec
+++ b/dlls/msvcp71/msvcp71.spec
@@ -548,14 +548,14 @@
@ cdecl -arch=win64 ??0?$basic_fstream@DU?$char_traits@D@std@@@std@@QEAA@XZ(ptr long) basic_fstream_char_ctor
@ thiscall -arch=win32 ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PAU_iobuf@@@Z(ptr ptr long) basic_fstream_short_ctor_file
@ cdecl -arch=win64 ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEAU_iobuf@@@Z(ptr ptr long) basic_fstream_short_ctor_file
-@ thiscall -arch=win32 ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBDHH@Z(ptr wstr long long long) basic_fstream_short_ctor_name_wchar
-@ cdecl -arch=win64 ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDHH@Z(ptr wstr long long long) basic_fstream_short_ctor_name_wchar
+@ thiscall -arch=win32 ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@PBDHH@Z(ptr wstr long long long) basic_fstream_short_ctor_name
+@ cdecl -arch=win64 ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@PEBDHH@Z(ptr wstr long long long) basic_fstream_short_ctor_name
@ thiscall -arch=win32 ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QAE@XZ(ptr long) basic_fstream_short_ctor
@ cdecl -arch=win64 ??0?$basic_fstream@GU?$char_traits@G@std@@@std@@QEAA@XZ(ptr long) basic_fstream_short_ctor
@ thiscall -arch=win32 ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PAU_iobuf@@@Z(ptr ptr long) basic_fstream_wchar_ctor_file
@ cdecl -arch=win64 ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEAU_iobuf@@@Z(ptr ptr long) basic_fstream_wchar_ctor_file
-@ thiscall -arch=win32 ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDHH@Z(ptr wstr long long long) basic_fstream_wchar_ctor_name_wchar
-@ cdecl -arch=win64 ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDHH@Z(ptr wstr long long long) basic_fstream_wchar_ctor_name_wchar
+@ thiscall -arch=win32 ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@PBDHH@Z(ptr wstr long long long) basic_fstream_wchar_ctor_name
+@ cdecl -arch=win64 ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@PEBDHH@Z(ptr wstr long long long) basic_fstream_wchar_ctor_name
@ thiscall -arch=win32 ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QAE@XZ(ptr long) basic_fstream_wchar_ctor
@ cdecl -arch=win64 ??0?$basic_fstream@_WU?$char_traits@_W@std@@@std@@QEAA@XZ(ptr long) basic_fstream_wchar_ctor
@ thiscall -arch=win32 ??0?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAE@PAU_iobuf@@@Z(ptr ptr long) basic_ifstream_char_ctor_file
diff --git a/dlls/msvcp71/string.c b/dlls/msvcp71/string.c
index 465cef4..9907ad1 100644
--- a/dlls/msvcp71/string.c
+++ b/dlls/msvcp71/string.c
@@ -2037,17 +2037,6 @@
return this;
}
-/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@V?$_String_const_iterator@DU?$char_traits@D@std@@V?$allocator@D@2@@2@0PBD1@Z */
-/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@V?$_String_const_iterator@DU?$char_traits@D@std@@V?$allocator@D@2@@2@0PEBD1@Z */
-static basic_string_char* basic_string_char_replace_iter_ptr_ptr(basic_string_char *this,
- basic_string_char_iterator beg, basic_string_char_iterator end,
- const char *res_beg, const char *res_end)
-{
- basic_string_char_iterator begin = { basic_string_char_ptr(this) };
- return basic_string_char_replace_cstr_len(this, basic_string_char__Pdif(beg, begin),
- basic_string_char__Pdif(end, beg), res_beg, res_end-res_beg);
-}
-
/* ?replace@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@Viterator@12@0PBD1@Z */
DEFINE_THISCALL_WRAPPER(basic_string_char_replace_iter_beg_end, 20)
basic_string_char* __thiscall basic_string_char_replace_iter_beg_end(basic_string_char *this,
@@ -2155,22 +2144,6 @@
return basic_string_char_insert_iter_ch(this, ret, where, 0);
}
-/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXViterator@12@Vconst_iterator@12@1@Z */
-DEFINE_THISCALL_WRAPPER(basic_string_char_insert_iter_beg_end, 16)
-void __thiscall basic_string_char_insert_iter_beg_end(basic_string_char *this,
- basic_string_char_iterator where, basic_string_char_iterator beg, basic_string_char_iterator end)
-{
- basic_string_char_replace_iter_iter(this, where, where, beg, end);
-}
-
-/* ?insert@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXViterator@12@PBD1@Z */
-DEFINE_THISCALL_WRAPPER(basic_string_char_insert_iter_ptr_ptr, 16)
-void __thiscall basic_string_char_insert_iter_ptr_ptr(basic_string_char *this,
- basic_string_char_iterator where, const char *beg, const char *end)
-{
- basic_string_char_replace_iter_ptr_ptr(this, where, where, beg, end);
-}
-
/* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXID@Z */
/* ?resize@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAX_KD@Z */
DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_resize_ch, 12)