]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] The Unix Epochalyse of 2038 - OS_Time comparison
authorDoug Rupp <rupp@adacore.com>
Wed, 28 Apr 2021 15:48:52 +0000 (08:48 -0700)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 5 Jul 2021 13:09:14 +0000 (13:09 +0000)
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.

gcc/ada/libgnat/s-os_lib.adb
gcc/ada/libgnat/s-os_lib.ads

index d338450dce632964aff80c8278167c313cae2945..19f4cf7cdcf6535921fc0f14dac0ce416c7fc5b9 100644 (file)
@@ -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 --
    -----------------
index 8770d94e4da34f422ed4e0f29635b54dde39748b..d4911d9efc8dfd0bfbff8bc2a0d5631b5e12b56a 100644 (file)
@@ -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);