Am Sun, 16 Mar 2014 12:28:24 +0100
schrieb Rainer Schuetze <r.sagita...@gmx.de>:

Are we still in the same discussion?
The only thing I miss is that among the several ways to
express function signatures in D, some don't allow you to
specify all attributes. My memory is blurry, but I think it
was function literals that I used to write stubs for runtime
loaded library functionality.

> […] though I would prefer avoiding string mixins, maybe by providing a 
> function type as prototype:
> 
> alias export extern(Windows) void function() fnWINAPI;
> 
> @functionAttributesOf!fnWINAPI HANDLE GetCurrentProcess();

That is too pragmatic for my taste. Something that you define
in code should be usable as is. It is like taking the picture
of a red corner sofa just to describe the color to someone.

In that specific case, why does this not work for you?:

nothrow extern(Windows) {
  HANDLE GetCurrentProcess();
}

-- 
Marco

Reply via email to