aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJustin Squirek <squirek@adacore.com>2019-07-01 13:35:48 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-07-01 13:35:48 +0000
commit339ff2f61d916b1d2d449ed0f3d477c1a0510bf6 (patch)
tree11bdc7b0997b562acc19a85748b43938aa34a420 /gcc
parent647abeaf0e8951e2bfa195723b1d8c160ccb22bf (diff)
downloadgcc-339ff2f61d916b1d2d449ed0f3d477c1a0510bf6.zip
gcc-339ff2f61d916b1d2d449ed0f3d477c1a0510bf6.tar.gz
gcc-339ff2f61d916b1d2d449ed0f3d477c1a0510bf6.tar.bz2
[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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/libgnat/s-win32.ads9
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 95c2cad..5cd8d90 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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
diff --git a/gcc/ada/libgnat/s-win32.ads b/gcc/ada/libgnat/s-win32.ads
index e69c01e..d09c4b3 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");