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

2012-05-13 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4288


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


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


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

2012-05-12 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4288


klickverbot c...@klickverbot.at changed:

   What|Removed |Added

 CC||c...@klickverbot.at


--- Comment #3 from klickverbot c...@klickverbot.at 2012-05-12 07:40:25 PDT 
---
Error message fix:

https://github.com/D-Programming-Language/dmd/pull/943

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


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

2010-06-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4288



--- Comment #2 from Adam Chrapkowski adam.chrapkow...@gmail.com 2010-06-06 
11:11:41 PDT ---
So two questions:

1. Why the following is allowed:
extern (C) void c_func(void delegate());
?

2. What does mean extern (C) void delegate() ?

Delegate is just a 'data structure which consists of two pointers' and anything
more. Something like C delegate does not exists. Linkage is related to
functions not data structures delegate is a data structure.

So if D data structures are disallowed in C functions why the following is
allowed?
extern (C) void c_func(string, Foo);
class Foo{...}
void d_func() {
  scope  foo = new Foo();
  string str = Hello World!;
  c_func(str, foo);
}

string is a data structure as delegate, foo is a pointer to a data structure.

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