Yet another effort at translating the Win32 API headers

Chris Miller chris at dprogramming.com
Wed Apr 5 09:09:12 PDT 2006


On Wed, 05 Apr 2006 11:26:20 -0400, Stewart Gordon <smjg_1998 at yahoo.com>  
wrote:

> John C wrote:
>> "Stewart Gordon" <smjg_1998 at yahoo.com> wrote in message  
>> news:e10hmd$265q$1 at digitaldaemon.com...
>>> Stewart Gordon wrote:
>>> <snip>
>>> And I'm not sure if the largeint stuff is necessary at all.  I suppose  
>>> there's no point in translating largeint.h, as it's all stuff that D  
>>> has built in.  But do we need to keep the LARGE_INTEGER and  
>>> ULARGE_INTEGER structures (defined in winnt.h) for compatibility?
>>  Can't these just be changed to long and ulong?
>
> That's what I'd begun to think.  But it depends on:
>
> - whether the Windows calling/name mangling convention relies on the  
> distinction between structs and primitive types that have the same size
>
> - whether there are enough Windows programmers out there who rely on the  
>   quick access to the high and low dwords that the LARGE_INTEGER and  
> ULARGE_INTEGER structures provide (but considering that casts, bitmasks  
> and bitshifts are always available....)
>

They turn into the same mangled name; such functions can be overloaded to  
take either:

extern(Windows)
{
    BOOL QueryPerformanceCounter(LARGE_INTEGER* lpPerformanceCount);
    BOOL QueryPerformanceCounter(long* lpPerformanceCount);
}
int main()
{
    LARGE_INTEGER li;
    long l;
    assert(QueryPerformanceCounter(&li));
    assert(QueryPerformanceCounter(&l));
    return 0;
}



More information about the Digitalmars-d-announce mailing list