[1/4] msvcp90: Add a macro to generate vector dtors (try 2)
William Panlener
wpanlener at gmail.com
Fri Apr 20 21:39:40 CDT 2012
---
dlls/msvcp90/msvcp90.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h
index 1b40b55..0475127 100644
--- a/dlls/msvcp90/msvcp90.h
+++ b/dlls/msvcp90/msvcp90.h
@@ -81,6 +81,24 @@ extern void* (__cdecl *MSVCRT_set_new_handler)(void*);
#endif /* _WIN64 */
+#define MSVCP_VECTOR_DTOR(type) \
+DEFINE_THISCALL_WRAPPER(MSVCP_ ## type ## _vector_dtor, 8) \
+type* __thiscall MSVCP_ ## type ## _vector_dtor(type* this, unsigned int flags) \
+{ \
+ TRACE("(%p %x)\n", this, flags); \
+ if(flags & 2) { \
+ int i, *ptr = (int *)this-1; \
+ for(i=*ptr-1; i>=0; i--) \
+ type ## _dtor(this+i); \
+ MSVCRT_operator_delete(ptr); \
+ } else { \
+ type ## _dtor(this); \
+ if(flags & 1) \
+ MSVCRT_operator_delete(this); \
+ } \
+ return this; \
+}
+
#define DEFINE_RTTI_DATA(name, off, base_classes, cl1, cl2, cl3, mangled_name) \
static const type_info name ## _type_info = { \
&MSVCP_type_info_vtable, \
--
1.7.9.5
More information about the wine-patches
mailing list