tsdl
tsdl copied to clipboard
Add fixed-arity stub for SDL_Log
Fix for #99
(I still need to test this on Windows and Linux.)
Do you have an idea why the current scheme doesn't work ? There are bindings to snprintf
in ctypes' test suite here and it doesn't seem to be doing anything particular or different from what is being done here.
Perhaps @yallop has an idea ? (The signature of the function being bound to is here).
Per https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26744#c1 ("vararg functions support in libffi is not supported"):
libffi does not support variable arguments at all.
That was an old message for Apple (so it is clear that Apple testing is important) because at some point varargs was added to libffi:
https://www.chiark.greenend.org.uk/doc/libffi-dev/html/The-Basics.html
If the function being called is variadic (varargs) then
ffi_prep_cif_var
must be used instead offfi_prep_cif
.
snprintf
passing a test suite was luck, or perhaps the test suite did not include Apple.
s/Apple/macOS/
FYI: Do not merge this as-is. I think I introduced a regression in this PR ... the new symbol caml_tsdl_log1arg
needs to be in the stub, and for Windows that means it needs __declspec(export)
. I had mistakenly only tested this PR with macOS.
I'll finish off a new round of Linux/macOS/Windows testing in <48 hrs, and update this PR.
Finished testing (later than expected due to unrelated package's bug) and updated the PR.
It is good to go.