diff options
author | Dmitriy Anisimkov <anisimko@adacore.com> | 2019-08-19 08:37:13 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-08-19 08:37:13 +0000 |
commit | c70220382300ae326ad63fe54c5a32da202d1f13 (patch) | |
tree | 8fc7c89a82bfa995c8a6b135fc195d07d427af54 /gcc/ada/libgnat/s-os_lib.ads | |
parent | 382b0e9771d77d482f6765454ec884936b62b15b (diff) | |
download | gcc-c70220382300ae326ad63fe54c5a32da202d1f13.zip gcc-c70220382300ae326ad63fe54c5a32da202d1f13.tar.gz gcc-c70220382300ae326ad63fe54c5a32da202d1f13.tar.bz2 |
[Ada] Conversion routines between GNAT.OS_Lib.OS_Time and long integer
The new routines convert back and forth between private type OS_Time and
a long integer which can be used in package Ada.Calendar.Conversions
routines to convert to Ada.Calendar.Time.
2019-08-19 Dmitriy Anisimkov <anisimko@adacore.com>
gcc/ada/
* libgnat/s-os_lib.ads, libgnat/s-os_lib.adb (To_Ada, To_C): New
routines.
From-SVN: r274661
Diffstat (limited to 'gcc/ada/libgnat/s-os_lib.ads')
-rw-r--r-- | gcc/ada/libgnat/s-os_lib.ads | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/ada/libgnat/s-os_lib.ads b/gcc/ada/libgnat/s-os_lib.ads index 3e8c21d..99406e9 100644 --- a/gcc/ada/libgnat/s-os_lib.ads +++ b/gcc/ada/libgnat/s-os_lib.ads @@ -164,6 +164,15 @@ package System.OS_Lib is -- component parts to be interpreted in the local time zone, and returns -- an OS_Time. Returns Invalid_Time if the creation fails. + subtype time_t is Long_Integer; + -- C time_t type of the time representation + + function To_C (Time : OS_Time) return time_t; + -- Convert OS_Time to C time_t type + + function To_Ada (Time : time_t) return OS_Time; + -- Convert C time_t type to OS_Time + ---------------- -- File Stuff -- ---------------- @@ -1107,6 +1116,8 @@ private pragma Inline (">"); pragma Inline ("<="); pragma Inline (">="); + pragma Inline (To_C); + pragma Inline (To_Ada); type Process_Id is new Integer; Invalid_Pid : constant Process_Id := -1; |