aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sysdep.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-08-17 11:35:50 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2009-08-17 11:35:50 +0200
commit88eb6e62fcba2cb0c92194b4a3dbb29c4385ae75 (patch)
treef6706d5d774f7bc84126c8a56a3a088725140fd7 /gcc/ada/sysdep.c
parent23532a924886d063e5e06479eb6bce63c2c8127b (diff)
downloadgcc-88eb6e62fcba2cb0c92194b4a3dbb29c4385ae75.zip
gcc-88eb6e62fcba2cb0c92194b4a3dbb29c4385ae75.tar.gz
gcc-88eb6e62fcba2cb0c92194b4a3dbb29c4385ae75.tar.bz2
[multiple changes]
2009-08-17 Robert Dewar <dewar@adacore.com> * prj-env.adb: Minor reformatting * sem_ch3.adb: Minor reformatting 2009-08-17 Hristian Kirtchev <kirtchev@adacore.com> * sysdep.c (__gnat_localtime_tzoff): VxWorks case - Flip the sign of the time zone since VxWorks chose positive values to represent west time zones and negative for east zones. From-SVN: r150826
Diffstat (limited to 'gcc/ada/sysdep.c')
-rw-r--r--gcc/ada/sysdep.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c
index ffda3ab..6019fd9 100644
--- a/gcc/ada/sysdep.c
+++ b/gcc/ada/sysdep.c
@@ -868,6 +868,8 @@ __gnat_localtime_tzoff (const time_t *timer, long *off)
(*Unlock_Task) ();
+ /* Correct the offset if Daylight Saving Time is in effect */
+
if (tp.tm_isdst > 0)
*off = *off + 3600;
}
@@ -902,9 +904,16 @@ __gnat_localtime_tzoff (const time_t *timer, long *off)
tz_end = index (tz_start, ':');
tz_end = '\0';
- /* The Ada layer expects an offset in seconds */
+ /* The Ada layer expects an offset in seconds. Note that we must reverse
+ the sign of the result since west is positive and east is negative on
+ VxWorks targets. */
+
+ *off = -atol (tz_start) * 60;
+
+ /* Correct the offset if Daylight Saving Time is in effect */
- *off = atol (tz_start) * 60;
+ if (tp.tm_isdst > 0)
+ *off = *off - 3600;
}
(*Unlock_Task) ();