[Issue 5570] 64 bit C ABI not followed for passing structs and complex numbers as function parameters

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 22 02:47:44 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=5570



--- Comment #40 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-09-22 02:47:30 PDT ---
(In reply to comment #39)
> This leads to a lot of duplication, for example the authors had to duplicate c
> bindings just to address this:
> https://github.com/Jebbs/DSFML-C where they point to this bug.

I wonder if as a workaround you could type the prototypes in D as:

// note the .tupleof
sfWindow* sfWindow_create(VideoMode.tupleof mode, const(char)* title, uint
style, const(ContextSettings)* settings);

And then call it via:

VideoMode vm;
sfWindow_create(vm.tupleof, ...);

I'd assume this would then properly use the stack? It's worth trying out to
avoid any new code duplication, and then when 5570 is finally fixed all you
have to do in user code is to remove ".tupleof" in the calls.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list