aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/g-calend.ads
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2009-04-16 12:44:27 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2009-04-16 12:44:27 +0200
commit540b5d9ce19915edcf491f6cebeec0a5c5571ac7 (patch)
tree19234e62b03b6b4b5729aab19428cda3fb16a6b3 /gcc/ada/g-calend.ads
parentdae4faf2e17c5c51954dd6f7e29229780371750c (diff)
downloadgcc-540b5d9ce19915edcf491f6cebeec0a5c5571ac7.zip
gcc-540b5d9ce19915edcf491f6cebeec0a5c5571ac7.tar.gz
gcc-540b5d9ce19915edcf491f6cebeec0a5c5571ac7.tar.bz2
[multiple changes]
2009-04-16 Jerome Lambourg <lambourg@adacore.com> * sem_prag.adb (Analyze_Pragma): Make sure that pragma pack is not taken into account for VM targets. 2009-04-16 Hristian Kirtchev <kirtchev@adacore.com> * g-calend.ads, g-calend.adb (Week_In_Year): Now calls Year_Week_In_Year. (Year_Week_In_Year): New routine which contains the original code from Week_In_Year. Add the missing special case for January 1st falling on a Monday. From-SVN: r146167
Diffstat (limited to 'gcc/ada/g-calend.ads')
-rw-r--r--gcc/ada/g-calend.ads29
1 files changed, 18 insertions, 11 deletions
diff --git a/gcc/ada/g-calend.ads b/gcc/ada/g-calend.ads
index 8bb2e6e..39ca203 100644
--- a/gcc/ada/g-calend.ads
+++ b/gcc/ada/g-calend.ads
@@ -70,18 +70,9 @@ package GNAT.Calendar is
-- Return the day name
function Day_In_Year (Date : Ada.Calendar.Time) return Day_In_Year_Number;
- -- Returns the day number in the year. (1st January is day 1 and 31st
+ -- Return the day number in the year. (1st January is day 1 and 31st
-- December is day 365 or 366 for leap year).
- function Week_In_Year (Date : Ada.Calendar.Time) return Week_In_Year_Number;
- -- Returns the week number as defined in ISO 8601. A week always starts on
- -- a Monday and the first week of a particular year is the one containing
- -- the first Thursday. A year may have 53 weeks when January 1st is a
- -- Wednesday and the year is leap or January 1st is a Thursday. Note that
- -- the last days of December may belong to the first week on the next year
- -- and conversely, the first days of January may belong to the last week
- -- of the last year.
-
procedure Split
(Date : Ada.Calendar.Time;
Year : out Ada.Calendar.Year_Number;
@@ -102,7 +93,23 @@ package GNAT.Calendar is
Minute : Minute_Number;
Second : Second_Number;
Sub_Second : Second_Duration := 0.0) return Ada.Calendar.Time;
- -- Returns an Ada.Calendar.Time data built from the date and time values
+ -- Return an Ada.Calendar.Time data built from the date and time values
+
+ function Week_In_Year (Date : Ada.Calendar.Time) return Week_In_Year_Number;
+ -- Return the week number as defined in ISO 8601. A week always starts on
+ -- a Monday and the first week of a particular year is the one containing
+ -- the first Thursday. A year may have 53 weeks when January 1st is a
+ -- Wednesday and the year is leap or January 1st is a Thursday. Note that
+ -- the last days of December may belong to the first week on the next year
+ -- and conversely, the first days of January may belong to the last week
+ -- of the last year.
+
+ procedure Year_Week_In_Year
+ (Date : Ada.Calendar.Time;
+ Year : out Ada.Calendar.Year_Number;
+ Week : out Week_In_Year_Number);
+ -- Return the week number as defined in ISO 8601 along with the year in
+ -- which the week occurs.
-- C timeval conversion