Commit 21a9a8c6 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp100: Add std::system_category() implementation.

parent b793e2e4
...@@ -2731,8 +2731,8 @@ ...@@ -2731,8 +2731,8 @@
@ thiscall -arch=win32 ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ(ptr) basic_streambuf_wchar_sync @ thiscall -arch=win32 ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MAEHXZ(ptr) basic_streambuf_wchar_sync
@ cdecl -arch=win64 ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ(ptr) basic_streambuf_wchar_sync @ cdecl -arch=win64 ?sync@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@MEAAHXZ(ptr) basic_streambuf_wchar_sync
@ cdecl ?sync_with_stdio@ios_base@std@@SA_N_N@Z(long) ios_base_sync_with_stdio @ cdecl ?sync_with_stdio@ios_base@std@@SA_N_N@Z(long) ios_base_sync_with_stdio
@ stub -arch=win32 ?system_category@std@@YAABVerror_category@1@XZ @ cdecl -arch=win32 ?system_category@std@@YAABVerror_category@1@XZ() std_system_category
@ stub -arch=win64 ?system_category@std@@YAAEBVerror_category@1@XZ @ cdecl -arch=win64 ?system_category@std@@YAAEBVerror_category@1@XZ() std_system_category
@ stub -arch=win32 ?table@?$ctype@D@std@@QBEPBFXZ @ stub -arch=win32 ?table@?$ctype@D@std@@QBEPBFXZ
@ stub -arch=win64 ?table@?$ctype@D@std@@QEBAPEBFXZ @ stub -arch=win64 ?table@?$ctype@D@std@@QEBAPEBFXZ
@ extern -arch=win32 ?table_size@?$ctype@D@std@@2IB ctype_char_table_size @ extern -arch=win32 ?table_size@?$ctype@D@std@@2IB ctype_char_table_size
......
...@@ -675,7 +675,6 @@ DEFINE_THISCALL_WRAPPER(custom_category_message, 12) ...@@ -675,7 +675,6 @@ DEFINE_THISCALL_WRAPPER(custom_category_message, 12)
basic_string_char* __thiscall custom_category_message(const custom_category *this, basic_string_char* __thiscall custom_category_message(const custom_category *this,
basic_string_char *ret, int err) basic_string_char *ret, int err)
{ {
if(err == 1) return MSVCP_basic_string_char_ctor_cstr(ret, "iostream error");
return MSVCP_basic_string_char_ctor_cstr(ret, strerror(err)); return MSVCP_basic_string_char_ctor_cstr(ret, strerror(err));
} }
...@@ -703,6 +702,14 @@ MSVCP_bool __thiscall custom_category_equivalent_code(custom_category *this, ...@@ -703,6 +702,14 @@ MSVCP_bool __thiscall custom_category_equivalent_code(custom_category *this,
return FALSE; return FALSE;
} }
DEFINE_THISCALL_WRAPPER(iostream_category_message, 12)
basic_string_char* __thiscall iostream_category_message(const custom_category *this,
basic_string_char *ret, int err)
{
if(err == 1) return MSVCP_basic_string_char_ctor_cstr(ret, "iostream error");
return MSVCP_basic_string_char_ctor_cstr(ret, strerror(err));
}
/* ?iostream_category@std@@YAABVerror_category@1@XZ */ /* ?iostream_category@std@@YAABVerror_category@1@XZ */
/* ?iostream_category@std@@YAAEBVerror_category@1@XZ */ /* ?iostream_category@std@@YAAEBVerror_category@1@XZ */
const error_category* __cdecl std_iostream_category(void) const error_category* __cdecl std_iostream_category(void)
...@@ -710,6 +717,25 @@ const error_category* __cdecl std_iostream_category(void) ...@@ -710,6 +717,25 @@ const error_category* __cdecl std_iostream_category(void)
TRACE("()\n"); TRACE("()\n");
return &iostream_category.base; return &iostream_category.base;
} }
static custom_category system_category;
DEFINE_RTTI_DATA1(system_category, 0, &error_category_rtti_base_descriptor, ".?AV_System_error_category@std@@")
extern const vtable_ptr MSVCP_system_category_vtable;
static void system_category_ctor(custom_category *this)
{
this->base.vtable = &MSVCP_system_category_vtable;
this->type = "system";
}
/* ?system_category@std@@YAABVerror_category@1@XZ */
/* ?system_category@std@@YAAEBVerror_category@1@XZ */
const error_category* __cdecl std_system_category(void)
{
TRACE("()\n");
return &system_category.base;
}
#endif #endif
#if _MSVCP_VER >= 110 #if _MSVCP_VER >= 110
...@@ -989,6 +1015,13 @@ void __asm_dummy_vtables(void) { ...@@ -989,6 +1015,13 @@ void __asm_dummy_vtables(void) {
__ASM_VTABLE(iostream_category, __ASM_VTABLE(iostream_category,
VTABLE_ADD_FUNC(custom_category_vector_dtor) VTABLE_ADD_FUNC(custom_category_vector_dtor)
VTABLE_ADD_FUNC(custom_category_name) VTABLE_ADD_FUNC(custom_category_name)
VTABLE_ADD_FUNC(iostream_category_message)
VTABLE_ADD_FUNC(custom_category_default_error_condition)
VTABLE_ADD_FUNC(custom_category_equivalent)
VTABLE_ADD_FUNC(custom_category_equivalent_code));
__ASM_VTABLE(system_category,
VTABLE_ADD_FUNC(custom_category_vector_dtor)
VTABLE_ADD_FUNC(custom_category_name)
VTABLE_ADD_FUNC(custom_category_message) VTABLE_ADD_FUNC(custom_category_message)
VTABLE_ADD_FUNC(custom_category_default_error_condition) VTABLE_ADD_FUNC(custom_category_default_error_condition)
VTABLE_ADD_FUNC(custom_category_equivalent) VTABLE_ADD_FUNC(custom_category_equivalent)
...@@ -1008,6 +1041,7 @@ void init_misc(void *base) ...@@ -1008,6 +1041,7 @@ void init_misc(void *base)
#if _MSVCP_VER == 100 #if _MSVCP_VER == 100
init_error_category_rtti(base); init_error_category_rtti(base);
init_iostream_category_rtti(base); init_iostream_category_rtti(base);
init_system_category_rtti(base);
#endif #endif
#if _MSVCP_VER >= 110 #if _MSVCP_VER >= 110
init__Pad_rtti(base); init__Pad_rtti(base);
...@@ -1016,6 +1050,7 @@ void init_misc(void *base) ...@@ -1016,6 +1050,7 @@ void init_misc(void *base)
#if _MSVCP_VER == 100 #if _MSVCP_VER == 100
iostream_category_ctor(&iostream_category); iostream_category_ctor(&iostream_category);
system_category_ctor(&system_category);
#endif #endif
} }
......
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