diff options
author | Doug Rupp <rupp@adacore.com> | 2015-10-16 13:28:39 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-10-16 15:28:39 +0200 |
commit | 2346b8064304115b851646532e1738d4afdc89b8 (patch) | |
tree | bc189abbb70e8d29051f535c1457d8438dc5df15 /gcc/ada/s-osinte-android.adb | |
parent | 51cf5b3e0a163af22fc48c441ee03dc097650778 (diff) | |
download | gcc-2346b8064304115b851646532e1738d4afdc89b8.zip gcc-2346b8064304115b851646532e1738d4afdc89b8.tar.gz gcc-2346b8064304115b851646532e1738d4afdc89b8.tar.bz2 |
Code clean up.
From-SVN: r228903
Diffstat (limited to 'gcc/ada/s-osinte-android.adb')
-rw-r--r-- | gcc/ada/s-osinte-android.adb | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/gcc/ada/s-osinte-android.adb b/gcc/ada/s-osinte-android.adb index 3b89e77..81103ee 100644 --- a/gcc/ada/s-osinte-android.adb +++ b/gcc/ada/s-osinte-android.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1995-2014, AdaCore -- +-- Copyright (C) 1995-2015, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -39,7 +39,6 @@ pragma Polling (Off); -- that are needed by children of System. with Interfaces.C; use Interfaces.C; -with Interfaces.C.Extensions; use Interfaces.C.Extensions; package body System.OS_Interface is @@ -76,48 +75,4 @@ package body System.OS_Interface is tv_nsec => long (Long_Long_Integer (F * 10#1#E9))); end To_Timespec; - ------------------- - -- clock_gettime -- - ------------------- - - function clock_gettime - (clock_id : clockid_t; - tp : access timespec) return int - is - pragma Unreferenced (clock_id); - - -- Android/Linux don't have clock_gettime, so use gettimeofday - - use Interfaces; - - type timeval is array (1 .. 3) of C.long; - -- The timeval array is sized to contain long_long sec and long usec. - -- If long_long'Size = long'Size then it will be overly large but that - -- won't effect the implementation since it's not accessed directly. - - procedure timeval_to_duration - (T : not null access timeval; - sec : not null access C.Extensions.long_long; - usec : not null access C.long); - pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration"); - - Micro : constant := 10**6; - sec : aliased C.Extensions.long_long; - usec : aliased C.long; - TV : aliased timeval; - Result : int; - - function gettimeofday - (Tv : access timeval; - Tz : System.Address := System.Null_Address) return int; - pragma Import (C, gettimeofday, "gettimeofday"); - - begin - Result := gettimeofday (TV'Access, System.Null_Address); - pragma Assert (Result = 0); - timeval_to_duration (TV'Access, sec'Access, usec'Access); - tp.all := To_Timespec (Duration (sec) + Duration (usec) / Micro); - return Result; - end clock_gettime; - end System.OS_Interface; |