+#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
+ this Emacs-specific code can be removed once Emacs's config.h
+ defines my_strftime. */
+#if defined emacs && !defined my_strftime
+# define my_strftime nstrftime
+#endif
+
+#ifdef my_strftime
+# define extra_args , ut, ns
+# define extra_args_spec int ut; int ns;
+# define extra_args_spec_iso , int ut, int ns
+#else
+# ifdef COMPILE_WIDE
+# define my_strftime wcsftime
+# define nl_get_alt_digit _nl_get_walt_digit
+# else
+# define my_strftime strftime
+# define nl_get_alt_digit _nl_get_alt_digit
+# endif
+# define extra_args
+# define extra_args_spec
+# define extra_args_spec_iso
+/* We don't have this information in general. */
+# define ut 0
+# define ns 0
+#endif
+
+#if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET
+ /* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
+ Work around this bug by copying *tp before it might be munged. */
+ size_t _strftime_copytm __P ((char *, size_t, const char *,
+ const struct tm * extra_args_spec_iso));
+ size_t
+ my_strftime (s, maxsize, format, tp extra_args)
+ CHAR_T *s;
+ size_t maxsize;
+ const CHAR_T *format;
+ const struct tm *tp;
+ extra_args_spec
+ {
+ struct tm tmcopy;
+ tmcopy = *tp;
+ return _strftime_copytm (s, maxsize, format, &tmcopy extra_args);
+ }
+# undef my_strftime
+# define my_strftime _strftime_copytm
+#endif
+
+
+/* Write information from TP into S according to the format
+ string FORMAT, writing no more that MAXSIZE characters
+ (including the terminating '\0') and returning number of
+ characters written. If S is NULL, nothing will be written
+ anywhere, so to determine how many characters would be
+ written, use NULL for S and (size_t) UINT_MAX for MAXSIZE. */
+size_t
+my_strftime (s, maxsize, format, tp extra_args LOCALE_PARAM)
+ CHAR_T *s;
+ size_t maxsize;
+ const CHAR_T *format;
+ const struct tm *tp;
+ extra_args_spec
+ LOCALE_PARAM_DECL