aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Rupp <rupp@adacore.com>2021-04-28 08:48:52 -0700
committerPierre-Marie de Rodat <derodat@adacore.com>2021-07-05 13:09:14 +0000
commit63b43535dc775883436ac5c8445522e34e373efc (patch)
treeab27f21b89b2f6ff79a725a1067c9b155f59493d
parentcee731748f23f6cbdcd7baf8102ac4dc87ca5c52 (diff)
downloadgcc-63b43535dc775883436ac5c8445522e34e373efc.zip
gcc-63b43535dc775883436ac5c8445522e34e373efc.tar.gz
gcc-63b43535dc775883436ac5c8445522e34e373efc.tar.bz2
[Ada] The Unix Epochalyse of 2038 - OS_Time comparison
gcc/ada/ * libgnat/s-os_lib.ads: Import OS_Time comparison ops as intrinsic. * libgnat/s-os_lib.adb: Remove OS_TIme comparison ops implementation.
-rw-r--r--gcc/ada/libgnat/s-os_lib.adb36
-rw-r--r--gcc/ada/libgnat/s-os_lib.ads13
2 files changed, 4 insertions, 45 deletions
diff --git a/gcc/ada/libgnat/s-os_lib.adb b/gcc/ada/libgnat/s-os_lib.adb
index d338450..19f4cf7 100644
--- a/gcc/ada/libgnat/s-os_lib.adb
+++ b/gcc/ada/libgnat/s-os_lib.adb
@@ -133,42 +133,6 @@ package body System.OS_Lib is
-- Converts a C String to an Ada String. We could do this making use of
-- Interfaces.C.Strings but we prefer not to import that entire package
- ---------
- -- "<" --
- ---------
-
- function "<" (X, Y : OS_Time) return Boolean is
- begin
- return Long_Long_Integer (X) < Long_Long_Integer (Y);
- end "<";
-
- ----------
- -- "<=" --
- ----------
-
- function "<=" (X, Y : OS_Time) return Boolean is
- begin
- return Long_Long_Integer (X) <= Long_Long_Integer (Y);
- end "<=";
-
- ---------
- -- ">" --
- ---------
-
- function ">" (X, Y : OS_Time) return Boolean is
- begin
- return Long_Long_Integer (X) > Long_Long_Integer (Y);
- end ">";
-
- ----------
- -- ">=" --
- ----------
-
- function ">=" (X, Y : OS_Time) return Boolean is
- begin
- return Long_Long_Integer (X) >= Long_Long_Integer (Y);
- end ">=";
-
-----------------
-- Args_Length --
-----------------
diff --git a/gcc/ada/libgnat/s-os_lib.ads b/gcc/ada/libgnat/s-os_lib.ads
index 8770d94..d4911d9 100644
--- a/gcc/ada/libgnat/s-os_lib.ads
+++ b/gcc/ada/libgnat/s-os_lib.ads
@@ -1111,18 +1111,13 @@ private
-- time stamps, but may have a different representation than C's time_t.
-- This type needs to match the declaration of OS_Time in adaint.h.
- -- Add pragma Inline statements for comparison operations on OS_Time. It
- -- would actually be nice to use pragma Import (Intrinsic) here, but this
- -- was not properly supported till GNAT 3.15a, so that would cause
- -- bootstrap path problems. To be changed later ???
-
Invalid_Time : constant OS_Time := -1;
-- This value should match the return value from __gnat_file_time_*
- pragma Inline ("<");
- pragma Inline (">");
- pragma Inline ("<=");
- pragma Inline (">=");
+ pragma Import (Intrinsic, "<");
+ pragma Import (Intrinsic, ">");
+ pragma Import (Intrinsic, "<=");
+ pragma Import (Intrinsic, ">=");
pragma Inline (To_C);
pragma Inline (To_Ada);