1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00

Update from Gnulib by running admin/merge-gnulib

This commit is contained in:
Paul Eggert 2024-09-17 00:32:39 -07:00
parent cbe8683410
commit 73427887d6
17 changed files with 141 additions and 112 deletions

View File

@ -104,10 +104,15 @@
# define _GL_EXTERN_C_FUNC # define _GL_EXTERN_C_FUNC
#endif #endif
/* _GL_FUNCDECL_RPL (func, rettype, parameters[, attributes]); /* _GL_FUNCDECL_RPL (func, rettype, parameters, [attributes]);
declares a replacement function, named rpl_func, with the given prototype, declares a replacement function, named rpl_func, with the given prototype,
consisting of return type, parameters, and attributes. consisting of return type, parameters, and attributes.
Example: Although attributes are optional, the comma before them is required
for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW,
if needed, must be placed after the _GL_FUNCDECL_RPL invocation,
at the end of the declaration.
Examples:
_GL_FUNCDECL_RPL (free, void, (void *ptr), ) _GL_ATTRIBUTE_NOTHROW;
_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...), _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...),
_GL_ARG_NONNULL ((1))); _GL_ARG_NONNULL ((1)));
@ -116,24 +121,22 @@
because because
[[...]] extern "C" <declaration>; [[...]] extern "C" <declaration>;
is invalid syntax in C++.) is invalid syntax in C++.)
Note: The attribute _GL_ATTRIBUTE_NOTHROW, if needed, must be placed outside
of the _GL_FUNCDECL_RPL invocation, at the end of the declaration.
*/ */
#define _GL_FUNCDECL_RPL(func,rettype,parameters,...) \ #define _GL_FUNCDECL_RPL(func,rettype,parameters,...) \
_GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters, __VA_ARGS__) _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters, __VA_ARGS__)
#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \ #define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \
_GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters _GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters
/* _GL_FUNCDECL_SYS (func, rettype, parameters[, attributes]); /* _GL_FUNCDECL_SYS (func, rettype, parameters, [attributes]);
declares the system function, named func, with the given prototype, declares the system function, named func, with the given prototype,
consisting of return type, parameters, and attributes. consisting of return type, parameters, and attributes.
Example: Although attributes are optional, the comma before them is required
_GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...), for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW,
_GL_ARG_NONNULL ((1))); if needed, must be placed after the _GL_FUNCDECL_RPL invocation,
at the end of the declaration.
Note: The attribute _GL_ATTRIBUTE_NOTHROW, if needed, must be placed outside Examples:
of the _GL_FUNCDECL_SYS invocation, at the end of the declaration. _GL_FUNCDECL_SYS (getumask, mode_t, (void), ) _GL_ATTRIBUTE_NOTHROW;
_GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
*/ */
#define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \ #define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \
_GL_EXTERN_C_FUNC __VA_ARGS__ rettype func parameters _GL_EXTERN_C_FUNC __VA_ARGS__ rettype func parameters

View File

@ -63,15 +63,17 @@ rpl_faccessat (int fd, char const *file, int mode, int flag)
{ {
int result = orig_faccessat (fd, file, mode, flag); int result = orig_faccessat (fd, file, mode, flag);
if (result == 0 && file[strlen (file) - 1] == '/') if (file[strlen (file) - 1] == '/')
{ {
struct stat st; struct stat st;
result = fstatat (fd, file, &st, 0); int ret = fstatat (fd, file, &st, 0);
if (result == 0 && !S_ISDIR (st.st_mode)) if (ret == 0 && !S_ISDIR (st.st_mode))
{ {
errno = ENOTDIR; errno = ENOTDIR;
return -1; return -1;
} }
if (result == 0)
result = ret;
} }
return result; return result;

View File

@ -141,14 +141,14 @@ _GL_CXXALIASWARN (creat);
# undef fcntl # undef fcntl
# define fcntl rpl_fcntl # define fcntl rpl_fcntl
# endif # endif
_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...)); _GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...), );
_GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...)); _GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...));
# if !GNULIB_defined_rpl_fcntl # if !GNULIB_defined_rpl_fcntl
# define GNULIB_defined_rpl_fcntl 1 # define GNULIB_defined_rpl_fcntl 1
# endif # endif
# else # else
# if !@HAVE_FCNTL@ # if !@HAVE_FCNTL@
_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...)); _GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...), );
# if !GNULIB_defined_fcntl # if !GNULIB_defined_fcntl
# define GNULIB_defined_fcntl 1 # define GNULIB_defined_fcntl 1
# endif # endif

View File

@ -913,11 +913,11 @@ extern "C" {
# undef imaxabs # undef imaxabs
# define imaxabs rpl_imaxabs # define imaxabs rpl_imaxabs
# endif # endif
_GL_FUNCDECL_RPL (imaxabs, intmax_t, (intmax_t x)); _GL_FUNCDECL_RPL (imaxabs, intmax_t, (intmax_t x), );
_GL_CXXALIAS_RPL (imaxabs, intmax_t, (intmax_t x)); _GL_CXXALIAS_RPL (imaxabs, intmax_t, (intmax_t x));
# else # else
# if !@HAVE_DECL_IMAXABS@ # if !@HAVE_DECL_IMAXABS@
_GL_FUNCDECL_SYS (imaxabs, intmax_t, (intmax_t x)); _GL_FUNCDECL_SYS (imaxabs, intmax_t, (intmax_t x), );
# endif # endif
_GL_CXXALIAS_SYS (imaxabs, intmax_t, (intmax_t x)); _GL_CXXALIAS_SYS (imaxabs, intmax_t, (intmax_t x));
# endif # endif
@ -944,11 +944,11 @@ typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
# undef imaxdiv # undef imaxdiv
# define imaxdiv rpl_imaxdiv # define imaxdiv rpl_imaxdiv
# endif # endif
_GL_FUNCDECL_RPL (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom)); _GL_FUNCDECL_RPL (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom), );
_GL_CXXALIAS_RPL (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom)); _GL_CXXALIAS_RPL (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom));
# else # else
# if !@HAVE_DECL_IMAXDIV@ # if !@HAVE_DECL_IMAXDIV@
_GL_FUNCDECL_SYS (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom)); _GL_FUNCDECL_SYS (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom), );
# endif # endif
_GL_CXXALIAS_SYS (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom)); _GL_CXXALIAS_SYS (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom));
# endif # endif

View File

@ -149,7 +149,7 @@ typedef void (*sighandler_t) (int);
#if @GNULIB_SIG2STR@ #if @GNULIB_SIG2STR@
# if !@HAVE_SIG2STR@ # if !@HAVE_SIG2STR@
_GL_FUNCDECL_SYS (sig2str, int, (int signo, char *str)); _GL_FUNCDECL_SYS (sig2str, int, (int signo, char *str), );
# endif # endif
_GL_CXXALIAS_SYS (sig2str, int, (int signo, char *str)); _GL_CXXALIAS_SYS (sig2str, int, (int signo, char *str));
# if __GLIBC__ >= 2 # if __GLIBC__ >= 2
@ -165,7 +165,7 @@ _GL_WARN_ON_USE (sig2str, "sig2str is not portable - "
#if @GNULIB_SIG2STR@ #if @GNULIB_SIG2STR@
# if !@HAVE_STR2SIG@ # if !@HAVE_STR2SIG@
_GL_FUNCDECL_SYS (str2sig, int, (char const *str, int *signo_p)); _GL_FUNCDECL_SYS (str2sig, int, (char const *str, int *signo_p), );
# endif # endif
_GL_CXXALIAS_SYS (str2sig, int, (char const *str, int *signo_p)); _GL_CXXALIAS_SYS (str2sig, int, (char const *str, int *signo_p));
# if __GLIBC__ >= 2 # if __GLIBC__ >= 2
@ -189,7 +189,7 @@ _GL_WARN_ON_USE (str2sig, "str2sig is not portable - "
_GL_FUNCDECL_RPL (pthread_sigmask, int, _GL_FUNCDECL_RPL (pthread_sigmask, int,
(int how, (int how,
const sigset_t *restrict new_mask, const sigset_t *restrict new_mask,
sigset_t *restrict old_mask)); sigset_t *restrict old_mask), );
_GL_CXXALIAS_RPL (pthread_sigmask, int, _GL_CXXALIAS_RPL (pthread_sigmask, int,
(int how, (int how,
const sigset_t *restrict new_mask, const sigset_t *restrict new_mask,
@ -199,7 +199,7 @@ _GL_CXXALIAS_RPL (pthread_sigmask, int,
_GL_FUNCDECL_SYS (pthread_sigmask, int, _GL_FUNCDECL_SYS (pthread_sigmask, int,
(int how, (int how,
const sigset_t *restrict new_mask, const sigset_t *restrict new_mask,
sigset_t *restrict old_mask)); sigset_t *restrict old_mask), );
# endif # endif
_GL_CXXALIAS_SYS (pthread_sigmask, int, _GL_CXXALIAS_SYS (pthread_sigmask, int,
(int how, (int how,
@ -224,11 +224,11 @@ _GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is not portable - "
# undef raise # undef raise
# define raise rpl_raise # define raise rpl_raise
# endif # endif
_GL_FUNCDECL_RPL (raise, int, (int sig)); _GL_FUNCDECL_RPL (raise, int, (int sig), );
_GL_CXXALIAS_RPL (raise, int, (int sig)); _GL_CXXALIAS_RPL (raise, int, (int sig));
# else # else
# if !@HAVE_RAISE@ # if !@HAVE_RAISE@
_GL_FUNCDECL_SYS (raise, int, (int sig)); _GL_FUNCDECL_SYS (raise, int, (int sig), );
# endif # endif
_GL_CXXALIAS_SYS (raise, int, (int sig)); _GL_CXXALIAS_SYS (raise, int, (int sig));
# endif # endif
@ -359,7 +359,7 @@ _GL_CXXALIASWARN (sigpending);
_GL_FUNCDECL_SYS (sigprocmask, int, _GL_FUNCDECL_SYS (sigprocmask, int,
(int operation, (int operation,
const sigset_t *restrict set, const sigset_t *restrict set,
sigset_t *restrict old_set)); sigset_t *restrict old_set), );
# endif # endif
_GL_CXXALIAS_SYS (sigprocmask, int, _GL_CXXALIAS_SYS (sigprocmask, int,
(int operation, (int operation,
@ -384,7 +384,7 @@ typedef void (*_gl_function_taking_int_returning_void_t) (int);
# define signal rpl_signal # define signal rpl_signal
# endif # endif
_GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t, _GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t,
(int sig, _gl_function_taking_int_returning_void_t func)); (int sig, _gl_function_taking_int_returning_void_t func), );
_GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t, _GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t,
(int sig, _gl_function_taking_int_returning_void_t func)); (int sig, _gl_function_taking_int_returning_void_t func));
# else # else
@ -392,7 +392,7 @@ _GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t,
because it occurs in <sys/signal.h>, not <signal.h> directly. */ because it occurs in <sys/signal.h>, not <signal.h> directly. */
# if defined __OpenBSD__ # if defined __OpenBSD__
_GL_FUNCDECL_SYS (signal, _gl_function_taking_int_returning_void_t, _GL_FUNCDECL_SYS (signal, _gl_function_taking_int_returning_void_t,
(int sig, _gl_function_taking_int_returning_void_t func)); (int sig, _gl_function_taking_int_returning_void_t func), );
# endif # endif
_GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t, _GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t,
(int sig, _gl_function_taking_int_returning_void_t func)); (int sig, _gl_function_taking_int_returning_void_t func));
@ -510,7 +510,7 @@ struct sigaction
# endif # endif
_GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict, _GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict,
struct sigaction *restrict)); struct sigaction *restrict), );
# elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@ # elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@

View File

@ -308,7 +308,7 @@ __gl_stdbit_popcount_wide (unsigned long long int n)
x333333 = max / (1 << 2 | 1), /* 0x333333... */ x333333 = max / (1 << 2 | 1), /* 0x333333... */
x0f0f0f = max / (1 << 4 | 1), /* 0x0f0f0f... */ x0f0f0f = max / (1 << 4 | 1), /* 0x0f0f0f... */
x010101 = max / ((1 << 8) - 1), /* 0x010101... */ x010101 = max / ((1 << 8) - 1), /* 0x010101... */
x000_7f = max / 0xffffffffffffffff * 0x7f; /* 0x000000000000007f... */ x000_7f = max / 0xffffffffffffffffLL * 0x7f; /* 0x000000000000007f... */
n -= (n >> 1) & x555555; n -= (n >> 1) & x555555;
n = (n & x333333) + ((n >> 2) & x333333); n = (n & x333333) + ((n >> 2) & x333333);
n = (n + (n >> 4)) & x0f0f0f; n = (n + (n >> 4)) & x0f0f0f;

View File

@ -461,7 +461,7 @@ _GL_CXXALIASWARN (fdopen);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define fflush rpl_fflush # define fflush rpl_fflush
# endif # endif
_GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream)); _GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream), );
_GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream)); _GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
# else # else
_GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream)); _GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
@ -994,7 +994,7 @@ _GL_CXXALIASWARN (getc);
# undef getchar # undef getchar
# define getchar rpl_getchar # define getchar rpl_getchar
# endif # endif
_GL_FUNCDECL_RPL (getchar, int, (void)); _GL_FUNCDECL_RPL (getchar, int, (void), );
_GL_CXXALIAS_RPL (getchar, int, (void)); _GL_CXXALIAS_RPL (getchar, int, (void));
# else # else
_GL_CXXALIAS_SYS (getchar, int, (void)); _GL_CXXALIAS_SYS (getchar, int, (void));
@ -1112,7 +1112,7 @@ _GL_CXXALIAS_MDA (getw, int, (FILE *restrict stream));
# if @HAVE_DECL_GETW@ # if @HAVE_DECL_GETW@
# if defined __APPLE__ && defined __MACH__ # if defined __APPLE__ && defined __MACH__
/* The presence of the declaration depends on _POSIX_C_SOURCE. */ /* The presence of the declaration depends on _POSIX_C_SOURCE. */
_GL_FUNCDECL_SYS (getw, int, (FILE *restrict stream)); _GL_FUNCDECL_SYS (getw, int, (FILE *restrict stream), );
# endif # endif
_GL_CXXALIAS_SYS (getw, int, (FILE *restrict stream)); _GL_CXXALIAS_SYS (getw, int, (FILE *restrict stream));
# endif # endif
@ -1221,7 +1221,7 @@ _GL_WARN_ON_USE (pclose, "pclose is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define perror rpl_perror # define perror rpl_perror
# endif # endif
_GL_FUNCDECL_RPL (perror, void, (const char *string)); _GL_FUNCDECL_RPL (perror, void, (const char *string), );
_GL_CXXALIAS_RPL (perror, void, (const char *string)); _GL_CXXALIAS_RPL (perror, void, (const char *string));
# else # else
_GL_CXXALIAS_SYS (perror, void, (const char *string)); _GL_CXXALIAS_SYS (perror, void, (const char *string));
@ -1366,7 +1366,7 @@ _GL_CXXALIASWARN (putc);
# undef putchar # undef putchar
# define putchar rpl_putchar # define putchar rpl_putchar
# endif # endif
_GL_FUNCDECL_RPL (putchar, int, (int c)); _GL_FUNCDECL_RPL (putchar, int, (int c), );
_GL_CXXALIAS_RPL (putchar, int, (int c)); _GL_CXXALIAS_RPL (putchar, int, (int c));
# else # else
_GL_CXXALIAS_SYS (putchar, int, (int c)); _GL_CXXALIAS_SYS (putchar, int, (int c));
@ -1406,7 +1406,7 @@ _GL_CXXALIAS_MDA (putw, int, (int w, FILE *restrict stream));
# if @HAVE_DECL_PUTW@ # if @HAVE_DECL_PUTW@
# if defined __APPLE__ && defined __MACH__ # if defined __APPLE__ && defined __MACH__
/* The presence of the declaration depends on _POSIX_C_SOURCE. */ /* The presence of the declaration depends on _POSIX_C_SOURCE. */
_GL_FUNCDECL_SYS (putw, int, (int w, FILE *restrict stream)); _GL_FUNCDECL_SYS (putw, int, (int w, FILE *restrict stream), );
# endif # endif
_GL_CXXALIAS_SYS (putw, int, (int w, FILE *restrict stream)); _GL_CXXALIAS_SYS (putw, int, (int w, FILE *restrict stream));
# endif # endif

View File

@ -20,7 +20,9 @@
#endif #endif
@PRAGMA_COLUMNS@ @PRAGMA_COLUMNS@
#if (defined __need_system_stdlib_h && !defined _GLIBCXX_STDLIB_H) || defined __need_malloc_and_calloc #if ((defined __need_system_stdlib_h && !defined _GLIBCXX_STDLIB_H) \
|| defined __need_malloc_and_calloc) \
&& !defined __SUNPRO_CC
/* Special invocation conventions inside some gnulib header files, /* Special invocation conventions inside some gnulib header files,
and inside some glibc header files, respectively. and inside some glibc header files, respectively.
Do not recognize this special invocation convention when GCC's Do not recognize this special invocation convention when GCC's
@ -220,11 +222,11 @@ struct random_data
# undef _Exit # undef _Exit
# define _Exit rpl__Exit # define _Exit rpl__Exit
# endif # endif
_GL_FUNCDECL_RPL (_Exit, _Noreturn void, (int status)); _GL_FUNCDECL_RPL (_Exit, _Noreturn void, (int status), );
_GL_CXXALIAS_RPL (_Exit, void, (int status)); _GL_CXXALIAS_RPL (_Exit, void, (int status));
# else # else
# if !@HAVE__EXIT@ # if !@HAVE__EXIT@
_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status)); _GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status), );
# endif # endif
_GL_CXXALIAS_SYS (_Exit, void, (int status)); _GL_CXXALIAS_SYS (_Exit, void, (int status));
# endif # endif
@ -249,7 +251,7 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
# undef abort # undef abort
# define abort rpl_abort # define abort rpl_abort
# endif # endif
_GL_FUNCDECL_RPL (abort, _Noreturn void, (void)); _GL_FUNCDECL_RPL (abort, _Noreturn void, (void), );
_GL_CXXALIAS_RPL (abort, void, (void)); _GL_CXXALIAS_RPL (abort, void, (void));
# else # else
_GL_CXXALIAS_SYS (abort, void, (void)); _GL_CXXALIAS_SYS (abort, void, (void));
@ -267,9 +269,9 @@ _GL_CXXALIASWARN (abort);
# define free rpl_free # define free rpl_free
# endif # endif
# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2) # if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
_GL_FUNCDECL_RPL (free, void, (void *ptr)) _GL_ATTRIBUTE_NOTHROW; _GL_FUNCDECL_RPL (free, void, (void *ptr), ) _GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_RPL (free, void, (void *ptr)); _GL_FUNCDECL_RPL (free, void, (void *ptr), );
# endif # endif
_GL_CXXALIAS_RPL (free, void, (void *ptr)); _GL_CXXALIAS_RPL (free, void, (void *ptr));
# else # else
@ -592,7 +594,7 @@ _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
# if @HAVE_DECL_PROGRAM_INVOCATION_NAME@ # if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
_GL_FUNCDECL_RPL (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE); _GL_FUNCDECL_RPL (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE);
# else # else
_GL_FUNCDECL_RPL (getprogname, const char *, (void)); _GL_FUNCDECL_RPL (getprogname, const char *, (void), );
# endif # endif
_GL_CXXALIAS_RPL (getprogname, const char *, (void)); _GL_CXXALIAS_RPL (getprogname, const char *, (void));
# else # else
@ -600,7 +602,7 @@ _GL_CXXALIAS_RPL (getprogname, const char *, (void));
# if @HAVE_DECL_PROGRAM_INVOCATION_NAME@ # if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
_GL_FUNCDECL_SYS (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE); _GL_FUNCDECL_SYS (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE);
# else # else
_GL_FUNCDECL_SYS (getprogname, const char *, (void)); _GL_FUNCDECL_SYS (getprogname, const char *, (void), );
# endif # endif
# endif # endif
_GL_CXXALIAS_SYS (getprogname, const char *, (void)); _GL_CXXALIAS_SYS (getprogname, const char *, (void));
@ -662,7 +664,7 @@ _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
/* Change the ownership and access permission of the slave side of the /* Change the ownership and access permission of the slave side of the
pseudo-terminal whose master side is specified by FD. */ pseudo-terminal whose master side is specified by FD. */
# if !@HAVE_GRANTPT@ # if !@HAVE_GRANTPT@
_GL_FUNCDECL_SYS (grantpt, int, (int fd)); _GL_FUNCDECL_SYS (grantpt, int, (int fd), );
# endif # endif
_GL_CXXALIAS_SYS (grantpt, int, (int fd)); _GL_CXXALIAS_SYS (grantpt, int, (int fd));
_GL_CXXALIASWARN (grantpt); _GL_CXXALIASWARN (grantpt);
@ -788,13 +790,13 @@ _GL_WARN_ON_USE (mbstowcs, "mbstowcs is unportable - "
# define mbtowc rpl_mbtowc # define mbtowc rpl_mbtowc
# endif # endif
_GL_FUNCDECL_RPL (mbtowc, int, _GL_FUNCDECL_RPL (mbtowc, int,
(wchar_t *restrict pwc, const char *restrict s, size_t n)); (wchar_t *restrict pwc, const char *restrict s, size_t n), );
_GL_CXXALIAS_RPL (mbtowc, int, _GL_CXXALIAS_RPL (mbtowc, int,
(wchar_t *restrict pwc, const char *restrict s, size_t n)); (wchar_t *restrict pwc, const char *restrict s, size_t n));
# else # else
# if !@HAVE_MBTOWC@ # if !@HAVE_MBTOWC@
_GL_FUNCDECL_SYS (mbtowc, int, _GL_FUNCDECL_SYS (mbtowc, int,
(wchar_t *restrict pwc, const char *restrict s, size_t n)); (wchar_t *restrict pwc, const char *restrict s, size_t n), );
# endif # endif
_GL_CXXALIAS_SYS (mbtowc, int, _GL_CXXALIAS_SYS (mbtowc, int,
(wchar_t *restrict pwc, const char *restrict s, size_t n)); (wchar_t *restrict pwc, const char *restrict s, size_t n));
@ -1078,11 +1080,11 @@ _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
# undef ptsname_r # undef ptsname_r
# define ptsname_r rpl_ptsname_r # define ptsname_r rpl_ptsname_r
# endif # endif
_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); _GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len), );
_GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len)); _GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
# else # else
# if !@HAVE_PTSNAME_R@ # if !@HAVE_PTSNAME_R@
_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); _GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len), );
# endif # endif
_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len)); _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
# endif # endif
@ -1204,7 +1206,7 @@ _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
# undef rand # undef rand
# define rand rpl_rand # define rand rpl_rand
# endif # endif
_GL_FUNCDECL_RPL (rand, int, (void)); _GL_FUNCDECL_RPL (rand, int, (void), );
_GL_CXXALIAS_RPL (rand, int, (void)); _GL_CXXALIAS_RPL (rand, int, (void));
# else # else
_GL_CXXALIAS_SYS (rand, int, (void)); _GL_CXXALIAS_SYS (rand, int, (void));
@ -1221,11 +1223,11 @@ _GL_CXXALIASWARN (rand);
# undef random # undef random
# define random rpl_random # define random rpl_random
# endif # endif
_GL_FUNCDECL_RPL (random, long, (void)); _GL_FUNCDECL_RPL (random, long, (void), );
_GL_CXXALIAS_RPL (random, long, (void)); _GL_CXXALIAS_RPL (random, long, (void));
# else # else
# if !@HAVE_RANDOM@ # if !@HAVE_RANDOM@
_GL_FUNCDECL_SYS (random, long, (void)); _GL_FUNCDECL_SYS (random, long, (void), );
# endif # endif
/* Need to cast, because on Haiku, the return type is /* Need to cast, because on Haiku, the return type is
int. */ int. */
@ -1248,11 +1250,11 @@ _GL_WARN_ON_USE (random, "random is unportable - "
# undef srandom # undef srandom
# define srandom rpl_srandom # define srandom rpl_srandom
# endif # endif
_GL_FUNCDECL_RPL (srandom, void, (unsigned int seed)); _GL_FUNCDECL_RPL (srandom, void, (unsigned int seed), );
_GL_CXXALIAS_RPL (srandom, void, (unsigned int seed)); _GL_CXXALIAS_RPL (srandom, void, (unsigned int seed));
# else # else
# if !@HAVE_RANDOM@ # if !@HAVE_RANDOM@
_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed)); _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed), );
# endif # endif
/* Need to cast, because on FreeBSD, the first parameter is /* Need to cast, because on FreeBSD, the first parameter is
unsigned long seed. */ unsigned long seed. */
@ -1910,7 +1912,7 @@ _GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
/* Unlock the slave side of the pseudo-terminal whose master side is specified /* Unlock the slave side of the pseudo-terminal whose master side is specified
by FD, so that it can be opened. */ by FD, so that it can be opened. */
# if !@HAVE_UNLOCKPT@ # if !@HAVE_UNLOCKPT@
_GL_FUNCDECL_SYS (unlockpt, int, (int fd)); _GL_FUNCDECL_SYS (unlockpt, int, (int fd), );
# endif # endif
_GL_CXXALIAS_SYS (unlockpt, int, (int fd)); _GL_CXXALIAS_SYS (unlockpt, int, (int fd));
_GL_CXXALIASWARN (unlockpt); _GL_CXXALIASWARN (unlockpt);
@ -1955,7 +1957,7 @@ _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
# undef wctomb # undef wctomb
# define wctomb rpl_wctomb # define wctomb rpl_wctomb
# endif # endif
_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc)); _GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc), );
_GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc)); _GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
# else # else
_GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc)); _GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));

View File

@ -213,7 +213,7 @@ _GL_WARN_ON_USE (explicit_bzero, "explicit_bzero is unportable - "
/* Find the index of the least-significant set bit. */ /* Find the index of the least-significant set bit. */
#if @GNULIB_FFSL@ #if @GNULIB_FFSL@
# if !@HAVE_FFSL@ # if !@HAVE_FFSL@
_GL_FUNCDECL_SYS (ffsl, int, (long int i)); _GL_FUNCDECL_SYS (ffsl, int, (long int i), );
# endif # endif
_GL_CXXALIAS_SYS (ffsl, int, (long int i)); _GL_CXXALIAS_SYS (ffsl, int, (long int i));
_GL_CXXALIASWARN (ffsl); _GL_CXXALIASWARN (ffsl);
@ -231,11 +231,11 @@ _GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module");
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define ffsll rpl_ffsll # define ffsll rpl_ffsll
# endif # endif
_GL_FUNCDECL_RPL (ffsll, int, (long long int i)); _GL_FUNCDECL_RPL (ffsll, int, (long long int i), );
_GL_CXXALIAS_RPL (ffsll, int, (long long int i)); _GL_CXXALIAS_RPL (ffsll, int, (long long int i));
# else # else
# if !@HAVE_FFSLL@ # if !@HAVE_FFSLL@
_GL_FUNCDECL_SYS (ffsll, int, (long long int i)); _GL_FUNCDECL_SYS (ffsll, int, (long long int i), );
# endif # endif
_GL_CXXALIAS_SYS (ffsll, int, (long long int i)); _GL_CXXALIAS_SYS (ffsll, int, (long long int i));
# endif # endif
@ -1308,7 +1308,7 @@ _GL_EXTERN_C char * mbstok_r (char *restrict string, const char *delim,
# undef strerror # undef strerror
# define strerror rpl_strerror # define strerror rpl_strerror
# endif # endif
_GL_FUNCDECL_RPL (strerror, char *, (int)); _GL_FUNCDECL_RPL (strerror, char *, (int), );
_GL_CXXALIAS_RPL (strerror, char *, (int)); _GL_CXXALIAS_RPL (strerror, char *, (int));
# else # else
_GL_CXXALIAS_SYS (strerror, char *, (int)); _GL_CXXALIAS_SYS (strerror, char *, (int));
@ -1359,11 +1359,11 @@ _GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - "
# undef strerrorname_np # undef strerrorname_np
# define strerrorname_np rpl_strerrorname_np # define strerrorname_np rpl_strerrorname_np
# endif # endif
_GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum)); _GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum), );
_GL_CXXALIAS_RPL (strerrorname_np, const char *, (int errnum)); _GL_CXXALIAS_RPL (strerrorname_np, const char *, (int errnum));
# else # else
# if !@HAVE_STRERRORNAME_NP@ # if !@HAVE_STRERRORNAME_NP@
_GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum)); _GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum), );
# endif # endif
_GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum)); _GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum));
# endif # endif
@ -1379,7 +1379,7 @@ _GL_WARN_ON_USE (strerrorname_np, "strerrorname_np is unportable - "
/* Return an abbreviation string for the signal number SIG. */ /* Return an abbreviation string for the signal number SIG. */
#if @GNULIB_SIGABBREV_NP@ #if @GNULIB_SIGABBREV_NP@
# if ! @HAVE_SIGABBREV_NP@ # if ! @HAVE_SIGABBREV_NP@
_GL_FUNCDECL_SYS (sigabbrev_np, const char *, (int sig)); _GL_FUNCDECL_SYS (sigabbrev_np, const char *, (int sig), );
# endif # endif
_GL_CXXALIAS_SYS (sigabbrev_np, const char *, (int sig)); _GL_CXXALIAS_SYS (sigabbrev_np, const char *, (int sig));
_GL_CXXALIASWARN (sigabbrev_np); _GL_CXXALIASWARN (sigabbrev_np);
@ -1394,7 +1394,7 @@ _GL_WARN_ON_USE (sigabbrev_np, "sigabbrev_np is unportable - "
/* Return an English description string for the signal number SIG. */ /* Return an English description string for the signal number SIG. */
#if @GNULIB_SIGDESCR_NP@ #if @GNULIB_SIGDESCR_NP@
# if ! @HAVE_SIGDESCR_NP@ # if ! @HAVE_SIGDESCR_NP@
_GL_FUNCDECL_SYS (sigdescr_np, const char *, (int sig)); _GL_FUNCDECL_SYS (sigdescr_np, const char *, (int sig), );
# endif # endif
_GL_CXXALIAS_SYS (sigdescr_np, const char *, (int sig)); _GL_CXXALIAS_SYS (sigdescr_np, const char *, (int sig));
_GL_CXXALIASWARN (sigdescr_np); _GL_CXXALIASWARN (sigdescr_np);
@ -1411,11 +1411,11 @@ _GL_WARN_ON_USE (sigdescr_np, "sigdescr_np is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define strsignal rpl_strsignal # define strsignal rpl_strsignal
# endif # endif
_GL_FUNCDECL_RPL (strsignal, char *, (int __sig)); _GL_FUNCDECL_RPL (strsignal, char *, (int __sig), );
_GL_CXXALIAS_RPL (strsignal, char *, (int __sig)); _GL_CXXALIAS_RPL (strsignal, char *, (int __sig));
# else # else
# if ! @HAVE_DECL_STRSIGNAL@ # if ! @HAVE_DECL_STRSIGNAL@
_GL_FUNCDECL_SYS (strsignal, char *, (int __sig)); _GL_FUNCDECL_SYS (strsignal, char *, (int __sig), );
# endif # endif
/* Need to cast, because on Cygwin 1.5.x systems, the return type is /* Need to cast, because on Cygwin 1.5.x systems, the return type is
'const char *'. */ 'const char *'. */

View File

@ -282,7 +282,7 @@ rpl_fd_isset (SOCKET fd, fd_set * set)
# endif # endif
_GL_FUNCDECL_RPL (pselect, int, _GL_FUNCDECL_RPL (pselect, int,
(int, fd_set *restrict, fd_set *restrict, fd_set *restrict, (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
struct timespec const *restrict, const sigset_t *restrict)); struct timespec const *restrict, const sigset_t *restrict), );
_GL_CXXALIAS_RPL (pselect, int, _GL_CXXALIAS_RPL (pselect, int,
(int, fd_set *restrict, fd_set *restrict, fd_set *restrict, (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
struct timespec const *restrict, const sigset_t *restrict)); struct timespec const *restrict, const sigset_t *restrict));
@ -290,7 +290,7 @@ _GL_CXXALIAS_RPL (pselect, int,
# if !@HAVE_PSELECT@ # if !@HAVE_PSELECT@
_GL_FUNCDECL_SYS (pselect, int, _GL_FUNCDECL_SYS (pselect, int,
(int, fd_set *restrict, fd_set *restrict, fd_set *restrict, (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
struct timespec const *restrict, const sigset_t *restrict)); struct timespec const *restrict, const sigset_t *restrict), );
# endif # endif
/* Need to cast, because on AIX 7, the second, third, fourth argument may be /* Need to cast, because on AIX 7, the second, third, fourth argument may be
void *restrict, void *restrict, void *restrict. */ void *restrict, void *restrict, void *restrict. */
@ -319,7 +319,7 @@ _GL_WARN_ON_USE (pselect, "pselect is not portable - "
# endif # endif
_GL_FUNCDECL_RPL (select, int, _GL_FUNCDECL_RPL (select, int,
(int, fd_set *restrict, fd_set *restrict, fd_set *restrict, (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
struct timeval *restrict)); struct timeval *restrict), );
_GL_CXXALIAS_RPL (select, int, _GL_CXXALIAS_RPL (select, int,
(int, fd_set *restrict, fd_set *restrict, fd_set *restrict, (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
timeval *restrict)); timeval *restrict));

View File

@ -585,11 +585,11 @@ _GL_WARN_ON_USE (fstatat, "fstatat is not portable - "
# undef futimens # undef futimens
# define futimens rpl_futimens # define futimens rpl_futimens
# endif # endif
_GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2])); _GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2]), );
_GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2])); _GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2]));
# else # else
# if !@HAVE_FUTIMENS@ # if !@HAVE_FUTIMENS@
_GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2])); _GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]), );
# endif # endif
_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2])); _GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
# endif # endif
@ -608,9 +608,9 @@ _GL_WARN_ON_USE (futimens, "futimens is not portable - "
#if @GNULIB_GETUMASK@ #if @GNULIB_GETUMASK@
# if !@HAVE_GETUMASK@ # if !@HAVE_GETUMASK@
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2 # if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
_GL_FUNCDECL_SYS (getumask, mode_t, (void)) _GL_ATTRIBUTE_NOTHROW; _GL_FUNCDECL_SYS (getumask, mode_t, (void), ) _GL_ATTRIBUTE_NOTHROW;
# else # else
_GL_FUNCDECL_SYS (getumask, mode_t, (void)); _GL_FUNCDECL_SYS (getumask, mode_t, (void), );
# endif # endif
# endif # endif
_GL_CXXALIAS_SYS (getumask, mode_t, (void)); _GL_CXXALIAS_SYS (getumask, mode_t, (void));

View File

@ -201,7 +201,7 @@ _GL_WARN_ON_USE (timespec_getres, "timespec_getres is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define time rpl_time # define time rpl_time
# endif # endif
_GL_FUNCDECL_RPL (time, time_t, (time_t *__tp)); _GL_FUNCDECL_RPL (time, time_t, (time_t *__tp), );
_GL_CXXALIAS_RPL (time, time_t, (time_t *__tp)); _GL_CXXALIAS_RPL (time, time_t, (time_t *__tp));
# else # else
_GL_CXXALIAS_SYS (time, time_t, (time_t *__tp)); _GL_CXXALIAS_SYS (time, time_t, (time_t *__tp));
@ -255,7 +255,7 @@ _GL_WARN_ON_USE (nanosleep, "nanosleep is unportable - "
# undef tzset # undef tzset
# define tzset rpl_tzset # define tzset rpl_tzset
# endif # endif
_GL_FUNCDECL_RPL (tzset, void, (void)); _GL_FUNCDECL_RPL (tzset, void, (void), );
_GL_CXXALIAS_RPL (tzset, void, (void)); _GL_CXXALIAS_RPL (tzset, void, (void));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -516,7 +516,7 @@ typedef struct tm_zone *rpl_timezone_t;
May return NULL if NAME is invalid (this is platform dependent) or May return NULL if NAME is invalid (this is platform dependent) or
upon memory allocation failure. */ upon memory allocation failure. */
# if !@HAVE_TZALLOC@ # if !@HAVE_TZALLOC@
_GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name)); _GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name), );
_GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name)); _GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name));
# endif # endif
@ -524,7 +524,7 @@ _GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name));
Frees a time zone object. Frees a time zone object.
The argument must have been returned by tzalloc(). */ The argument must have been returned by tzalloc(). */
# if !@HAVE_TZALLOC@ # if !@HAVE_TZALLOC@
_GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz)); _GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz), );
_GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz)); _GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz));
# endif # endif

