]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Correct compile failures in REL6_4 datetime code.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 6 Mar 1999 22:49:03 +0000 (22:49 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 6 Mar 1999 22:49:03 +0000 (22:49 +0000)
src/backend/utils/adt/datetime.c
src/backend/utils/adt/dt.c
src/include/utils/dt.h

index a8cbdadf539e1d035972189057cc786de7fbf42f..b47488310fee0dc38e74dcaf5a26ae8c3236b845 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.25.2.2 1999/02/13 05:59:34 thomas Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/adt/datetime.c,v 1.25.2.3 1999/03/06 22:49:03 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
 
 static int     date2tm(DateADT dateVal, int *tzp, struct tm * tm, double *fsec, char **tzn);
 
-#if 0
-static int     day_tab[2][12] = {
-       {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
-{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};
-
-#define isleap(y) (((y % 4) == 0 && (y % 100) != 0) || (y % 400) == 0)
-#endif
-
 #define UTIME_MINYEAR (1901)
 #define UTIME_MINMONTH (12)
 #define UTIME_MINDAY (14)
index 3eb3463089d153444797367083061bdaa7fe7e9d..588e8ebf200d6df92ffc3ad4dd1b2428c89d83da 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.59.2.2 1999/02/13 05:59:34 thomas Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.59.2.3 1999/03/06 22:49:01 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -56,8 +56,6 @@ static int    tm2timespan(struct tm * tm, double fsec, TimeSpan *span);
 #define ROUND_ALL 0
 
 #if 0
-#define isleap(y) (((y % 4) == 0) && (((y % 100) != 0) || ((y % 400) == 0)))
-
 int                    mdays[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 0};
 #endif
 
@@ -2302,8 +2300,7 @@ datetkn    *deltacache[MAXDATEFIELDS] = {NULL};
  * These routines will be used by other date/time packages - tgl 97/02/25
  */
 
-#if 0
-XXX moved to dt.h - thomas 1999-01-15
+#if 1
 /* Set the minimum year to one greater than the year of the first valid day
  *     to avoid having to check year and day both. - tgl 97/05/08
  */
index 5ef4f32206dbb862ccc967e0534165ce9b34bedd..93d66e254e46de843c3f571ffc41d1ba8a339175 100644 (file)
@@ -8,7 +8,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: dt.h,v 1.33.2.1 1999/03/03 05:11:39 thomas Exp $
+ * $Id: dt.h,v 1.33.2.2 1999/03/06 22:49:01 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -269,7 +269,7 @@ extern int  datetime_is_epoch(double j);
 
 extern int day_tab[2][13];
 
-#define isleap(y) (((y % 4) == 0 && (y % 100) != 0) || (y % 400) == 0)
+#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
 
 /* Julian date support for date2j() and j2date()
  * Set the minimum year to one greater than the year of the first valid day