www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6909] New: incorrect definition of the OVERLAPPED struct in core.sys.windows.windows ?

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6909

           Summary: incorrect definition of the OVERLAPPED struct in
                    core.sys.windows.windows ?
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P3
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: webby beardmouse.org.uk



PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 08 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6909




PST ---
https://github.com/D-Programming-Language/druntime/pull/84

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 08 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6909


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



14:12:08 PST ---
You're right. But you might want to try using this instead of core.sys.windows*
(it's much more updated): http://dsource.org/projects/bindings/wiki/WindowsApi/

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 08 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6909




PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 08 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6909


Alex Rønne Petersen <alex lycus.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |alex lycus.org
         Resolution|                            |FIXED



CEST ---
The definition is correct in druntime now.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 09 2012