public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2025] [Ada] The Unix Epochalyse of 2038 - OS_Time comparison
@ 2021-07-05 13:14 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-07-05 13:14 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:63b43535dc775883436ac5c8445522e34e373efc
commit r12-2025-g63b43535dc775883436ac5c8445522e34e373efc
Author: Doug Rupp <rupp@adacore.com>
Date: Wed Apr 28 08:48:52 2021 -0700
[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.
Diff:
---
gcc/ada/libgnat/s-os_lib.adb | 36 ------------------------------------
gcc/ada/libgnat/s-os_lib.ads | 13 ++++---------
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 d338450dce6..19f4cf7cdcf 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 8770d94e4da..d4911d9efc8 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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-05 13:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-05 13:14 [gcc r12-2025] [Ada] The Unix Epochalyse of 2038 - OS_Time comparison Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).