Subject: | MS VC++ doesn't support long-long-suffix. |
Dear Michael,
As you know, unfortunately MS VC++ doesn't support long-long-suffix.
Strictly speaking, VC++ doesn't support C99.
As such, I had no choice but to do as follows:
--- time64.c.org Mon Oct 20 20:23:14 2008
+++ time64.c Sun Nov 2 20:43:57 2008
@@ -68,7 +68,9 @@
/* Some numbers relating to the gregorian cycle */
static const Year years_in_gregorian_cycle = 400;
#define days_in_gregorian_cycle ((365 * 400) + 100 - 4 + 1)
-static const Time64_T seconds_in_gregorian_cycle = days_in_gregorian_cycle * 60LL * 60LL
* 24LL;
+#ifndef WIN32
+ static const Time64_T seconds_in_gregorian_cycle = days_in_gregorian_cycle * 60LL *
60LL * 24LL;
+#endif
/* Year range we can trust the time funcitons with */
#define MAX_SAFE_YEAR 2037
@@ -431,6 +433,11 @@
int increment = (left_year > right_year) ? 1 : -1;
Time64_T seconds = 0;
int cycles;
+#ifdef WIN32
+ Time64_T LL60 = 60;
+ Time64_T LL24 = 24;
+ Time64_T seconds_in_gregorian_cycle = days_in_gregorian_cycle * LL60 * LL60 * LL24;
+#endif
if( left_year > 2400 ) {
cycles = (left_year - 2400) / 400;
So, the test is as follows:
C:\temp\Time-y2038-20081020>perl Build test
t\everywhere....ok
t\time..........ok
t\timegm........ok
All tests successful.
Files=3, Tests=48, 44 wallclock secs ( 0.06 usr + 0.08 sys = 0.14 CPU)
Result: PASS
Best regards,
Taro Nishino