[Issue 9931] Bus error interfacing with C function returning structs with floats

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 14 16:56:08 PDT 2013


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



--- Comment #3 from Martin Nowak <code at dawg.eu> 2013-04-14 16:56:04 PDT ---
NSRect foo (id screen)
{
    alias extern (C) NSRect function (id, SEL) frameFp;
    auto fp = cast(frameFp) &objc_msgSend_stret;
    return fp(screen, sel_registerName("visibleFrame".ptr));
}

- You omit the pointer to the return value, that might accidently work on some
ABIs because a hidden pointer to the return value is passed as first argument.

What's the problem with this?

NSRect foo(id screen)
{
    NSRect res;
    objc_msgSend_stret(&res, screen, sel_registerName("visibleFrame"));
    return res;
}

-- 
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