+2019-09-18 Olivier Hainque <hainque@adacore.com>
+
+ * libgnat/s-win32.ads (DWORD_PTR): New type, pointer size
+ unsigned int.
+ (SYSTEM_INFO): Use it for dwActiveProcessorMask.
+
2019-09-18 Arnaud Charlet <charlet@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst: Improve doc on
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;
- type LONG is new Interfaces.C.long;
- type CHAR is new Interfaces.C.char;
- type SIZE_T is new Interfaces.C.size_t;
-
- type BOOL is new Interfaces.C.int;
+ 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;
+ type LONG is new Interfaces.C.long;
+ type CHAR is new Interfaces.C.char;
+ type SIZE_T is new Interfaces.C.size_t;
+ type DWORD_PTR is mod 2 ** Standard'Address_Size;
+
+ type BOOL is new Interfaces.C.int;
for BOOL'Size use Interfaces.C.int'Size;
type Bits1 is range 0 .. 2 ** 1 - 1;
dwPageSize : DWORD;
lpMinimumApplicationAddress : PVOID;
lpMaximumApplicationAddress : PVOID;
- dwActiveProcessorMask : DWORD;
+ dwActiveProcessorMask : DWORD_PTR;
dwNumberOfProcessors : DWORD;
dwProcessorType : DWORD;
dwAllocationGranularity : DWORD;
--- /dev/null
+-- { dg-do run }
+
+with System.Multiprocessors;
+with System.Task_Info;
+
+procedure System_Info1 is
+ Ncpus : constant System.Multiprocessors.CPU :=
+ System.Multiprocessors.Number_Of_CPUS;
+ Nprocs : constant Integer :=
+ System.Task_Info.Number_Of_Processors;
+
+ use type System.Multiprocessors.CPU;
+begin
+ if Nprocs <= 0 or else Nprocs > 1024 then
+ raise Program_Error;
+ end if;
+ if Ncpus <= 0 or else Ncpus > 1024 then
+ raise Program_Error;
+ end if;
+ if Nprocs /= Integer (Ncpus) then
+ raise Program_Error;
+ end if;
+end;
\ No newline at end of file