comparison test/plain_c++/test_main.cc @ 557:b36a738c8975

- dyncallback: fix for calling back win/x64 C++ methods returning non-trivial aggregates (thanks Raphael!) - test/callback_plain_c++: * added test code for C++ method callbacks returning non-trivial aggregates * makefile linker command fix (was linking assuming c and not c++) - test/plain_c++: comments for completeness
author Tassilo Philipp
date Sat, 20 Aug 2022 21:04:15 +0200
parents 0c3f5355769d
children fcb9d00b5a00
comparison
equal deleted inserted replaced
556:49b60ca068c2 557:b36a738c8975
85 85
86 // #define VTBI_DESTRUCTOR 0 86 // #define VTBI_DESTRUCTOR 0
87 87
88 /* 88 /*
89 * the layout of the VTable is non-standard and it is not clear what is the initial real first method index. 89 * the layout of the VTable is non-standard and it is not clear what is the initial real first method index.
90 * so far it turns out that: 90 * so far it turns out, *iff* dtor is defined, that:
91 * on vc/x86 : 1 91 * on msvc/x86 : 1
92 * on GCC/x86 : 2 92 * on msvc/x64 : 1
93 * on gcc/x86 : 2
94 * on gcc/x64 : 2
95 * on clang/x86 : 2
96 * on clang/x64 : 2
93 */ 97 */
94 98
99 // vtable offset to first func of class Value and class ValueMS, skipping dtor
95 #if defined DC__C_MSVC 100 #if defined DC__C_MSVC
96 #define VTBI_BASE 1 101 #define VTBI_BASE 1
97 #else 102 #else
98 #define VTBI_BASE 2 103 #define VTBI_BASE 2
99 #endif 104 #endif