From fafaa44ef0176da243b19e4d68bf2ffc3bbb4f88 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 13 Sep 1996 03:21:39 +0000 Subject: update from main archive 960912 Fri Sep 13 04:33:08 1996 Ulrich Drepper * sched.h: New file. helper to access posix/sched.h. * posix/sched.h: Change `sched_params' to `sched_param' to follow POSIX.4. Thu Sep 12 20:12:40 1996 Ulrich Drepper * db/makedb.c (usage): Print bug report address separately to ease translators task. * catgets/gencat.c (usage): Likewise. * locale/locale.c (usage): Likewise. * locale/localedef.c (usage): Likewise. 1996-09-12 Paul Eggert * time/strftime.c (my_localtime_r): Define if ! HAVE_LOCALTIME_R, and #define localtime_r to it. If _LIBC, use __localtime_r instead. (my_gmtime_r): Similar, except it's not needed if ! HAVE_TM_GMTOFF. Thu Sep 12 14:03:29 1996 Ulrich Drepper * crypt/Makefile: Include Makeconfig and add crypt object dir to rpath-link so that running the check finds the new library. * crypt/cert.c: provide correct prototypes to prevent warnings. Reported by Andreas Jaeger. * sysdeps/mach/hurd/Makefile (rpath-link): Don't use += because old and new value must be glued using `:'. Reported by Marcus Daniels. --- time/strftime.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'time') diff --git a/time/strftime.c b/time/strftime.c index 26f4b7f..866a280 100644 --- a/time/strftime.c +++ b/time/strftime.c @@ -92,6 +92,46 @@ Cambridge, MA 02139, USA. */ #define TM_YEAR_BASE 1900 +#ifdef _LIBC +# define gmtime_r __gmtime_r +# define localtime_r __localtime_r +#else +# if ! HAVE_LOCALTIME_R +# if ! HAVE_TM_GMTOFF +/* Approximate gmtime_r as best we can in its absence. */ +#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. */ +#define localtime_r my_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) */ + + static unsigned int week __P ((const struct tm *const, int, int)); -- cgit v1.1