aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sysdep.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-04-20 14:54:27 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2009-04-20 14:54:27 +0200
commitbddd6058a2b9c29980962301b65a911985a3e00d (patch)
treeecad736fcc71b3ccb622d267bcd774d938e18c8f /gcc/ada/sysdep.c
parenta3c39f83ee9d05fa4ee14288ce1758eb4bb7f912 (diff)
downloadgcc-bddd6058a2b9c29980962301b65a911985a3e00d.zip
gcc-bddd6058a2b9c29980962301b65a911985a3e00d.tar.gz
gcc-bddd6058a2b9c29980962301b65a911985a3e00d.tar.bz2
[multiple changes]
2009-04-20 Nicolas Roche <roche@adacore.com> * 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 <ebotcazou@adacore.com> * 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
Diffstat (limited to 'gcc/ada/sysdep.c')
-rw-r--r--gcc/ada/sysdep.c5
1 files changed, 4 insertions, 1 deletions
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) ();
}