aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2014-04-09 23:18:28 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2014-04-09 23:18:28 +0000
commit7056f58f69ce0bf81d4350d0fb7aff995bf83fca (patch)
tree0de2bc8f0a3af7e345f4001d721f20ff6b8c549a /gcc
parent8267f6bb0819e2ac831b3d3a9207d7f6710f6bfc (diff)
downloadgcc-7056f58f69ce0bf81d4350d0fb7aff995bf83fca.zip
gcc-7056f58f69ce0bf81d4350d0fb7aff995bf83fca.tar.gz
gcc-7056f58f69ce0bf81d4350d0fb7aff995bf83fca.tar.bz2
re PR ada/54040 ([x32] Incorrect timeval and timespec)
PR ada/54040 PR ada/59346 * s-osinte-x32.adb (To_Timespec): Add use directive. * s-osprim-x32.ads (Clock): Adjust. (To_Timespec): Likewise. Co-Authored-By: Svante Signell <svante.signell@gmail.com> From-SVN: r209257
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog2
-rw-r--r--gcc/ada/s-osinte-x32.adb1
-rw-r--r--gcc/ada/s-osprim-x32.adb4
3 files changed, 5 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index c977770..b89bfec 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -12,6 +12,8 @@
* s-linux-sparc.ads (Time): Likewise.
* s-linux-x32.ads (Time): Likewise.
* s-osprim-x32.ads (timespec): Adjust.
+ (Clock): Likewise.
+ (To_Timespec): Likewise.
* s-osinte-linux.ads (Time): Define local subtypes for those defined
in System.Linux.
* s-taprop-linux.adb (Monotonic_Clock): Do not define timeval.
diff --git a/gcc/ada/s-osinte-x32.adb b/gcc/ada/s-osinte-x32.adb
index 17989cd..467970b 100644
--- a/gcc/ada/s-osinte-x32.adb
+++ b/gcc/ada/s-osinte-x32.adb
@@ -90,6 +90,7 @@ package body System.OS_Interface is
S : time_t;
F : Duration;
+ use type System.Linux.time_t;
begin
S := time_t (Long_Long_Integer (D));
F := D - Duration (S);
diff --git a/gcc/ada/s-osprim-x32.adb b/gcc/ada/s-osprim-x32.adb
index fb00e78..e0c020c 100644
--- a/gcc/ada/s-osprim-x32.adb
+++ b/gcc/ada/s-osprim-x32.adb
@@ -54,7 +54,7 @@ package body System.OS_Primitives is
-----------
function Clock return Duration is
- type timeval is array (1 .. 2) of time_t;
+ type timeval is array (1 .. 2) of Long_Long_Integer;
procedure timeval_to_duration
(T : not null access timeval;
@@ -118,7 +118,7 @@ package body System.OS_Primitives is
return
timespec'(tv_sec => S,
- tv_nsec => time_t (Long_Long_Integer (F * 10#1#E9)));
+ tv_nsec => Long_Long_Integer (F * 10#1#E9));
end To_Timespec;
-----------------