summaryrefslogtreecommitdiff
path: root/gcc/ada/a-caldel.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-06 09:15:21 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-06 09:15:21 +0000
commiteaa006632546b894576a92e971294c7e9ac5231b (patch)
tree7a061f08c1577dcad5f77bb59e183a711e8af6e1 /gcc/ada/a-caldel.adb
parent232e4d04f0263022b1379a7886e28e7f082f7eb8 (diff)
downloadgcc-eaa006632546b894576a92e971294c7e9ac5231b.tar.gz
2007-04-06 Hristian Kirtchev <kirtchev@adacore.com>
Vincent Celier <celier@adacore.com> * a-calend-vms.ads, a-calend.ads, a-calend.adb, a-calend-vms.adb: New version of Ada.Calendar which supports the new upper bound of Ada time (2399-12-31 86_399.999999999). The following modifications have been made to the package: - New representation of time as count of nanoseconds since the start of Ada time (1901-1-1 0.0). - Target independent Split and Time_Of routines which service both Ada 95 and Ada 2005 code. - Target independent interface to the Ada 2005 children of Calendar. - Integrated leap seconds into Ada 95 and Ada 2005 mode. - Handling of non-leap centenial years. - Updated clock function. - Updated arithmetic and comparison operators. * a-caldel.adb (To_Duration): Add call to target independent routine in Ada.Calendar to handle the conversion of time to duration. * sysdep.c (__gnat_localtime_tzoff): Test timezone before setting off (UTC Offset). If timezone is obviously incorrect (outside of -14 hours .. 14 hours), set off to 0. (__gnat_localtime_tzoff for Lynx and VxWorks): Even though these targets do not have a natural time zone, GMT is used as a default. (__gnat_get_task_options): New. * a-direct.adb (Modification_Time): Add with and use clauses for Ada.Calendar and Ada. Calendar.Formatting. Remove with clause for Ada.Unchecked_Conversion since it is no longer needed. (Duration_To_Time): Removed. (OS_Time_To_Long_Integer): Removed. (Modification_Time): Rewritten to use Ada.Calendar and Ada.Calendar. Formatting Time_Of routines which automatically handle time zones, buffer periods and leap seconds. * a-calari.ads, a-calari.adb ("+", "-", Difference): Add calls to target independent routines in Ada.Calendar. * a-calfor.ads, a-calfor.adb: Code cleanup and addition of validity checks in various routines. (Day_Of_Week, Split, Time_Of): Add call to target independent routine in Ada.Calendar. * a-catizo.ads, a-catizo.adb (UTC_Time_Offset): Add call to target independent routine in Ada.Calendar. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123543 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-caldel.adb')
-rw-r--r--gcc/ada/a-caldel.adb29
1 files changed, 17 insertions, 12 deletions
diff --git a/gcc/ada/a-caldel.adb b/gcc/ada/a-caldel.adb
index 84586b82b03..8c42afb6d13 100644
--- a/gcc/ada/a-caldel.adb
+++ b/gcc/ada/a-caldel.adb
@@ -7,7 +7,7 @@
-- B o d y --
-- --
-- Copyright (C) 1991-1994, Florida State University --
--- Copyright (C) 1995-2005, AdaCore --
+-- Copyright (C) 1995-2006, AdaCore --
-- --
-- GNARL 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- --
@@ -54,12 +54,12 @@ package body Ada.Calendar.Delays is
use System.Traces;
- -- Earlier, the following operations were implemented using
- -- System.Time_Operations. The idea was to avoid sucking in the tasking
- -- packages. This did not work. Logically, we can't have it both ways.
- -- There is no way to implement time delays that will have correct task
- -- semantics without reference to the tasking run-time system.
- -- To achieve this goal, we now use soft links.
+ -- Earlier, System.Time_Opeations was used to implement the following
+ -- operations. The idea was to avoid sucking in the tasking packages. This
+ -- did not work. Logically, we can't have it both ways. There is no way to
+ -- implement time delays that will have correct task semantics without
+ -- reference to the tasking run-time system. To achieve this goal, we now
+ -- use soft links.
-----------------------
-- Local Subprograms --
@@ -120,18 +120,23 @@ package body Ada.Calendar.Delays is
function To_Duration (T : Time) return Duration is
begin
- return Duration (T);
+ -- Since time has multiple representations on different platforms, a
+ -- target independent operation in Ada.Calendar is used to perform
+ -- this conversion.
+
+ return Delays_Operations.To_Duration (T);
end To_Duration;
begin
- -- Set up the Timed_Delay soft link to the non tasking version
- -- if it has not been already set.
+ -- Set up the Timed_Delay soft link to the non tasking version if it has
+ -- not been already set.
- -- If tasking is present, Timed_Delay has already set this soft
- -- link, or this will be overriden during the elaboration of
+ -- If tasking is present, Timed_Delay has already set this soft link, or
+ -- this will be overriden during the elaboration of
-- System.Tasking.Initialization
if SSL.Timed_Delay = null then
SSL.Timed_Delay := Timed_Delay_NT'Access;
end if;
+
end Ada.Calendar.Delays;