summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-06-29 21:45:51 +0000
committerJim Meyering <jim@meyering.net>2006-06-29 21:45:51 +0000
commit2e63aaa8a953eb13808635fb8d3daaf276303fdb (patch)
tree75da6d02c02df44fda0067a00ed30e32b6431b8e
parent4a8016db69e2df36a55c971977102a65ebf2f41e (diff)
downloadcoreutils-2e63aaa8a953eb13808635fb8d3daaf276303fdb.tar.xz
From Derek R. Price:
* lib/strftime.c: Assume strftime exists. * m4/strftime.m4: Don't call AC_FUNC_STRFTIME.
-rw-r--r--lib/ChangeLog4
-rw-r--r--lib/strftime.c69
-rw-r--r--m4/ChangeLog4
-rw-r--r--m4/strftime.m45
4 files changed, 19 insertions, 63 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 6b50d62f3..63bb492fd 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,7 @@
+2006-06-29 Derek R. Price <derek@ximbiot.com>
+
+ * strftime.c: Assume strftime exists.
+
2006-06-28 Derek R. Price <derek@ximbiot.com>
* savedir.c (CLOSEDIR): Remove. All uses changed to closedir.
diff --git a/lib/strftime.c b/lib/strftime.c
index 13c8acc85..cfeac4e56 100644
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -387,21 +387,6 @@ iso_week_days (int yday, int wday)
}
-#if !(defined _NL_CURRENT || HAVE_STRFTIME)
-static CHAR_T const weekday_name[][10] =
- {
- L_("Sunday"), L_("Monday"), L_("Tuesday"), L_("Wednesday"),
- L_("Thursday"), L_("Friday"), L_("Saturday")
- };
-static CHAR_T const month_name[][10] =
- {
- L_("January"), L_("February"), L_("March"), L_("April"), L_("May"),
- L_("June"), L_("July"), L_("August"), L_("September"), L_("October"),
- L_("November"), L_("December")
- };
-#endif
-
-
/* When compiling this file, GNU applications can #define my_strftime
to a symbol (typically nstrftime) to get an extended strftime with
extra arguments UT and NS. Emacs is a special case for now, but
@@ -473,18 +458,6 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
# define aw_len STRLEN (a_wkday)
# define am_len STRLEN (a_month)
# define ap_len STRLEN (ampm)
-#else
-# if !HAVE_STRFTIME
-# define f_wkday (weekday_name[tp->tm_wday])
-# define f_month (month_name[tp->tm_mon])
-# define a_wkday f_wkday
-# define a_month f_month
-# define ampm (L_("AMPM") + 2 * (tp->tm_hour > 11))
-
- size_t aw_len = 3;
- size_t am_len = 3;
- size_t ap_len = 2;
-# endif
#endif
const char *zone;
size_t i = 0;
@@ -745,7 +718,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
to_uppcase = true;
to_lowcase = false;
}
-#if defined _NL_CURRENT || !HAVE_STRFTIME
+#ifdef _NL_CURRENT
cpy (aw_len, a_wkday);
break;
#else
@@ -760,7 +733,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
to_uppcase = true;
to_lowcase = false;
}
-#if defined _NL_CURRENT || !HAVE_STRFTIME
+#ifdef _NL_CURRENT
cpy (STRLEN (f_wkday), f_wkday);
break;
#else
@@ -776,7 +749,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
}
if (modifier != 0)
goto bad_format;
-#if defined _NL_CURRENT || !HAVE_STRFTIME
+#ifdef _NL_CURRENT
cpy (am_len, a_month);
break;
#else
@@ -791,7 +764,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
to_uppcase = true;
to_lowcase = false;
}
-#if defined _NL_CURRENT || !HAVE_STRFTIME
+#ifdef _NL_CURRENT
cpy (STRLEN (f_month), f_month);
break;
#else
@@ -809,11 +782,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
!= '\0')))
subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_T_FMT));
#else
-# if HAVE_STRFTIME
goto underlying_strftime;
-# else
- subfmt = L_("%a %b %e %H:%M:%S %Y");
-# endif
#endif
subformat:
@@ -829,7 +798,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
}
break;
-#if HAVE_STRFTIME && ! (defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY)
+#if !(defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY)
underlying_strftime:
{
/* The relevant information is available only via the
@@ -880,9 +849,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
break;
}
#else
-# if HAVE_STRFTIME
goto underlying_strftime;
-# endif
#endif
}
@@ -903,11 +870,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_FMT));
goto subformat;
#else
-# if HAVE_STRFTIME
goto underlying_strftime;
-# else
- /* Fall through. */
-# endif
#endif
case L_('D'):
if (modifier != 0)
@@ -972,9 +935,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
}
}
#else
-# if HAVE_STRFTIME
goto underlying_strftime;
-# endif
#endif
}
@@ -1122,7 +1083,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
case L_('P'):
to_lowcase = true;
-#if !defined _NL_CURRENT && HAVE_STRFTIME
+#ifndef _NL_CURRENT
format_char = L_('p');
#endif
/* FALLTHROUGH */
@@ -1133,7 +1094,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
to_uppcase = false;
to_lowcase = true;
}
-#if defined _NL_CURRENT || !HAVE_STRFTIME
+#ifdef _NL_CURRENT
cpy (ap_len, ampm);
break;
#else
@@ -1145,16 +1106,14 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
goto subformat;
case L_('r'):
-#if !defined _NL_CURRENT && HAVE_STRFTIME
- goto underlying_strftime;
-#else
-# ifdef _NL_CURRENT
+#ifdef _NL_CURRENT
if (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME,
NLW(T_FMT_AMPM)))
== L_('\0'))
-# endif
subfmt = L_("%I:%M:%S %p");
goto subformat;
+#else
+ goto underlying_strftime;
#endif
case L_('S'):
@@ -1201,11 +1160,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT));
goto subformat;
#else
-# if HAVE_STRFTIME
goto underlying_strftime;
-# else
- /* Fall through. */
-# endif
#endif
case L_('T'):
subfmt = L_("%H:%M:%S");
@@ -1309,9 +1264,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
goto subformat;
}
#else
-# if HAVE_STRFTIME
goto underlying_strftime;
-# endif
#endif
}
if (modifier == L_('O'))
@@ -1332,9 +1285,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s,
+ delta * era->absolute_direction));
}
#else
-# if HAVE_STRFTIME
goto underlying_strftime;
-# endif
#endif
}
diff --git a/m4/ChangeLog b/m4/ChangeLog
index fd82c6318..fc4f88c22 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,7 @@
+2006-06-29 Derek R. Price <derek@ximbiot.com>
+
+ * strftime.m4: Don't call AC_FUNC_STRFTIME.
+
2006-06-28 Paul Eggert <eggert@cs.ucla.edu>
* jm-macros.m4 (jl_MACROS): Require 2.60, not 2.59d.
diff --git a/m4/strftime.m4 b/m4/strftime.m4
index bc73791a9..ea93042db 100644
--- a/m4/strftime.m4
+++ b/m4/strftime.m4
@@ -1,4 +1,4 @@
-#serial 26
+#serial 27
# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
@@ -19,9 +19,6 @@ AC_DEFUN([gl_FUNC_STRFTIME],
AC_LIBSOURCES([strftime.c, strftime.h])
AC_LIBOBJ([strftime])
- # strftime.c uses the underyling system strftime if it exists.
- AC_REQUIRE([AC_FUNC_STRFTIME])
-
# This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
AC_REQUIRE([AC_STRUCT_TIMEZONE])