[Issue 17868] add pragma(crt_con/destructor[, priority])

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 4 00:08:12 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=17868

--- Comment #3 from Steven Schveighoffer <schveiguy at yahoo.com> ---
Why is it terrible? Because absolute numbers are used for ordering, with no
central determination of who should use what number. D is far more sane on this
subject.

Why is it needed? Can't you just use your local C compiler to add the
functions? If it's so different and possibly not supported, why do we want D to
get involved here?

file.d:
extern(C) void myModulector()
{
   // construct
}

extern(C) void myModuledtor()
{
   // destroy
}

file.c:
constructor (1) // no idea of syntax exactly.
void myModulector();

destructor(1)
void myModuledtor();

--


More information about the Digitalmars-d-bugs mailing list