Sorry if I bother you again with this probably silly problem. Here is
the point. I want to call the D function "fun" from a .c file:
\\file libforc.d
extern (C) int fun(int x,int y){
return x;
}
\\EOF
\\file ctest.c
#include
int fun(int,int);
int main(int argc, char* argv[])
{
p
V Fri, 12 Nov 2010 16:14:30 +0100, Carlo wrote:
> Sorry if I bother you again with this probably silly problem. Here is
> the point. I want to call the D function "fun" from a .c file:
>
> \\file libforc.d
> extern (C) int fun(int x,int y){
> return x;
> }
> \\EOF
>
> \\file ctest.c
> #
On 12/11/2010 16:19, Michal Minich wrote:
V Fri, 12 Nov 2010 16:14:30 +0100, Carlo wrote:
Sorry if I bother you again with this probably silly problem. Here is
the point. I want to call the D function "fun" from a .c file:
\\file libforc.d
extern (C) int fun(int x,int y){
return x;
}
On Sat, 13 Nov 2010 00:00:00 +0100, Carlo wrote:
> On 12/11/2010 16:19, Michal Minich wrote:
>> V Fri, 12 Nov 2010 16:14:30 +0100, Carlo wrote:
>>
>>> Sorry if I bother you again with this probably silly problem. Here is
>>> the point. I want to call the D function "fun" from a .c file:
>>>
>>> \\
On Sat, 13 Nov 2010 00:00:00 +0100, Carlo wrote:
> On 12/11/2010 16:19, Michal Minich wrote:
>> V Fri, 12 Nov 2010 16:14:30 +0100, Carlo wrote:
>>
>>> Sorry if I bother you again with this probably silly problem. Here is
>>> the point. I want to call the D function "fun" from a .c file:
>>>
>>> \\
Michal Minich wrote:
first: extern (C) means that the function 'fun' is not defined in D, but
in C.
Wrong. It means the function has C calling convention. If it has a body,
it is defined in D, and can be called from C (and D). If not, it is defined
elsewhere, and can be called from D.
--
Sim
On Sat, 13 Nov 2010 14:20:05 +0100, Simen kjaeraas wrote:
> Michal Minich wrote:
>
>> first: extern (C) means that the function 'fun' is not defined in D,
>> but in C.
>
> Wrong. It means the function has C calling convention. If it has a body,
> it is defined in D, and can be called from C (an
On 12/11/2010 16:19, Michal Minich wrote:
V Fri, 12 Nov 2010 16:14:30 +0100, Carlo wrote:
Sorry if I bother you again with this probably silly problem. Here is
the point. I want to call the D function "fun" from a .c file:
\\file libforc.d
extern (C) int fun(int x,int y){
return x;
}
On 13/11/2010 14:20, Simen kjaeraas wrote:
Michal Minich wrote:
first: extern (C) means that the function 'fun' is not defined in D, but
in C.
Wrong. It means the function has C calling convention. If it has a body,
it is defined in D, and can be called from C (and D). If not, it is defined