diff options
author | Ludovic Courtès <ludo@gnu.org> | 2010-12-20 22:51:46 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2010-12-20 22:51:46 +0100 |
commit | ab4d62adbf5ee06a9ecbdb805c83c326a866b33c (patch) | |
tree | 0f9f26a991d0af425ddfa21f0fad0386629bf9a9 /lib | |
parent | b90b4b2bf2892d868839cf599365a001999f8c15 (diff) |
Update Gnulib to v0.0-4544-gce083ca.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile.am | 14 | ||||
-rw-r--r-- | lib/math.in.h | 4 | ||||
-rw-r--r-- | lib/stdio.in.h | 18 | ||||
-rw-r--r-- | lib/stdlib.in.h | 8 | ||||
-rw-r--r-- | lib/sys_stat.in.h | 3 | ||||
-rw-r--r-- | lib/unistd.in.h | 27 | ||||
-rw-r--r-- | lib/unistr.in.h | 28 |
7 files changed, 75 insertions, 27 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am index ea4a69f91..7e2d4d43c 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -232,7 +232,8 @@ EXTRA_DIST += close-hook.h # # Another advantage is that 'make' output is shorter. # -# Listed in the same order as the GNU makefile conventions. +# Listed in the same order as the GNU makefile conventions, and +# provided by autoconf 2.59c+. # The Automake-defined pkg* macros are appended, in the order # listed in the Automake 1.10a+ documentation. configmake.h: Makefile @@ -1155,6 +1156,8 @@ stdio.h: stdio.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \ < $(srcdir)/stdio.in.h | \ sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \ + -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \ + -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \ -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \ @@ -1265,14 +1268,14 @@ stdlib.h: stdlib.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \ -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \ - -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \ + -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \ -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \ - -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \ + -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \ -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ @@ -1676,6 +1679,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ -e 's|@''GNULIB_LINKAT''@|$(GNULIB_LINKAT)|g' \ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ + -e 's|@''GNULIB_PIPE''@|$(GNULIB_PIPE)|g' \ -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \ -e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \ -e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \ @@ -1710,6 +1714,7 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ -e 's|@''HAVE_LINKAT''@|$(HAVE_LINKAT)|g' \ + -e 's|@''HAVE_PIPE''@|$(HAVE_PIPE)|g' \ -e 's|@''HAVE_PIPE2''@|$(HAVE_PIPE2)|g' \ -e 's|@''HAVE_PREAD''@|$(HAVE_PREAD)|g' \ -e 's|@''HAVE_PWRITE''@|$(HAVE_PWRITE)|g' \ @@ -1718,14 +1723,15 @@ unistd.h: unistd.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ -e 's|@''HAVE_SYMLINK''@|$(HAVE_SYMLINK)|g' \ -e 's|@''HAVE_SYMLINKAT''@|$(HAVE_SYMLINKAT)|g' \ - -e 's|@''HAVE_TTYNAME_R''@|$(HAVE_TTYNAME_R)|g' \ -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ + -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ + -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \ -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ diff --git a/lib/math.in.h b/lib/math.in.h index f1bda2ed9..b04c9e630 100644 --- a/lib/math.in.h +++ b/lib/math.in.h @@ -680,6 +680,10 @@ _GL_EXTERN_C int rpl_isnanl (long double x); sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \ gl_isnan_f (x)) # endif +/* Ensure isnan is a macro. */ +# ifndef isnan +# define isnan isnan +# endif #elif defined GNULIB_POSIXCHECK # if defined isnan _GL_WARN_REAL_FLOATING_DECL (isnan); diff --git a/lib/stdio.in.h b/lib/stdio.in.h index fbd096a21..1aa122796 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -21,8 +21,14 @@ #endif @PRAGMA_COLUMNS@ -#if defined __need_FILE || defined __need___FILE -/* Special invocation convention inside glibc header files. */ +#if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H +/* Special invocation convention: + - Inside glibc header files. + - On OSF/1 5.1 we have a sequence of nested includes + <stdio.h> -> <getopt.h> -> <ctype.h> -> <sys/localedef.h> -> + <sys/lc_core.h> -> <nl_types.h> -> <mesg.h> -> <stdio.h>. + In this situation, the functions are not yet declared, therefore we cannot + provide the C++ aliases. */ #@INCLUDE_NEXT@ @NEXT_STDIO_H@ @@ -31,9 +37,13 @@ #ifndef _GL_STDIO_H +#define _GL_ALREADY_INCLUDING_STDIO_H + /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_STDIO_H@ +#undef _GL_ALREADY_INCLUDING_STDIO_H + #ifndef _GL_STDIO_H #define _GL_STDIO_H @@ -345,7 +355,7 @@ _GL_FUNCDECL_RPL (fseeko, int, (FILE *fp, off_t offset, int whence) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (fseeko, int, (FILE *fp, off_t offset, int whence)); # else -# if ! @HAVE_FSEEKO@ +# if ! @HAVE_DECL_FSEEKO@ _GL_FUNCDECL_SYS (fseeko, int, (FILE *fp, off_t offset, int whence) _GL_ARG_NONNULL ((1))); # endif @@ -421,7 +431,7 @@ _GL_CXXALIASWARN (ftell); _GL_FUNCDECL_RPL (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (ftello, off_t, (FILE *fp)); # else -# if ! @HAVE_FTELLO@ +# if ! @HAVE_DECL_FTELLO@ _GL_FUNCDECL_SYS (ftello, off_t, (FILE *fp) _GL_ARG_NONNULL ((1))); # endif _GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp)); diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index 04f32b6b8..1bae6c7d2 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -584,7 +584,7 @@ _GL_FUNCDECL_RPL (setenv, int, _GL_CXXALIAS_RPL (setenv, int, (const char *name, const char *value, int replace)); # else -# if !@HAVE_SETENV@ +# if !@HAVE_DECL_SETENV@ _GL_FUNCDECL_SYS (setenv, int, (const char *name, const char *value, int replace) _GL_ARG_NONNULL ((1))); @@ -592,7 +592,9 @@ _GL_FUNCDECL_SYS (setenv, int, _GL_CXXALIAS_SYS (setenv, int, (const char *name, const char *value, int replace)); # endif +# if !(@REPLACE_SETENV@ && !@HAVE_DECL_SETENV@) _GL_CXXALIASWARN (setenv); +# endif #elif defined GNULIB_POSIXCHECK # undef setenv # if HAVE_RAW_DECL_SETENV @@ -702,12 +704,14 @@ _GL_WARN_ON_USE (unlockpt, "unlockpt is not portable - " _GL_FUNCDECL_RPL (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (unsetenv, int, (const char *name)); # else -# if !@HAVE_UNSETENV@ +# if !@HAVE_DECL_UNSETENV@ _GL_FUNCDECL_SYS (unsetenv, int, (const char *name) _GL_ARG_NONNULL ((1))); # endif _GL_CXXALIAS_SYS (unsetenv, int, (const char *name)); # endif +# if !(@REPLACE_UNSETENV@ && !@HAVE_DECL_UNSETENV@) _GL_CXXALIASWARN (unsetenv); +# endif #elif defined GNULIB_POSIXCHECK # undef unsetenv # if HAVE_RAW_DECL_UNSETENV diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h index 920da9ab5..f969ab9d1 100644 --- a/lib/sys_stat.in.h +++ b/lib/sys_stat.in.h @@ -550,7 +550,8 @@ _GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)); _GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev) _GL_ARG_NONNULL ((1))); # endif -_GL_CXXALIAS_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev)); +/* Need to cast, because on OSF/1 5.1, the third parameter is '...'. */ +_GL_CXXALIAS_SYS_CAST (mknod, int, (char const *file, mode_t mode, dev_t dev)); # endif _GL_CXXALIASWARN (mknod); #elif defined GNULIB_POSIXCHECK diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 8955f397d..0a4fa6bd0 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -435,6 +435,10 @@ _GL_EXTERN_C void _gl_unregister_fd (int fd); _GL_EXTERN_C int _gl_register_dup (int oldfd, int newfd); _GL_EXTERN_C const char *_gl_directory_name (int fd); +# else +# if !@HAVE_DECL_FCHDIR@ +_GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/)); +# endif # endif _GL_CXXALIAS_SYS (fchdir, int, (int /*fd*/)); _GL_CXXALIASWARN (fchdir); @@ -650,7 +654,8 @@ _GL_CXXALIAS_RPL (gethostname, int, (char *name, size_t len)); _GL_FUNCDECL_SYS (gethostname, int, (char *name, size_t len) _GL_ARG_NONNULL ((1))); # endif -/* Need to cast, because on Solaris 10 systems, the second parameter is +/* Need to cast, because on Solaris 10 and OSF/1 5.1 systems, the second + parameter is int len. */ _GL_CXXALIAS_SYS_CAST (gethostname, int, (char *name, size_t len)); # endif @@ -972,6 +977,24 @@ _GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some " #endif +#if @GNULIB_PIPE@ +/* Create a pipe, defaulting to O_BINARY mode. + Store the read-end as fd[0] and the write-end as fd[1]. + Return 0 upon success, or -1 with errno set upon failure. */ +# if !@HAVE_PIPE@ +_GL_FUNCDECL_SYS (pipe, int, (int fd[2]) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (pipe, int, (int fd[2])); +_GL_CXXALIASWARN (pipe); +#elif defined GNULIB_POSIXCHECK +# undef pipe +# if HAVE_RAW_DECL_PIPE +_GL_WARN_ON_USE (pipe, "pipe is unportable - " + "use gnulib module pipe-posix for portability"); +# endif +#endif + + #if @GNULIB_PIPE2@ /* Create a pipe, applying the given flags when opening the read-end of the pipe and the write-end of the pipe. @@ -1226,7 +1249,7 @@ _GL_FUNCDECL_RPL (ttyname_r, int, _GL_CXXALIAS_RPL (ttyname_r, int, (int fd, char *buf, size_t buflen)); # else -# if !@HAVE_TTYNAME_R@ +# if !@HAVE_DECL_TTYNAME_R@ _GL_FUNCDECL_SYS (ttyname_r, int, (int fd, char *buf, size_t buflen) _GL_ARG_NONNULL ((2))); # endif diff --git a/lib/unistr.in.h b/lib/unistr.in.h index 2164d9d34..2e7c6184c 100644 --- a/lib/unistr.in.h +++ b/lib/unistr.in.h @@ -134,7 +134,7 @@ extern int /* The variants with _safe suffix are safe, even if the library is compiled without --enable-safety. */ -#if defined GNULIB_UNISTR_U8_MBTOUC_UNSAFE || HAVE_LIBUNISTRING +#if GNULIB_UNISTR_U8_MBTOUC_UNSAFE || HAVE_LIBUNISTRING # if !HAVE_INLINE extern int u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n); @@ -157,7 +157,7 @@ u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n) # endif #endif -#if defined GNULIB_UNISTR_U16_MBTOUC_UNSAFE || HAVE_LIBUNISTRING +#if GNULIB_UNISTR_U16_MBTOUC_UNSAFE || HAVE_LIBUNISTRING # if !HAVE_INLINE extern int u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n); @@ -180,7 +180,7 @@ u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n) # endif #endif -#if defined GNULIB_UNISTR_U32_MBTOUC_UNSAFE || HAVE_LIBUNISTRING +#if GNULIB_UNISTR_U32_MBTOUC_UNSAFE || HAVE_LIBUNISTRING # if !HAVE_INLINE extern int u32_mbtouc_unsafe (ucs4_t *puc, const uint32_t *s, size_t n); @@ -191,11 +191,11 @@ u32_mbtouc_unsafe (ucs4_t *puc, { uint32_t c = *s; -# ifdef CONFIG_UNICODE_SAFETY +# if CONFIG_UNICODE_SAFETY if (c < 0xd800 || (c >= 0xe000 && c < 0x110000)) # endif *puc = c; -# ifdef CONFIG_UNICODE_SAFETY +# if CONFIG_UNICODE_SAFETY else /* invalid multibyte character */ *puc = 0xfffd; @@ -205,7 +205,7 @@ u32_mbtouc_unsafe (ucs4_t *puc, # endif #endif -#if defined GNULIB_UNISTR_U8_MBTOUC || HAVE_LIBUNISTRING +#if GNULIB_UNISTR_U8_MBTOUC || HAVE_LIBUNISTRING # if !HAVE_INLINE extern int u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n); @@ -228,7 +228,7 @@ u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n) # endif #endif -#if defined GNULIB_UNISTR_U16_MBTOUC || HAVE_LIBUNISTRING +#if GNULIB_UNISTR_U16_MBTOUC || HAVE_LIBUNISTRING # if !HAVE_INLINE extern int u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n); @@ -251,7 +251,7 @@ u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n) # endif #endif -#if defined GNULIB_UNISTR_U32_MBTOUC || HAVE_LIBUNISTRING +#if GNULIB_UNISTR_U32_MBTOUC || HAVE_LIBUNISTRING # if !HAVE_INLINE extern int u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n); @@ -279,17 +279,17 @@ u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n _GL_UNUSED_PARAMETER) /* Similar to u*_mbtouc(), except that the return value gives more details about the failure, similar to mbrtowc(). */ -#if defined GNULIB_UNISTR_U8_MBTOUCR || HAVE_LIBUNISTRING +#if GNULIB_UNISTR_U8_MBTOUCR || HAVE_LIBUNISTRING extern int u8_mbtoucr (ucs4_t *puc, const uint8_t *s, size_t n); #endif -#if defined GNULIB_UNISTR_U16_MBTOUCR || HAVE_LIBUNISTRING +#if GNULIB_UNISTR_U16_MBTOUCR || HAVE_LIBUNISTRING extern int u16_mbtoucr (ucs4_t *puc, const uint16_t *s, size_t n); #endif -#if defined GNULIB_UNISTR_U32_MBTOUCR || HAVE_LIBUNISTRING +#if GNULIB_UNISTR_U32_MBTOUCR || HAVE_LIBUNISTRING extern int u32_mbtoucr (ucs4_t *puc, const uint32_t *s, size_t n); #endif @@ -300,7 +300,7 @@ extern int /* Similar to wctomb(), except that s must not be NULL, and the argument n must be specified. */ -#if defined GNULIB_UNISTR_U8_UCTOMB || HAVE_LIBUNISTRING +#if GNULIB_UNISTR_U8_UCTOMB || HAVE_LIBUNISTRING /* Auxiliary function, also used by u8_chr, u8_strchr, u8_strrchr. */ extern int u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n); @@ -322,7 +322,7 @@ u8_uctomb (uint8_t *s, ucs4_t uc, int n) # endif #endif -#if defined GNULIB_UNISTR_U16_UCTOMB || HAVE_LIBUNISTRING +#if GNULIB_UNISTR_U16_UCTOMB || HAVE_LIBUNISTRING /* Auxiliary function, also used by u16_chr, u16_strchr, u16_strrchr. */ extern int u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n); @@ -344,7 +344,7 @@ u16_uctomb (uint16_t *s, ucs4_t uc, int n) # endif #endif -#if defined GNULIB_UNISTR_U32_UCTOMB || HAVE_LIBUNISTRING +#if GNULIB_UNISTR_U32_UCTOMB || HAVE_LIBUNISTRING # if !HAVE_INLINE extern int u32_uctomb (uint32_t *s, ucs4_t uc, int n); |