summaryrefslogtreecommitdiff
path: root/lib/strftime.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-10-18 01:11:35 +0000
committerJim Meyering <jim@meyering.net>1998-10-18 01:11:35 +0000
commita71cb7cad1283a4bfc51d5a8e76e6f9358064858 (patch)
tree15e930134e9e64933a7870965fd58b54f481b0df /lib/strftime.c
parente2d1b297e7670d1e62ad5d1f8352b4c58f341417 (diff)
downloadcoreutils-a71cb7cad1283a4bfc51d5a8e76e6f9358064858.tar.xz
Declare localtime_r if necessary.
Diffstat (limited to 'lib/strftime.c')
-rw-r--r--lib/strftime.c7
1 files changed, 3 insertions, 4 deletions
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 <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