Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
bc057073
Commit
bc057073
authored
Aug 18, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Allow specifying destructor in DEFINE_CXX_DATA macro.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b24ee3b5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
85 deletions
+48
-85
cpp.c
dlls/msvcrt/cpp.c
+13
-67
cppexcept.h
dlls/msvcrt/cppexcept.h
+35
-18
No files found.
dlls/msvcrt/cpp.c
View file @
bc057073
...
...
@@ -731,14 +731,6 @@ HRESULT __thiscall scheduler_resource_allocation_error_get_error_code(
return
this
->
hr
;
}
DEFINE_THISCALL_WRAPPER
(
scheduler_resource_allocation_error_dtor
,
4
)
void
__thiscall
scheduler_resource_allocation_error_dtor
(
scheduler_resource_allocation_error
*
this
)
{
TRACE
(
"(%p)
\n
"
,
this
);
exception_dtor
(
&
this
->
e
);
}
typedef
exception
improper_lock
;
extern
const
vtable_ptr
improper_lock_vtable
;
...
...
@@ -770,13 +762,6 @@ improper_lock * __thiscall improper_lock_copy_ctor(improper_lock * _this, const
return
_this
;
}
DEFINE_THISCALL_WRAPPER
(
improper_lock_dtor
,
4
)
void
__thiscall
improper_lock_dtor
(
improper_lock
*
_this
)
{
TRACE
(
"(%p)
\n
"
,
_this
);
exception_dtor
(
_this
);
}
typedef
exception
invalid_scheduler_policy_key
;
extern
const
vtable_ptr
invalid_scheduler_policy_key_vtable
;
...
...
@@ -811,14 +796,6 @@ invalid_scheduler_policy_key * __thiscall invalid_scheduler_policy_key_copy_ctor
return
_this
;
}
DEFINE_THISCALL_WRAPPER
(
invalid_scheduler_policy_key_dtor
,
4
)
void
__thiscall
invalid_scheduler_policy_key_dtor
(
invalid_scheduler_policy_key
*
_this
)
{
TRACE
(
"(%p)
\n
"
,
_this
);
exception_dtor
(
_this
);
}
typedef
exception
invalid_scheduler_policy_value
;
extern
const
vtable_ptr
invalid_scheduler_policy_value_vtable
;
...
...
@@ -853,14 +830,6 @@ invalid_scheduler_policy_value * __thiscall invalid_scheduler_policy_value_copy_
return
_this
;
}
DEFINE_THISCALL_WRAPPER
(
invalid_scheduler_policy_value_dtor
,
4
)
void
__thiscall
invalid_scheduler_policy_value_dtor
(
invalid_scheduler_policy_value
*
_this
)
{
TRACE
(
"(%p)
\n
"
,
_this
);
exception_dtor
(
_this
);
}
typedef
exception
invalid_scheduler_policy_thread_specification
;
extern
const
vtable_ptr
invalid_scheduler_policy_thread_specification_vtable
;
...
...
@@ -895,14 +864,6 @@ invalid_scheduler_policy_thread_specification * __thiscall invalid_scheduler_pol
return
_this
;
}
DEFINE_THISCALL_WRAPPER
(
invalid_scheduler_policy_thread_specification_dtor
,
4
)
void
__thiscall
invalid_scheduler_policy_thread_specification_dtor
(
invalid_scheduler_policy_thread_specification
*
_this
)
{
TRACE
(
"(%p)
\n
"
,
_this
);
exception_dtor
(
_this
);
}
typedef
exception
improper_scheduler_attach
;
extern
const
vtable_ptr
improper_scheduler_attach_vtable
;
...
...
@@ -937,14 +898,6 @@ improper_scheduler_attach * __thiscall improper_scheduler_attach_copy_ctor(
return
_this
;
}
DEFINE_THISCALL_WRAPPER
(
improper_scheduler_attach_dtor
,
4
)
void
__thiscall
improper_scheduler_attach_dtor
(
improper_scheduler_attach
*
_this
)
{
TRACE
(
"(%p)
\n
"
,
_this
);
exception_dtor
(
_this
);
}
typedef
exception
improper_scheduler_detach
;
extern
const
vtable_ptr
improper_scheduler_detach_vtable
;
...
...
@@ -979,14 +932,6 @@ improper_scheduler_detach * __thiscall improper_scheduler_detach_copy_ctor(
return
_this
;
}
DEFINE_THISCALL_WRAPPER
(
improper_scheduler_detach_dtor
,
4
)
void
__thiscall
improper_scheduler_detach_dtor
(
improper_scheduler_detach
*
_this
)
{
TRACE
(
"(%p)
\n
"
,
_this
);
exception_dtor
(
_this
);
}
#endif
/* _MSVCR_VER >= 100 */
__ASM_BLOCK_BEGIN
(
vtables
)
...
...
@@ -1069,21 +1014,22 @@ DEFINE_RTTI_DATA1(improper_scheduler_detach, 0, &exception_rtti_base_descriptor,
".?AVimproper_scheduler_detach@Concurrency@@"
)
#endif
DEFINE_EXCEPTION_TYPE_INFO
(
exception
,
0
,
NULL
,
NULL
)
DEFINE_EXCEPTION_TYPE_INFO
(
bad_typeid
,
1
,
&
exception_cxx_type_info
,
NULL
)
DEFINE_EXCEPTION_TYPE_INFO
(
bad_cast
,
1
,
&
exception_cxx_type_info
,
NULL
)
DEFINE_EXCEPTION_TYPE_INFO
(
__non_rtti_object
,
2
,
&
bad_typeid_cxx_type_info
,
&
exception_cxx_type_info
)
DEFINE_CXX_DATA0
(
exception
,
exception_dtor
)
DEFINE_CXX_DATA1
(
bad_typeid
,
&
exception_cxx_type_info
,
bad_typeid_dtor
)
DEFINE_CXX_DATA1
(
bad_cast
,
&
exception_cxx_type_info
,
bad_cast_dtor
)
DEFINE_CXX_DATA2
(
__non_rtti_object
,
&
bad_typeid_cxx_type_info
,
&
exception_cxx_type_info
,
__non_rtti_object_dtor
)
#if _MSVCR_VER >= 80
DEFINE_
EXCEPTION_TYPE_INFO
(
bad_alloc
,
1
,
&
exception_cxx_type_info
,
NULL
)
DEFINE_
CXX_DATA1
(
bad_alloc
,
&
exception_cxx_type_info
,
bad_alloc_dtor
)
#endif
#if _MSVCR_VER >= 100
DEFINE_
EXCEPTION_TYPE_INFO
(
scheduler_resource_allocation_error
,
1
,
&
exception_cxx_type_info
,
NULL
)
DEFINE_
EXCEPTION_TYPE_INFO
(
improper_lock
,
1
,
&
exception_cxx_type_info
,
NULL
)
DEFINE_
EXCEPTION_TYPE_INFO
(
invalid_scheduler_policy_key
,
1
,
&
exception_cxx_type_info
,
NULL
)
DEFINE_
EXCEPTION_TYPE_INFO
(
invalid_scheduler_policy_value
,
1
,
&
exception_cxx_type_info
,
NULL
)
DEFINE_
EXCEPTION_TYPE_INFO
(
invalid_scheduler_policy_thread_specification
,
1
,
&
exception_cxx_type_info
,
NULL
)
DEFINE_
EXCEPTION_TYPE_INFO
(
improper_scheduler_attach
,
1
,
&
exception_cxx_type_info
,
NULL
)
DEFINE_
EXCEPTION_TYPE_INFO
(
improper_scheduler_detach
,
1
,
&
exception_cxx_type_info
,
NULL
)
DEFINE_
CXX_DATA1
(
scheduler_resource_allocation_error
,
&
exception_cxx_type_info
,
exception_dtor
)
DEFINE_
CXX_DATA1
(
improper_lock
,
&
exception_cxx_type_info
,
exception_dtor
)
DEFINE_
CXX_DATA1
(
invalid_scheduler_policy_key
,
&
exception_cxx_type_info
,
exception_dtor
)
DEFINE_
CXX_DATA1
(
invalid_scheduler_policy_value
,
&
exception_cxx_type_info
,
exception_dtor
)
DEFINE_
CXX_DATA1
(
invalid_scheduler_policy_thread_specification
,
&
exception_cxx_type_info
,
exception_dtor
)
DEFINE_
CXX_DATA1
(
improper_scheduler_attach
,
&
exception_cxx_type_info
,
exception_dtor
)
DEFINE_
CXX_DATA1
(
improper_scheduler_detach
,
&
exception_cxx_type_info
,
exception_dtor
)
#endif
void
msvcrt_init_exception
(
void
*
base
)
...
...
dlls/msvcrt/cppexcept.h
View file @
bc057073
...
...
@@ -156,36 +156,37 @@ static inline void *get_this_pointer( const this_ptr_offsets *off, void *object
}
#ifndef __x86_64__
#define DEFINE_EXCEPTION_TYPE_INFO(type, base_no, cl1, cl2) \
\
#define DEFINE_CXX_TYPE_INFO(type) \
static const cxx_type_info type ## _cxx_type_info = { \
0, \
& type ##_type_info, \
{ 0, -1, 0 }, \
sizeof(type), \
(cxx_copy_ctor)THISCALL(type ##_copy_ctor) \
}; \
};
#define DEFINE_CXX_DATA(type, base_no, cl1, cl2, dtor) \
DEFINE_CXX_TYPE_INFO(type) \
\
static const cxx_type_info_table type ## _
type_info
_table = { \
static const cxx_type_info_table type ## _
cxx_type
_table = { \
base_no+1, \
{ \
& type ## _cxx_type_info, \
cl1, \
cl2 \
cl2
,
\
} \
}; \
\
static const cxx_exception_type type ## _exception_type = { \
0, \
(cxx_copy_ctor)THISCALL(
type ## _
dtor), \
(cxx_copy_ctor)THISCALL(dtor), \
NULL, \
& type ## _
type_info
_table \
& type ## _
cxx_type
_table \
};
#else
#define DEFINE_EXCEPTION_TYPE_INFO(type, base_no, cl1, cl2) \
\
#define DEFINE_CXX_TYPE_INFO(type) \
static cxx_type_info type ## _cxx_type_info = { \
0, \
0xdeadbeef, \
...
...
@@ -194,12 +195,22 @@ static cxx_type_info type ## _cxx_type_info = { \
0xdeadbeef \
}; \
\
static cxx_type_info_table type ## _type_info_table = { \
static void init_ ## type ## _cxx_type_info(char *base) \
{ \
type ## _cxx_type_info.type_info = (char *)&type ## _type_info - base; \
type ## _cxx_type_info.copy_ctor = (char *)type ## _copy_ctor - base; \
}
#define DEFINE_CXX_DATA(type, base_no, cl1, cl2, dtor) \
\
DEFINE_CXX_TYPE_INFO(type) \
\
static cxx_type_info_table type ## _cxx_type_table = { \
base_no+1, \
{ \
0xdeadbeef, \
0xdeadbeef, \
0xdeadbeef
\
0xdeadbeef
,
\
} \
}; \
\
...
...
@@ -212,14 +223,20 @@ static cxx_exception_type type ##_exception_type = { \
\
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 *)type ## _copy_ctor - base; \
type ## _type_info_table.info[0] = (char *)&type ## _cxx_type_info - base; \
type ## _type_info_table.info[1] = (char *)cl1 - base; \
type ## _type_info_table.info[2] = (char *)cl2 - base; \
type ## _exception_type.destructor = (char *)type ## _dtor - base; \
type ## _exception_type.type_info_table = (char *)&type ## _type_info_table - base; \
init_ ## type ## _cxx_type_info(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 ## _exception_type.destructor = (char *)dtor - base; \
type ## _exception_type.type_info_table = (char *)&type ## _cxx_type_table - base; \
}
#endif
#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)
#endif
/* __MSVCRT_CPPEXCEPT_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment