OSDN Git Service

Backport from mainline
[pf3gnuchains/gcc-fork.git] / libgfortran / intrinsics / date_and_time.c
index fa51d5f..3c38636 100644 (file)
@@ -31,10 +31,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #include "time_1.h"
 
-#ifndef abs
-#define abs(x) ((x)>=0 ? (x) : -(x))
-#endif
-
 
 /* If the re-entrant version of gmtime is not available, provide a
    fallback implementation.  On some targets where the _r version is
@@ -143,7 +139,6 @@ date_and_time (char *__date, char *__time, char *__zone,
   char zone[ZONE_LEN + 1];
   GFC_INTEGER_4 values[VALUES_SIZE];
 
-#ifndef HAVE_NO_DATE_TIME
   time_t lt;
   struct tm local_time;
   struct tm UTC_time;
@@ -193,21 +188,6 @@ date_and_time (char *__date, char *__time, char *__zone,
       for (i = 0; i < VALUES_SIZE; i++)
        values[i] = - GFC_INTEGER_4_HUGE;
     }   
-#else /* if defined HAVE_NO_DATE_TIME  */
-  /* We really have *nothing* to return, so return blanks and HUGE(0).  */
-      
-  memset (date, ' ', DATE_LEN);
-  date[DATE_LEN] = '\0';
-
-  memset (timec, ' ', TIME_LEN);
-  timec[TIME_LEN] = '\0';
-
-  memset (zone, ' ', ZONE_LEN);
-  zone[ZONE_LEN] = '\0';
-
-  for (i = 0; i < VALUES_SIZE; i++)
-    values[i] = - GFC_INTEGER_4_HUGE;
-#endif  /* HAVE_NO_DATE_TIME  */
 
   /* Copy the values into the arguments.  */
   if (__values)
@@ -321,7 +301,6 @@ secnds (GFC_REAL_4 *x)
 static void
 itime0 (int x[3])
 {
-#ifndef HAVE_NO_DATE_TIME
   time_t lt;
   struct tm local_time;
 
@@ -335,9 +314,6 @@ itime0 (int x[3])
       x[1] = local_time.tm_min;
       x[2] = local_time.tm_sec;
     }
-#else
-  x[0] = x[1] = x[2] = -1;
-#endif
 }
 
 extern void itime_i4 (gfc_array_i4 *);
@@ -403,7 +379,6 @@ itime_i8 (gfc_array_i8 *__values)
 static void
 idate0 (int x[3])
 {
-#ifndef HAVE_NO_DATE_TIME
   time_t lt;
   struct tm local_time;
 
@@ -417,9 +392,6 @@ idate0 (int x[3])
       x[1] = 1 + local_time.tm_mon;
       x[2] = 1900 + local_time.tm_year;
     }
-#else
-  x[0] = x[1] = x[2] = -1;
-#endif
 }
 
 extern void idate_i4 (gfc_array_i4 *);