]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Incorrect definition of Win32 compatible types
authorJustin Squirek <squirek@adacore.com>
Mon, 1 Jul 2019 13:35:48 +0000 (13:35 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 1 Jul 2019 13:35:48 +0000 (13:35 +0000)
This patch corrects the definition of certain Win32 types.

2019-07-01  Justin Squirek  <squirek@adacore.com>

gcc/ada/

* libgnat/s-win32.ads: Add definition for ULONG, modify
OVERLAPPED type, and add appropriate pragmas.

From-SVN: r272868

gcc/ada/ChangeLog
gcc/ada/libgnat/s-win32.ads

index 95c2caddd1f8efb43a707cb0d1de4da1881d7c39..5cd8d905ecd92c5afd9a1db6e5d50538790372a5 100644 (file)
@@ -1,3 +1,8 @@
+2019-07-01  Justin Squirek  <squirek@adacore.com>
+
+       * libgnat/s-win32.ads: Add definition for ULONG, modify
+       OVERLAPPED type, and add appropriate pragmas.
+
 2019-07-01  Bob Duff  <duff@adacore.com>
 
        * gnat1drv.adb (gnat1drv): Call Write_ALI if the main unit is
index e69c01ee13d214f41a03f37091806a309089be7d..d09c4b32cb60f963ca5bd435290efa396e6d2ba2 100644 (file)
@@ -57,6 +57,7 @@ package System.Win32 is
    INVALID_HANDLE_VALUE : constant HANDLE := -1;
    INVALID_FILE_SIZE    : constant := 16#FFFFFFFF#;
 
+   type ULONG  is new Interfaces.C.unsigned_long;
    type DWORD  is new Interfaces.C.unsigned_long;
    type WORD   is new Interfaces.C.unsigned_short;
    type BYTE   is new Interfaces.C.unsigned_char;
@@ -157,18 +158,20 @@ package System.Win32 is
    GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS : constant := 16#00000004#;
 
    type OVERLAPPED is record
-      Internal     : DWORD;
-      InternalHigh : DWORD;
+      Internal     : access ULONG;
+      InternalHigh : access ULONG;
       Offset       : DWORD;
       OffsetHigh   : DWORD;
       hEvent       : HANDLE;
    end record;
+   pragma Convention (C_Pass_By_Copy, OVERLAPPED);
 
    type SECURITY_ATTRIBUTES is record
       nLength             : DWORD;
       pSecurityDescriptor : PVOID;
       bInheritHandle      : BOOL;
    end record;
+   pragma Convention (C_Pass_By_Copy, SECURITY_ATTRIBUTES);
 
    function CreateFileA
      (lpFileName            : Address;
@@ -267,6 +270,7 @@ package System.Win32 is
       dwAllocationGranularity     : DWORD;
       dwReserved                  : DWORD;
    end record;
+   pragma Convention (C_Pass_By_Copy, SYSTEM_INFO);
 
    procedure GetSystemInfo (SI : access SYSTEM_INFO);
    pragma Import (Stdcall, GetSystemInfo, "GetSystemInfo");
@@ -285,6 +289,7 @@ package System.Win32 is
       wSecond       : WORD;
       wMilliseconds : WORD;
    end record;
+   pragma Convention (C_Pass_By_Copy, SYSTEMTIME);
 
    procedure GetSystemTime (pSystemTime : access SYSTEMTIME);
    pragma Import (Stdcall, GetSystemTime, "GetSystemTime");