summaryrefslogtreecommitdiff
path: root/lib/mktime.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-11-19 08:05:29 +0000
committerJim Meyering <jim@meyering.net>2002-11-19 08:05:29 +0000
commit66943316b4d761ab1f74b4a8e1368edd67ee8acf (patch)
treea9018ec3f539b37311031b597af99f606ea331f7 /lib/mktime.c
parent7808c81c068497025d2e9643497ee3f083772560 (diff)
downloadcoreutils-66943316b4d761ab1f74b4a8e1368edd67ee8acf.tar.xz
Avoid a link-time failure on some Linux systems.
(STATIC): Define to be empty (_LIBC) or `static' (otherwise). (__mon_yday): Declare with the STATIC attribute. (__mktime_internal): Likewise. Based on a report from Greg Schafer.
Diffstat (limited to 'lib/mktime.c')
-rw-r--r--lib/mktime.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/mktime.c b/lib/mktime.c
index 00354703a..21926fc78 100644
--- a/lib/mktime.c
+++ b/lib/mktime.c
@@ -29,6 +29,9 @@
#ifdef _LIBC
# define HAVE_LIMITS_H 1
# define STDC_HEADERS 1
+# define STATIC /* empty */
+#else
+# define STATIC static
#endif
/* Assume that leap seconds are possible, unless told otherwise.
@@ -100,7 +103,7 @@
#endif
/* How many days come before each month (0-12). */
-const unsigned short int __mon_yday[2][13] =
+STATIC const unsigned short int __mon_yday[2][13] =
{
/* Normal years. */
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
@@ -213,7 +216,7 @@ ranged_convert (struct tm *(*convert) (const time_t *, struct tm *),
Use *OFFSET to keep track of a guess at the offset of the result,
compared to what the result would be for UTC without leap seconds.
If *OFFSET's guess is correct, only one CONVERT call is needed. */
-time_t
+STATIC time_t
__mktime_internal (struct tm *tp,
struct tm *(*convert) (const time_t *, struct tm *),
time_t *offset)