Paul Eggert [Thu, 11 Nov 2004 20:24:58 +0000 (20:24 +0000)]
[defined __GETOPT_PREFIX && !defined __need_getopt]:
Include <unistd.h> if available.
Then rename getopt to __GETOPT_PREFIX##getopt, and so forth for
the other external symbols.
(getopt) [!defined __GNU_LIBRARY]: Use prototype, not old-style
declaration, since the above renaming now works around collisions.
Paul Eggert [Thu, 11 Nov 2004 04:37:32 +0000 (04:37 +0000)]
(SHR): New macro, which is a portable
substitute for >> that should work even on Crays.
(TIME_T_MIDPOINT, ydhms_diff, __mktime_internal): Use it.
Problem reported by Mark D. Baushke in
<http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00071.html>.
Paul Eggert [Tue, 9 Nov 2004 20:53:49 +0000 (20:53 +0000)]
(_gl_STRFTIME_PREREQS): Remove. Move its body to
gl_FUNC_STRFTIME.
(gl_FUNC_STRFTIME): Use AC_CHECK_FUNCS_ONCE and AC_CHECK_HEADERS_ONCE
and AC_REQUIRE when possible, to avoid duplicate checks.
Check for <wchar.h>.
Paul Eggert [Wed, 3 Nov 2004 17:20:32 +0000 (17:20 +0000)]
(gl_AC_TYPE_UINT32_T): When determining uint32_t
equivalent, substitute $ac_type for equivalent type rather than
blindly using uint32_t *always* which won't work if uint32_t is not
available. Define _UINT32_T to work around typedef of uint32_t if
<sys/sched.h>, <pthread.h>, or <semaphore.h> used on Solaris
2.5.1.
Paul Eggert [Tue, 2 Nov 2004 20:17:37 +0000 (20:17 +0000)]
(MAXSIZE): New macro.
(xreadlink): Use it instead of SSIZE_MAX. Ensure initial buffer
size does not exceed MAXSIZE. Avoid cast.
As suggested by Mark D. Baushke in
<http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00009.html>,
if readlink fails with buffer size just under MAXSIZE, try again
with MAXSIZE.
Paul Eggert [Fri, 29 Oct 2004 20:59:53 +0000 (20:59 +0000)]
Add support for TZ="foo" within a date string.
Fix some bugs near time_t boundaries. Reject dates with
out-of-range components, e.g., "Sept 31".
Include <stdlib.h>, "setenv.h", "xalloc.h".
(ISDIGIT_LOCALE): Remove; unused.
Note that the TZ and time functions used here are not reentrant.
(mktime_ok, get_tz): New functions.
(TZBUFSIZE): New constant.
(get_date): Parse leading TZ="foo". Reject out-of-range components;.
This requires that we sometimes generate our own TZ="XXX..." setting.
Paul Eggert [Mon, 25 Oct 2004 05:50:16 +0000 (05:50 +0000)]
Use Bison 1.875 features, and some minor
code cleanups. This change does not affect semantics.
Don't include <stdlib.h>; no longer needed.
Don't include unlocked-io.h; only the "#if TEST" code uses
stdio, and performance isn't crucial there.
(PC, YYLEX_PARAM, YYPARSE_PARAM): Remove; replaced by
Bison 1.875 features as described below.
All uses of "PC." replaced by "pc->".
(YYSTYPE): Add a forward declaration.
(yylex, yyerror): Use full prototypes in forward decls.
Use "%pure-parser" rather than obsolescent "%pure_parser".
Use %parse-param and %lex-param instead of obsolescent
YYPARSE_PARAM and YYLEX_PARAM.
(meridian_table, month_and_day_table, time_units_table,
relative_time_table, time_zone_table, military_table,
lookup_zone, lookup_word, get_date):
Use NULL instead of 0 where appropriate.
(to_hour): Avoid abort (), to avoid a dependency on
stdlib.h.
(yyerror, yylex): Now accepts parser_control * arg.
(main) [TEST]: Use '\0' rather than 0 for char.
Paul Eggert [Wed, 6 Oct 2004 20:01:55 +0000 (20:01 +0000)]
Add GPL notice, to match glibc's added LGPL notice.
(logl): Keep the code as similar to glibc as possible.
This avoids a potential constant-folding bug.