[dmd-beta] D2 beta 2.057

Richard Webb webby at beardmouse.org.uk
Mon Dec 12 02:16:07 PST 2011


On 12/12/2011 02:59, Walter Bright wrote:
> More of Kenji's fixes.
>
> http://ftp.digitalmars.com/dmd2beta.zip


I tried building Juno with the latest beta, and got a build failure 
related to ParameterTypeTuple and function type parameters.

Seems to be related to this: In 2.056, the code

//////////////////////////////////////////
import std.traits;

extern(Windows)
alias void function(void* hInternet, uint dwContext, uint 
dwInternetStatus, void* lpvStatusInformation, uint 
dwStatusInformationLength) INTERNET_STATUS_CALLBACK;

extern(Windows)
alias void function(void* hInternet, INTERNET_STATUS_CALLBACK 
lpfnStatusCallback) InternetSetStatusCallbackType;

struct DllImport(TFunction) {

   static ReturnType!(TFunction) opCall(ParameterTypeTuple!(TFunction) 
args) {
       pragma (msg, "TFunction1: " ~ typeof(args[1]).stringof);
   }
}

extern(Windows)
alias DllImport!(InternetSetStatusCallbackType) InternetSetStatusCallback;


void test()
{
     extern(Windows)
     static void foo(void* hInternet, uint dwContext, uint 
dwInternetStatus, void* lpvStatusInformation, uint 
dwStatusInformationLength)
     {

     }

     InternetSetStatusCallback(null, &foo);
}
//////////////////////////////////////////

compiles ok and prints

TFunction1: extern (Windows) void function(void* hInternet, uint 
dwContext, uint dwInternetStatus, void* lpvStatusInformation, uint 
dwStatusInformationLength)

whereas with the latest beta, it fails to build with a parameter 
mismatch to opCall error and prints

TFunction1: void function(void* hInternet, uint dwContext, uint 
dwInternetStatus, void* lpvStatusInformation, uint 
dwStatusInformationLength)


so it seems like the 'extern (Windows)' has been lost.

Is this intentional?


More information about the dmd-beta mailing list