-# if ! HAVE_LOCALTIME_R
-# if ! HAVE_TM_GMTOFF
-/* Approximate gmtime_r as best we can in its absence. */
-# undef gmtime_r
-# define gmtime_r my_gmtime_r
-static struct tm *gmtime_r __P ((const time_t *, struct tm *));
-static struct tm *
-gmtime_r (t, tp)
- const time_t *t;
- struct tm *tp;
-{
- struct tm *l = gmtime (t);
- if (! l)
- return 0;
- *tp = *l;
- return tp;
-}
-# endif /* ! HAVE_TM_GMTOFF */
-
-/* Approximate localtime_r as best we can in its absence. */
-# undef localtime_r
-# define localtime_r my_ftime_localtime_r
-static struct tm *localtime_r __P ((const time_t *, struct tm *));
-static struct tm *
-localtime_r (t, tp)
- const time_t *t;
- struct tm *tp;
-{
- struct tm *l = localtime (t);
- if (! l)
- return 0;
- *tp = *l;
- return tp;
-}
-# endif /* ! HAVE_LOCALTIME_R */
-#endif /* ! defined _LIBC */
-
-
-#if !defined memset && !defined HAVE_MEMSET && !defined _LIBC
-/* Some systems lack the `memset' function and we don't want to
- introduce additional dependencies. */
-/* The SGI compiler reportedly barfs on the trailing null
- if we use a string constant as the initializer. 28 June 1997, rms. */
-static const char spaces[16] = /* " " */
- { ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ' };
-static const char zeroes[16] = /* "0000000000000000" */
- { '0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0' };
-
-# define memset_space(P, Len) \
- do { \
- int _len = (Len); \
- \
- do \
- { \
- int _this = _len > 16 ? 16 : _len; \
- (P) = MEMPCPY ((P), spaces, _this); \
- _len -= _this; \
- } \
- while (_len > 0); \
- } while (0)
-
-# define memset_zero(P, Len) \
- do { \
- int _len = (Len); \
- \
- do \
- { \
- int _this = _len > 16 ? 16 : _len; \
- (P) = MEMPCPY ((P), zeroes, _this); \
- _len -= _this; \
- } \
- while (_len > 0); \
- } while (0)
+# define STREAM_OR_CHAR_T CHAR_T
+# define STRFTIME_ARG(x) x,
+#endif
+
+#if FPRINTFTIME
+# define memset_byte(P, Len, Byte) \
+ do { size_t _i; for (_i = 0; _i < Len; _i++) fputc (Byte, P); } while (0)
+# define memset_space(P, Len) memset_byte (P, Len, ' ')
+# define memset_zero(P, Len) memset_byte (P, Len, '0')
+#elif defined COMPILE_WIDE
+# define memset_space(P, Len) (wmemset (P, L' ', Len), (P) += (Len))
+# define memset_zero(P, Len) (wmemset (P, L'0', Len), (P) += (Len))