# include <config.h>
#endif
+/* Some hosts need this in order to declare localtime_r properly. */
+#ifndef _REENTRANT
+# define _REENTRANT 1
+#endif
+
#ifdef _LIBC
# define HAVE_LIMITS_H 1
# define HAVE_MBLEN 1
return tp;
}
# endif /* ! HAVE_LOCALTIME_R */
-#endif /* ! defined (_LIBC) */
+#endif /* ! defined _LIBC */
#if !defined memset && !defined HAVE_MEMSET && !defined _LIBC
do \
{ \
int _this = _len > 16 ? 16 : _len; \
- (P) = mempcpy ((P), spaces, _this); \
+ (P) = MEMPCPY ((P), spaces, _this); \
_len -= _this; \
} \
while (_len > 0); \
do \
{ \
int _this = _len > 16 ? 16 : _len; \
- (P) = mempcpy ((P), zeroes, _this); \
+ (P) = MEMPCPY ((P), zeroes, _this); \
_len -= _this; \
} \
while (_len > 0); \
#ifdef emacs
# define my_strftime emacs_strftime
- /* Emacs 20.2 uses `-Dstrftime=emacs_strftime' when compiling,
- because that's how strftime used to be configured.
- Undo this, since it gets in the way of accessing the underlying strftime,
- which is needed for things like %Ec in Solaris.
- The following two lines can be removed once Emacs stops compiling with
- `-Dstrftime=emacs_strftime'. */
-# undef strftime
-size_t strftime __P ((char *, size_t, const char *, const struct tm *));
#else
# define my_strftime strftime
#endif
valid time_t value. Check whether an error really
occurred. */
struct tm tm;
- localtime_r (<, &tm);
-
- if ((ltm.tm_sec ^ tm.tm_sec)
- | (ltm.tm_min ^ tm.tm_min)
- | (ltm.tm_hour ^ tm.tm_hour)
- | (ltm.tm_mday ^ tm.tm_mday)
- | (ltm.tm_mon ^ tm.tm_mon)
- | (ltm.tm_year ^ tm.tm_year))
+
+ if (! localtime_r (<, &tm)
+ || ((ltm.tm_sec ^ tm.tm_sec)
+ | (ltm.tm_min ^ tm.tm_min)
+ | (ltm.tm_hour ^ tm.tm_hour)
+ | (ltm.tm_mday ^ tm.tm_mday)
+ | (ltm.tm_mon ^ tm.tm_mon)
+ | (ltm.tm_year ^ tm.tm_year)))
break;
}