Bug 6909 – incorrect definition of the OVERLAPPED struct in core.sys.windows.windows ?
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
druntime
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-11-08T13:42:00Z
Last change time
2012-10-09T17:48:14Z
Assigned to
nobody
Creator
webby
Comments
Comment #0 by webby — 2011-11-08T13:42:10Z
While trying to get the Juno library building with the latest DMD2, i found that core.sys.windows.windows defines OVERLAPPED as:
struct OVERLAPPED
{
DWORD Internal;
DWORD InternalHigh;
DWORD Offset;
DWORD OffsetHigh;
HANDLE hEvent;
}
whereas Juno defines it as:
struct OVERLAPPED {
uint Internal;
uint InternalHigh;
union {
struct {
uint Offset;
uint OffsetHigh;
}
void* Pointer;
}
Handle hEvent;
}
And as Juno makes use of the Pointer member, the druntime version fails to compile.
The MinGW Windows headers define it as:
typedef struct _OVERLAPPED {
ULONG_PTR Internal;
ULONG_PTR InternalHigh;
__GNUC_EXTENSION union {
__GNUC_EXTENSION struct {
DWORD Offset;
DWORD OffsetHigh;
};
PVOID Pointer;
};
HANDLE hEvent;
} OVERLAPPED,*POVERLAPPED,*LPOVERLAPPED;
and the MSDN is similar, so the Juno version looks correct.
Didn't think of looking at that version!
I was just starting by removing the duplicate declarations that Juno itself contains though, and depending on another external lib is a bit much for a few trivial things.