[Issue 4288] Error on passing delegate to C linkage function.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 6 09:59:33 PDT 2010


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


Robert Clipsham <robert at octarineparrot.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |robert at octarineparrot.com


--- Comment #1 from Robert Clipsham <robert at octarineparrot.com> 2010-06-06 17:59:33 BST ---
I don't think this bug is valid, something does need to be done about it
though. The following works:
----
alias extern(C) void delegate() cdg;
extern (C)
void c_func(void delegate() dg);
void d_func(cdg dg) { c_func(dg); }
----
So the problem is the linkage of the delegates doesn't match, there's no way to
get around it without an alias though, you can't have extern(C) in the function
parameters. Either the error needs improving, or there needs to be a way to
specify the linkage in the function args.

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