From: Tonu Naks <n...@adacore.com> gcc/ada/ChangeLog:
* libgnat/s-crtl.ads: define unsigned * libgnat/s-crtl__mingw.adb (read, write): change arg type Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/s-crtl.ads | 3 +++ gcc/ada/libgnat/s-crtl__mingw.adb | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gcc/ada/libgnat/s-crtl.ads b/gcc/ada/libgnat/s-crtl.ads index 196b0109ab55..5ca7fc468495 100644 --- a/gcc/ada/libgnat/s-crtl.ads +++ b/gcc/ada/libgnat/s-crtl.ads @@ -50,6 +50,9 @@ package System.CRTL is subtype int is Integer; + type unsigned is mod 2 ** 32; + for unsigned'Size use 32; + type long is range -(2 ** (System.Parameters.long_bits - 1)) .. +(2 ** (System.Parameters.long_bits - 1)) - 1; diff --git a/gcc/ada/libgnat/s-crtl__mingw.adb b/gcc/ada/libgnat/s-crtl__mingw.adb index 6b1035974519..8f10cb8c13f4 100644 --- a/gcc/ada/libgnat/s-crtl__mingw.adb +++ b/gcc/ada/libgnat/s-crtl__mingw.adb @@ -40,10 +40,10 @@ package body System.CRTL is function read (fd : int; buffer : chars; count : size_t) return ssize_t is function read_raw - (fd : int; buffer : chars; count : size_t) return int; + (fd : int; buffer : chars; count : unsigned) return int; pragma Import (C, read_raw, "read"); begin - return ssize_t (read_raw (fd, buffer, count)); + return ssize_t (read_raw (fd, buffer, unsigned (count))); end read; ----------- @@ -53,10 +53,10 @@ package body System.CRTL is function write (fd : int; buffer : chars; count : size_t) return ssize_t is function write_raw - (fd : int; buffer : chars; count : size_t) return int; + (fd : int; buffer : chars; count : unsigned) return int; pragma Import (C, write_raw, "write"); begin - return ssize_t (write_raw (fd, buffer, count)); + return ssize_t (write_raw (fd, buffer, unsigned (count))); end write; end System.CRTL; -- 2.43.0