# HG changeset patch # User Tassilo Philipp # Date 1662646552 -7200 # Node ID 87b5f5d7af1fc79037cee591dea18e8d138a64df # Parent 864cf3c3ceb95c2f30e69d5e26ceefbb24accc99 callback_plain_c++: improved cross-platform robustness of faked thiscall used for testing diff -r 864cf3c3ceb9 -r 87b5f5d7af1f test/callback_plain_c++/test_main.cc --- a/test/callback_plain_c++/test_main.cc Thu Sep 08 15:31:44 2022 +0200 +++ b/test/callback_plain_c++/test_main.cc Thu Sep 08 16:15:52 2022 +0200 @@ -130,7 +130,7 @@ int ret = 1; const char *sigs[] = { - ")A", // standard call + ")A", // standard call "_*p)A" // thiscall w/ this-ptr arg (special retval register handling in win/x64 calling conv) }; @@ -142,8 +142,9 @@ DCaggr *aggrs[1] = { NULL }; // one non-triv aggr DCCallback* cb = dcbNewCallback2(sigs[i], &cbNonTrivAggrReturnHandler, sigs+i, aggrs); - DCpointer fakeClass[sizeof(Dummy)/sizeof(sizeof(DCpointer))]; - fakeClass[0] = &cb; // write method ptr f + DCpointer fakeClass[sizeof(Dummy)/sizeof(DCpointer)]; + for(int j=0; jf() : ((NonTriv(*)())cb)();