From 339ff2f61d916b1d2d449ed0f3d477c1a0510bf6 Mon Sep 17 00:00:00 2001 From: Justin Squirek Date: Mon, 1 Jul 2019 13:35:48 +0000 Subject: [PATCH] [Ada] Incorrect definition of Win32 compatible types This patch corrects the definition of certain Win32 types. 2019-07-01 Justin Squirek gcc/ada/ * libgnat/s-win32.ads: Add definition for ULONG, modify OVERLAPPED type, and add appropriate pragmas. From-SVN: r272868 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/libgnat/s-win32.ads | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 95c2caddd1f..5cd8d905ecd 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-07-01 Justin Squirek + + * libgnat/s-win32.ads: Add definition for ULONG, modify + OVERLAPPED type, and add appropriate pragmas. + 2019-07-01 Bob Duff * gnat1drv.adb (gnat1drv): Call Write_ALI if the main unit is diff --git a/gcc/ada/libgnat/s-win32.ads b/gcc/ada/libgnat/s-win32.ads index e69c01ee13d..d09c4b32cb6 100644 --- a/gcc/ada/libgnat/s-win32.ads +++ b/gcc/ada/libgnat/s-win32.ads @@ -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"); -- 2.30.2