View File

@ -399,7 +399,7 @@ _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
# undef close # undef close
# define close rpl_close # define close rpl_close
# endif # endif
_GL_FUNCDECL_RPL (close, int, (int fd)); _GL_FUNCDECL_RPL (close, int, (int fd), );
_GL_CXXALIAS_RPL (close, int, (int fd)); _GL_CXXALIAS_RPL (close, int, (int fd));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -446,7 +446,7 @@ _GL_CXXALIASWARN (close);
# endif # endif
_GL_FUNCDECL_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos, _GL_FUNCDECL_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos,
int ofd, off_t *opos, int ofd, off_t *opos,
size_t len, unsigned flags)); size_t len, unsigned flags), );
_GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos, _GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos,
int ofd, off_t *opos, int ofd, off_t *opos,
size_t len, unsigned flags)); size_t len, unsigned flags));
@ -454,7 +454,7 @@ _GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos,
# if !@HAVE_COPY_FILE_RANGE@ # if !@HAVE_COPY_FILE_RANGE@
_GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, _GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
int ofd, off_t *opos, int ofd, off_t *opos,
size_t len, unsigned flags)); size_t len, unsigned flags), );
# endif # endif
_GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, _GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
int ofd, off_t *opos, int ofd, off_t *opos,
@ -521,7 +521,7 @@ _GL_CXXALIASWARN (dup);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define dup2 rpl_dup2 # define dup2 rpl_dup2
# endif # endif
_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd)); _GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd), );
_GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd)); _GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -570,11 +570,11 @@ _GL_CXXALIASWARN (dup2);
# undef dup3 # undef dup3
# define dup3 rpl_dup3 # define dup3 rpl_dup3
# endif # endif
_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags)); _GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags), );
_GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags)); _GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
# else # else
# if !@HAVE_DUP3@ # if !@HAVE_DUP3@
_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags)); _GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags), );
# endif # endif
_GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags)); _GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
# endif # endif
@ -1045,11 +1045,11 @@ _GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
# undef fdatasync # undef fdatasync
# define fdatasync rpl_fdatasync # define fdatasync rpl_fdatasync
# endif # endif
_GL_FUNCDECL_RPL (fdatasync, int, (int fd)); _GL_FUNCDECL_RPL (fdatasync, int, (int fd), );
_GL_CXXALIAS_RPL (fdatasync, int, (int fd)); _GL_CXXALIAS_RPL (fdatasync, int, (int fd));
# else # else
# if !@HAVE_FDATASYNC@|| !@HAVE_DECL_FDATASYNC@ # if !@HAVE_FDATASYNC@|| !@HAVE_DECL_FDATASYNC@
_GL_FUNCDECL_SYS (fdatasync, int, (int fd)); _GL_FUNCDECL_SYS (fdatasync, int, (int fd), );
# endif # endif
_GL_CXXALIAS_SYS (fdatasync, int, (int fd)); _GL_CXXALIAS_SYS (fdatasync, int, (int fd));
# endif # endif
@ -1071,7 +1071,7 @@ _GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - "
See POSIX:2008 specification See POSIX:2008 specification
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */ <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */
# if !@HAVE_FSYNC@ # if !@HAVE_FSYNC@
_GL_FUNCDECL_SYS (fsync, int, (int fd)); _GL_FUNCDECL_SYS (fsync, int, (int fd), );
# endif # endif
_GL_CXXALIAS_SYS (fsync, int, (int fd)); _GL_CXXALIAS_SYS (fsync, int, (int fd));
_GL_CXXALIASWARN (fsync); _GL_CXXALIASWARN (fsync);
@ -1223,11 +1223,11 @@ _GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
# undef getdtablesize # undef getdtablesize
# define getdtablesize rpl_getdtablesize # define getdtablesize rpl_getdtablesize
# endif # endif
_GL_FUNCDECL_RPL (getdtablesize, int, (void)); _GL_FUNCDECL_RPL (getdtablesize, int, (void), );
_GL_CXXALIAS_RPL (getdtablesize, int, (void)); _GL_CXXALIAS_RPL (getdtablesize, int, (void));
# else # else
# if !@HAVE_GETDTABLESIZE@ # if !@HAVE_GETDTABLESIZE@
_GL_FUNCDECL_SYS (getdtablesize, int, (void)); _GL_FUNCDECL_SYS (getdtablesize, int, (void), );
# endif # endif
/* Need to cast, because on AIX, the parameter list is /* Need to cast, because on AIX, the parameter list is
(...). */ (...). */
@ -1360,7 +1360,7 @@ _GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
$USERNAME on native Windows platforms. $USERNAME on native Windows platforms.
*/ */
# if !@HAVE_DECL_GETLOGIN@ # if !@HAVE_DECL_GETLOGIN@
_GL_FUNCDECL_SYS (getlogin, char *, (void)); _GL_FUNCDECL_SYS (getlogin, char *, (void), );
# endif # endif
_GL_CXXALIAS_SYS (getlogin, char *, (void)); _GL_CXXALIAS_SYS (getlogin, char *, (void));
_GL_CXXALIASWARN (getlogin); _GL_CXXALIASWARN (getlogin);
@ -1421,13 +1421,13 @@ _GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define getpagesize rpl_getpagesize # define getpagesize rpl_getpagesize
# endif # endif
_GL_FUNCDECL_RPL (getpagesize, int, (void)); _GL_FUNCDECL_RPL (getpagesize, int, (void), );
_GL_CXXALIAS_RPL (getpagesize, int, (void)); _GL_CXXALIAS_RPL (getpagesize, int, (void));
# else # else
/* On HP-UX, getpagesize exists, but it is not declared in <unistd.h> even if /* On HP-UX, getpagesize exists, but it is not declared in <unistd.h> even if
the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used. */ the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used. */
# if defined __hpux # if defined __hpux
_GL_FUNCDECL_SYS (getpagesize, int, (void)); _GL_FUNCDECL_SYS (getpagesize, int, (void), );
# endif # endif
# if !@HAVE_GETPAGESIZE@ # if !@HAVE_GETPAGESIZE@
# if !defined getpagesize # if !defined getpagesize
@ -1559,11 +1559,11 @@ _GL_CXXALIASWARN (getpid);
# undef getusershell # undef getusershell
# define getusershell rpl_getusershell # define getusershell rpl_getusershell
# endif # endif
_GL_FUNCDECL_RPL (getusershell, char *, (void)); _GL_FUNCDECL_RPL (getusershell, char *, (void), );
_GL_CXXALIAS_RPL (getusershell, char *, (void)); _GL_CXXALIAS_RPL (getusershell, char *, (void));
# else # else
# if !@HAVE_DECL_GETUSERSHELL@ # if !@HAVE_DECL_GETUSERSHELL@
_GL_FUNCDECL_SYS (getusershell, char *, (void)); _GL_FUNCDECL_SYS (getusershell, char *, (void), );
# endif # endif
_GL_CXXALIAS_SYS (getusershell, char *, (void)); _GL_CXXALIAS_SYS (getusershell, char *, (void));
# endif # endif
@ -1583,11 +1583,11 @@ _GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
# undef setusershell # undef setusershell
# define setusershell rpl_setusershell # define setusershell rpl_setusershell
# endif # endif
_GL_FUNCDECL_RPL (setusershell, void, (void)); _GL_FUNCDECL_RPL (setusershell, void, (void), );
_GL_CXXALIAS_RPL (setusershell, void, (void)); _GL_CXXALIAS_RPL (setusershell, void, (void));
# else # else
# if !@HAVE_DECL_GETUSERSHELL@ # if !@HAVE_DECL_GETUSERSHELL@
_GL_FUNCDECL_SYS (setusershell, void, (void)); _GL_FUNCDECL_SYS (setusershell, void, (void), );
# endif # endif
_GL_CXXALIAS_SYS (setusershell, void, (void)); _GL_CXXALIAS_SYS (setusershell, void, (void));
# endif # endif
@ -1608,11 +1608,11 @@ _GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
# undef endusershell # undef endusershell
# define endusershell rpl_endusershell # define endusershell rpl_endusershell
# endif # endif
_GL_FUNCDECL_RPL (endusershell, void, (void)); _GL_FUNCDECL_RPL (endusershell, void, (void), );
_GL_CXXALIAS_RPL (endusershell, void, (void)); _GL_CXXALIAS_RPL (endusershell, void, (void));
# else # else
# if !@HAVE_DECL_GETUSERSHELL@ # if !@HAVE_DECL_GETUSERSHELL@
_GL_FUNCDECL_SYS (endusershell, void, (void)); _GL_FUNCDECL_SYS (endusershell, void, (void), );
# endif # endif
_GL_CXXALIAS_SYS (endusershell, void, (void)); _GL_CXXALIAS_SYS (endusershell, void, (void));
# endif # endif
@ -1629,7 +1629,7 @@ _GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
#if @GNULIB_GROUP_MEMBER@ #if @GNULIB_GROUP_MEMBER@
/* Determine whether group id is in calling user's group list. */ /* Determine whether group id is in calling user's group list. */
# if !@HAVE_GROUP_MEMBER@ # if !@HAVE_GROUP_MEMBER@
_GL_FUNCDECL_SYS (group_member, int, (gid_t gid)); _GL_FUNCDECL_SYS (group_member, int, (gid_t gid), );
# endif # endif
_GL_CXXALIAS_SYS (group_member, int, (gid_t gid)); _GL_CXXALIAS_SYS (group_member, int, (gid_t gid));
_GL_CXXALIASWARN (group_member); _GL_CXXALIASWARN (group_member);
@ -1649,7 +1649,7 @@ _GL_WARN_ON_USE (group_member, "group_member is unportable - "
# define isatty rpl_isatty # define isatty rpl_isatty
# endif # endif
# define GNULIB_defined_isatty 1 # define GNULIB_defined_isatty 1
_GL_FUNCDECL_RPL (isatty, int, (int fd)); _GL_FUNCDECL_RPL (isatty, int, (int fd), );
_GL_CXXALIAS_RPL (isatty, int, (int fd)); _GL_CXXALIAS_RPL (isatty, int, (int fd));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -1792,7 +1792,7 @@ _GL_WARN_ON_USE (linkat, "linkat is unportable - "
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define lseek rpl_lseek # define lseek rpl_lseek
# endif # endif
_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence)); _GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence), );
_GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence)); _GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
# elif defined _WIN32 && !defined __CYGWIN__ # elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE) # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -2161,11 +2161,11 @@ _GL_WARN_ON_USE (sethostname, "sethostname is unportable - "
# undef sleep # undef sleep
# define sleep rpl_sleep # define sleep rpl_sleep
# endif # endif
_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n)); _GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n), );
_GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n)); _GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n));
# else # else
# if !@HAVE_SLEEP@ # if !@HAVE_SLEEP@
_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n)); _GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n), );
# endif # endif
_GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n)); _GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n));
# endif # endif
@ -2409,11 +2409,11 @@ _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
# undef usleep # undef usleep
# define usleep rpl_usleep # define usleep rpl_usleep
# endif # endif
_GL_FUNCDECL_RPL (usleep, int, (useconds_t n)); _GL_FUNCDECL_RPL (usleep, int, (useconds_t n), );
_GL_CXXALIAS_RPL (usleep, int, (useconds_t n)); _GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
# else # else
# if !@HAVE_USLEEP@ # if !@HAVE_USLEEP@
_GL_FUNCDECL_SYS (usleep, int, (useconds_t n)); _GL_FUNCDECL_SYS (usleep, int, (useconds_t n), );
# endif # endif
/* Need to cast, because on Haiku, the first parameter is /* Need to cast, because on Haiku, the first parameter is
unsigned int n. */ unsigned int n. */

