From: Jim Meyering Date: Sun, 18 Oct 1998 01:10:21 +0000 (+0000) Subject: Declare localtime_r if necessary. X-Git-Tag: cvs-readonly~7640 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=6579bcf6f4a8e45dc5c54d90c0fb76216de4cd69;p=gnulib.git Declare localtime_r if necessary. --- diff --git a/lib/mktime.c b/lib/mktime.c index a1b71e573..587aaf12c 100644 --- a/lib/mktime.c +++ b/lib/mktime.c @@ -46,15 +46,14 @@ # define LEAP_SECONDS_POSSIBLE 1 #endif -/* Some systems require to be included before - for localtime_r to be declared properly. */ -#if HAVE_UNISTD_H -# include -#endif - #include /* Some systems define `time_t' here. */ #include +/* 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 #endif diff --git a/lib/strftime.c b/lib/strftime.c index 33dec1328..7a41a4fd5 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -48,10 +48,9 @@ #include #include /* Some systems define `time_t' here. */ -/* Some systems require to be included before - for localtime_r to be declared properly. */ -#if HAVE_UNISTD_H -# include +/* 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