On Wed Oct 29 20:01:23 2025 +0000, Piotr Caban wrote:
I think it's better to keep cxx.h file identical in all the dlls. How about introducing a new macro `DEFINE_WINRT_CXX_TYPE` for WinRT? I'm thinking about something along these lines:
-#define DEFINE_CXX_TYPE(type, dtor, ...) \ +#define DEFINE_CXX_TYPE2(type, flags, ti_flags, dtor, copy_ctor, ...) \ static const cxx_type_info type ## _cxx_type_info[1] = \ - { { 0, &type ##_type_info, { 0, -1, 0 }, sizeof(type), THISCALL(type ##_copy_ctor) } }; \ + { { ti_flags, &type ##_type_info, { 0, -1, 0 }, sizeof(type), copy_ctor } }; \ \ static const cxx_type_info_table type ## _cxx_type_table = \ { ARRAY_SIZE(((const void *[]){ NULL, __VA_ARGS__ })), { type ## _cxx_type_info, __VA_ARGS__ } }; \ \ static const cxx_exception_type type ## _exception_type = \ - { 0, THISCALL(dtor), NULL, & type ## _cxx_type_table }; + { flags, dtor, NULL, & type ## _cxx_type_table }; #define INIT_CXX_TYPE(name,base) (void)name ## _exception_type +#define DEFINE_CXX_TYPE(type, dtor, ...) \ + DEFINE_CXX_TYPE2(type, 0, 0, THISCALL(dtor), THISCALL(type ##_copy_ctor), __VA_ARGS__) + +#define DEFINE_WINRT_CXX_TYPE(type, ...) \ + DEFINE_CXX_TYPE2(type, TYPE_FLAG_WINRT, CLASS_IS_WINRT, NULL, NULL, __VA_ARGS__)
Yes, it'll also make the RTTI declarations a little clearer. I'll attempt this in the latest revision, thanks