FIO.Append_Set (AP (File));
if File.Mode = FCB.Append_File then
- if Standard'Address_Size = 64 then
+ pragma Warnings (Off, "condition is always *");
+ if Memory_Size = 2**64 then
File.Index := Count (ftell64 (File.Stream)) + 1;
else
File.Index := Count (ftell (File.Stream)) + 1;
end if;
+ pragma Warnings (On);
end if;
File.Last_Op := Op_Other;
package GNAT.Debug_Utilities is
pragma Pure;
- Address_64 : constant Boolean := Standard'Address_Size = 64;
- -- Set true if 64 bit addresses (assumes only 32 and 64 are possible)
+ Address_64 : constant Boolean := System.Memory_Size = 2**64;
+ -- Set true if 64-bit addresses (assumes only 32 and 64 are possible)
Address_Image_Length : constant := 13 + 10 * Boolean'Pos (Address_64);
-- Length of string returned by Image function for an address
Contract_Cases => Ignore,
Ghost => Ignore);
+with System;
with System.Parameters;
package Interfaces.C
-- a non-private system.address type.
type ptrdiff_t is
- range -(2 ** (System.Parameters.ptr_bits - Integer'(1))) ..
- +(2 ** (System.Parameters.ptr_bits - Integer'(1)) - 1);
+ range -System.Memory_Size / 2 .. System.Memory_Size / 2 - 1;
- type size_t is mod 2 ** System.Parameters.ptr_bits;
+ type size_t is mod System.Memory_Size;
-- Boolean type
subtype off_t is Long_Integer;
- type size_t is mod 2 ** Standard'Address_Size;
+ type size_t is mod System.Memory_Size;
- type ssize_t is range -(2 ** (Standard'Address_Size - 1))
- .. +(2 ** (Standard'Address_Size - 1)) - 1;
+ type ssize_t is range -Memory_Size / 2 .. Memory_Size / 2 - 1;
type int64 is new Long_Long_Integer;
-- Note: we use Long_Long_Integer'First instead of -2 ** 63 to allow this
package System.Memory is
pragma Elaborate_Body;
- type size_t is mod 2 ** Standard'Address_Size;
+ type size_t is mod Memory_Size;
-- Note: the reason we redefine this here instead of using the
-- definition in Interfaces.C is that we do not want to drag in
-- all of Interfaces.C just because System.Memory is used.
-- Task And Stack Allocation Control --
---------------------------------------
- type Size_Type is range
- -(2 ** (Integer'(Standard'Address_Size) - 1)) ..
- +(2 ** (Integer'(Standard'Address_Size) - 1)) - 1;
+ type Size_Type is range -Memory_Size / 2 .. Memory_Size / 2 - 1;
-- Type used to provide task stack sizes to the runtime. Sized to permit
-- stack sizes of up to half the total addressable memory space. This may
-- seem excessively large (even for 32-bit systems), however there are many
-- Task And Stack Allocation Control --
---------------------------------------
- type Size_Type is range
- -(2 ** (Integer'(Standard'Address_Size) - 1)) ..
- +(2 ** (Integer'(Standard'Address_Size) - 1)) - 1;
+ type Size_Type is range -Memory_Size / 2 .. Memory_Size / 2 - 1;
-- Type used to provide task stack sizes to the runtime. Sized to permit
-- stack sizes of up to half the total addressable memory space. This may
-- seem excessively large (even for 32-bit systems), however there are many
-- Task And Stack Allocation Control --
---------------------------------------
- type Size_Type is range
- -(2 ** (Integer'(Standard'Address_Size) - 1)) ..
- +(2 ** (Integer'(Standard'Address_Size) - 1)) - 1;
+ type Size_Type is range -Memory_Size / 2 .. Memory_Size / 2 - 1;
-- Type used to provide task stack sizes to the runtime. Sized to permit
-- stack sizes of up to half the total addressable memory space. This may
-- seem excessively large (even for 32-bit systems), however there are many
-- Task And Stack Allocation Control --
---------------------------------------
- type Size_Type is range
- -(2 ** (Integer'(Standard'Address_Size) - 1)) ..
- +(2 ** (Integer'(Standard'Address_Size) - 1)) - 1;
+ type Size_Type is range -Memory_Size / 2 .. Memory_Size / 2 - 1;
-- Type used to provide task stack sizes to the runtime. Sized to permit
-- stack sizes of up to half the total addressable memory space. This may
-- seem excessively large (even for 32-bit systems), however there are many
(S : in out Sink'Class; X : Long_Long_Long_Unsigned)
renames LLL_Integer_Images.Put_Image;
- type Signed_Address is range
- -2**(Standard'Address_Size - 1) .. 2**(Standard'Address_Size - 1) - 1;
- type Unsigned_Address is mod 2**Standard'Address_Size;
+ type Signed_Address is range -Memory_Size / 2 .. Memory_Size / 2 - 1;
+ type Unsigned_Address is mod Memory_Size;
package Hex is new Generic_Integer_Images
(Signed_Address, Unsigned_Address, Base => 16);
pragma Annotate (GNATprove, Always_Return, Storage_Elements);
- type Storage_Offset is range
- -(2 ** (Integer'(Standard'Address_Size) - 1)) ..
- +(2 ** (Integer'(Standard'Address_Size) - 1)) - Long_Long_Integer'(1);
- -- Note: the reason for the Long_Long_Integer qualification here is to
- -- avoid a bogus ambiguity when this unit is analyzed in an rtsfind
- -- context.
+ type Storage_Offset is range -Memory_Size / 2 .. Memory_Size / 2 - 1;
subtype Storage_Count is Storage_Offset range 0 .. Storage_Offset'Last;