View File

@ -516,6 +516,7 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2])
} }
} }
#if !HAVE_UTIMENS
/* Set the access and modification timestamps of FILE to be /* Set the access and modification timestamps of FILE to be
TIMESPEC[0] and TIMESPEC[1], respectively. */ TIMESPEC[0] and TIMESPEC[1], respectively. */
int int
@ -523,7 +524,9 @@ utimens (char const *file, struct timespec const timespec[2])
{ {
return fdutimens (-1, file, timespec); return fdutimens (-1, file, timespec);
} }
#endif
#if !HAVE_LUTIMENS
/* Set the access and modification timestamps of FILE to be /* Set the access and modification timestamps of FILE to be
TIMESPEC[0] and TIMESPEC[1], respectively, without dereferencing TIMESPEC[0] and TIMESPEC[1], respectively, without dereferencing
symlinks. Fail with ENOSYS if the platform does not support symlinks. Fail with ENOSYS if the platform does not support
@ -646,3 +649,4 @@ lutimens (char const *file, struct timespec const timespec[2])
errno = ENOSYS; errno = ENOSYS;
return -1; return -1;
} }
#endif

View File

@ -24,13 +24,21 @@
#include <time.h> #include <time.h>
#if HAVE_UTIMENS || HAVE_LUTIMENS
# include <sys/time.h>
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int fdutimens (int, char const *, struct timespec const [2]); int fdutimens (int, char const *, struct timespec const [2]);
#if !HAVE_UTIMENS
int utimens (char const *, struct timespec const [2]); int utimens (char const *, struct timespec const [2]);
#endif
#if !HAVE_LUTIMENS
int lutimens (char const *, struct timespec const [2]); int lutimens (char const *, struct timespec const [2]);
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -1,5 +1,5 @@
# std-gnu11.m4 # std-gnu11.m4
# serial 2 # serial 3
# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*- # Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*-
@ -9,6 +9,7 @@ m4_ifndef([_AC_C_C23_OPTIONS], [
# This implementation is taken from GNU Autoconf lib/autoconf/c.m4 # This implementation is taken from GNU Autoconf lib/autoconf/c.m4
# commit 017d5ddd82854911f0119691d91ea8a1438824d6 # commit 017d5ddd82854911f0119691d91ea8a1438824d6
# dated Sun Apr 3 13:57:17 2016 -0700 # dated Sun Apr 3 13:57:17 2016 -0700
# with minor changes to commentary.
# This implementation will be obsolete once we can assume Autoconf 2.70 # This implementation will be obsolete once we can assume Autoconf 2.70
# or later is installed everywhere a Gnulib program might be developed. # or later is installed everywhere a Gnulib program might be developed.
@ -17,9 +18,10 @@ m4_version_prereq([2.70], [], [
# Copyright (C) 2001-2024 Free Software Foundation, Inc. # Copyright (C) 2001-2024 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This file is part of Autoconf. This program is free
# it under the terms of the GNU General Public License as published by # software; you can redistribute it and/or modify it under the
# the Free Software Foundation, either version 3 of the License, or # terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
@ -27,8 +29,15 @@ m4_version_prereq([2.70], [], [
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# Under Section 7 of GPL version 3, you are granted additional
# permissions described in the Autoconf Configure Script Exception,
# version 3.0, as published by the Free Software Foundation.
#
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>. # and a copy of the Autoconf Configure Script Exception along with
# this program; see the files COPYINGv3 and COPYING.EXCEPTION
# respectively. If not, see <https://www.gnu.org/licenses/> and
# <https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;f=COPYING.EXCEPTION>.
# Written by David MacKenzie, with help from # Written by David MacKenzie, with help from
# Akim Demaille, Paul Eggert, # Akim Demaille, Paul Eggert,

View File

@ -1,5 +1,5 @@
# utimens.m4 # utimens.m4
# serial 16 # serial 17
dnl Copyright (C) 2003-2024 Free Software Foundation, Inc. dnl Copyright (C) 2003-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -16,6 +16,7 @@ AC_DEFUN([gl_UTIMENS],
gl_CHECK_FUNCS_ANDROID([lutimes], [[#include <sys/time.h>]]) gl_CHECK_FUNCS_ANDROID([lutimes], [[#include <sys/time.h>]])
gl_CHECK_FUNCS_ANDROID([futimens], [[#include <sys/stat.h>]]) gl_CHECK_FUNCS_ANDROID([futimens], [[#include <sys/stat.h>]])
gl_CHECK_FUNCS_ANDROID([utimensat], [[#include <sys/stat.h>]]) gl_CHECK_FUNCS_ANDROID([utimensat], [[#include <sys/stat.h>]])
AC_CHECK_FUNCS_ONCE([utimens lutimens])
if test $ac_cv_func_futimens = no && test $ac_cv_func_futimesat = yes; then if test $ac_cv_func_futimens = no && test $ac_cv_func_futimesat = yes; then
dnl FreeBSD 8.0-rc2 mishandles futimesat(fd,NULL,time). It is not dnl FreeBSD 8.0-rc2 mishandles futimesat(fd,NULL,time). It is not