changeset 1532:efffa4fa07de

Declare localtime_r if necessary.
author Jim Meyering <jim@meyering.net>
date Sun, 18 Oct 1998 01:10:21 +0000
parents 302216c67941
children 06956e9f17a1
files lib/mktime.c lib/strftime.c
diffstat 2 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lib/mktime.c
+++ b/lib/mktime.c
@@ -46,15 +46,14 @@
 # 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
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -48,10 +48,9 @@
 #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