Declare localtime_r if necessary. FILEUTILS-4_0-b4
authorJim Meyering <jim@meyering.net>
Sun, 18 Oct 1998 01:10:21 +0000 (01:10 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 18 Oct 1998 01:10:21 +0000 (01:10 +0000)
lib/mktime.c
lib/strftime.c

index a1b71e5..587aaf1 100644 (file)
 # define LEAP_SECONDS_POSSIBLE 1
 #endif
 
-/* Some systems require <unistd.h> to be included before <time.h>
-   for localtime_r to be declared properly.  */
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
 #include <sys/types.h>         /* Some systems define `time_t' here.  */
 #include <time.h>
 
+/* Provide a declaration of localtime_r on systems that lack it.  */
+#if ! defined HAVE_DECL_LOCALTIME_R
+extern struct tm* localtime_r ();
+#endif
+
 #if HAVE_LIMITS_H
 # include <limits.h>
 #endif
index 33dec13..7a41a4f 100644 (file)
 #include <ctype.h>
 #include <sys/types.h>         /* Some systems define `time_t' here.  */
 
-/* Some systems require <unistd.h> to be included before <time.h>
-   for localtime_r to be declared properly.  */
-#if HAVE_UNISTD_H
-# include <unistd.h>
+/* Provide a declaration of localtime_r on systems that lack it.  */
+#if ! defined HAVE_DECL_LOCALTIME_R
+extern struct tm* localtime_r ();
 #endif
 
 #ifdef TIME_WITH_SYS_TIME