Re: Global extern(C) in druntime header files?

2013-06-06 Thread Gary Willoughby
You are passing a function pointer to a C library, where it will be expected that the function uses the C calling convention. So you have to declare the function as extern(C), otherwise DMD will not compile it as such. That can cause segfaults. Right ok thanks.

Global extern(C) in druntime header files?

2013-06-05 Thread Gary Willoughby
I've been doing some coding and noticed something strange with core.sys.posix.signal. In the following snippet you will see that i have to decorate the handleTermination function with extern(C) to satisfy the type requirements of the bsd_signal function. import core.sys.posix.signal; import

Re: Global extern(C) in druntime header files?

2013-06-05 Thread Jesse Phillips
Not going to look into the file, but I'm pretty sure bsd_signal is function for an external C library right? If that is the case, it must use C calling convention, so yes this is correct.

Re: Global extern(C) in druntime header files?

2013-06-05 Thread Gary Willoughby
On Wednesday, 5 June 2013 at 18:54:45 UTC, Jesse Phillips wrote: Not going to look into the file, but I'm pretty sure bsd_signal is function for an external C library right? If that is the case, it must use C calling convention, so yes this is correct. Ah sorry i wasn't clear. The question

Re: Global extern(C) in druntime header files?

2013-06-05 Thread Mike Parker
On Wednesday, 5 June 2013 at 20:40:59 UTC, Gary Willoughby wrote: On Wednesday, 5 June 2013 at 18:54:45 UTC, Jesse Phillips wrote: Not going to look into the file, but I'm pretty sure bsd_signal is function for an external C library right? If that is the case, it must use C calling