Paul Eggert [Tue, 23 Nov 2004 20:59:33 +0000 (20:59 +0000)]
(__attribute__, ATTRIBUTE_UNUSED): New macros.
(futimens): New function, which uses futimes if available.
(futimens, utimens): Support timespec==NULL, with same semantics
as utime and utimens.
(gl_ARGP): Require gl_GETOPT_SUBSTITUTE unconditionally:
argp-parse.c depends on getopt internals, that means we should
always use our getopt, to be on the safe side.
Re-addition of __getopt_argv_const caused
redefinition warnings. To avoid them, include the defines
in `#if !defined __need_getopt ... #endif'. The only place
where __getopt_argv_const is used is in definitions
of getopt_long and getopt_long_only below, which are as well
protected by `#ifndef __need_getopt'.
[defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
__need_getopt after including <stdio.h> and <unistd.h> These
headers might have defined it.
Paul Eggert [Sun, 21 Nov 2004 05:10:10 +0000 (05:10 +0000)]
(__CONCAT): New macro.
(getopt, getopt_long, getopt_long_only, optarg, opterr, optind,
optopt): Use it instead of invoking ## directly; otherwise, the
symbols will be __GETOPT_PREFIXgetopt rather than rpl_getopt.
Jim Meyering [Mon, 15 Nov 2004 17:45:32 +0000 (17:45 +0000)]
Include "__fpending.h" once again.
Include <stdbool.h>.
(close_stdout): Don't fail just because stdout was closed initially,
since some programs don't write to stdout in the normal course of
operation (other than --version and --help), and we don't want this
function to make e.g. `touch file >&-' fail.
But do fail if it was closed and someone has tried to write to it.
E.g., `printf foo >&-' must fail.
Paul Eggert [Thu, 11 Nov 2004 21:14:57 +0000 (21:14 +0000)]
(__getopt_argv_const): New macro, to be used so that
we can stop lying to compilers about the constness of argv when we
are compiled outside glibc.
(getopt, getopt_long, getopt_long_only): Use it.
[defined __GETOPT_PREFIX && !defined __need_getopt]:
Include <stdlib.h> and <stdio.h>, too.
Paul Eggert [Thu, 11 Nov 2004 21:00:47 +0000 (21:00 +0000)]
(gl_GETOPT_SUBSTITUTE): Define __GETOPT_PREFIX instead
of replacing opterr, getopt, etc. This should handle the
powerpc-apple-darwin5.5 problem recently noted by Simon Josefsson.
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.