From bddd6058a2b9c29980962301b65a911985a3e00d Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Mon, 20 Apr 2009 14:54:27 +0200 Subject: [multiple changes] 2009-04-20 Nicolas Roche * sysdep.c (__gnat_localtime_tzoff): on Windows, manipulated times are unsigned long long. So compare local_time and utc_time before computing the difference. 2009-04-20 Eric Botcazou * sem_ch3.adb (Build_Derived_Private_Type): Insert the declaration of the Underlying_Record_View before that of the derived type. * exp_ch3.adb (Expand_Record_Extension): Do not special-case types with unknown discriminants with regard to the parent subtype. From-SVN: r146410 --- gcc/ada/sysdep.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/ada/sysdep.c') diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c index 8a227b4..fd4dfad 100644 --- a/gcc/ada/sysdep.c +++ b/gcc/ada/sysdep.c @@ -787,7 +787,10 @@ __gnat_localtime_tzoff (const time_t *timer, long *off) /* An error occurs so return invalid_tzoff. */ *off = __gnat_invalid_tzoff; else - *off = (long) ((local_time.ull_time - utc_time.ull_time) / 10000000ULL); + if (local_time.ull_time > utc_time.ull_time) + *off = (long) ((local_time.ull_time - utc_time.ull_time) / 10000000ULL); + else + *off = - (long) ((utc_time.ull_time - local_time.ull_time) / 10000000ULL); (*Unlock_Task) (); } -- cgit v1.1