Commit 339ff2f6 by Justin Squirek Committed by Pierre-Marie de Rodat

[Ada] Incorrect definition of Win32 compatible types

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
parent 647abeaf
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> 2019-07-01 Bob Duff <duff@adacore.com>
* gnat1drv.adb (gnat1drv): Call Write_ALI if the main unit is * gnat1drv.adb (gnat1drv): Call Write_ALI if the main unit is
......
...@@ -57,6 +57,7 @@ package System.Win32 is ...@@ -57,6 +57,7 @@ package System.Win32 is
INVALID_HANDLE_VALUE : constant HANDLE := -1; INVALID_HANDLE_VALUE : constant HANDLE := -1;
INVALID_FILE_SIZE : constant := 16#FFFFFFFF#; INVALID_FILE_SIZE : constant := 16#FFFFFFFF#;
type ULONG is new Interfaces.C.unsigned_long;
type DWORD is new Interfaces.C.unsigned_long; type DWORD is new Interfaces.C.unsigned_long;
type WORD is new Interfaces.C.unsigned_short; type WORD is new Interfaces.C.unsigned_short;
type BYTE is new Interfaces.C.unsigned_char; type BYTE is new Interfaces.C.unsigned_char;
...@@ -157,18 +158,20 @@ package System.Win32 is ...@@ -157,18 +158,20 @@ package System.Win32 is
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS : constant := 16#00000004#; GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS : constant := 16#00000004#;
type OVERLAPPED is record type OVERLAPPED is record
Internal : DWORD; Internal : access ULONG;
InternalHigh : DWORD; InternalHigh : access ULONG;
Offset : DWORD; Offset : DWORD;
OffsetHigh : DWORD; OffsetHigh : DWORD;
hEvent : HANDLE; hEvent : HANDLE;
end record; end record;
pragma Convention (C_Pass_By_Copy, OVERLAPPED);
type SECURITY_ATTRIBUTES is record type SECURITY_ATTRIBUTES is record
nLength : DWORD; nLength : DWORD;
pSecurityDescriptor : PVOID; pSecurityDescriptor : PVOID;
bInheritHandle : BOOL; bInheritHandle : BOOL;
end record; end record;
pragma Convention (C_Pass_By_Copy, SECURITY_ATTRIBUTES);
function CreateFileA function CreateFileA
(lpFileName : Address; (lpFileName : Address;
...@@ -267,6 +270,7 @@ package System.Win32 is ...@@ -267,6 +270,7 @@ package System.Win32 is
dwAllocationGranularity : DWORD; dwAllocationGranularity : DWORD;
dwReserved : DWORD; dwReserved : DWORD;
end record; end record;
pragma Convention (C_Pass_By_Copy, SYSTEM_INFO);
procedure GetSystemInfo (SI : access SYSTEM_INFO); procedure GetSystemInfo (SI : access SYSTEM_INFO);
pragma Import (Stdcall, GetSystemInfo, "GetSystemInfo"); pragma Import (Stdcall, GetSystemInfo, "GetSystemInfo");
...@@ -285,6 +289,7 @@ package System.Win32 is ...@@ -285,6 +289,7 @@ package System.Win32 is
wSecond : WORD; wSecond : WORD;
wMilliseconds : WORD; wMilliseconds : WORD;
end record; end record;
pragma Convention (C_Pass_By_Copy, SYSTEMTIME);
procedure GetSystemTime (pSystemTime : access SYSTEMTIME); procedure GetSystemTime (pSystemTime : access SYSTEMTIME);
pragma Import (Stdcall, GetSystemTime, "GetSystemTime"); pragma Import (Stdcall, GetSystemTime, "GetSystemTime");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment