summaryrefslogtreecommitdiff
path: root/gl
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-07-17 18:07:48 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-07-17 18:07:48 +0200
commit8e5417ad28fd3821e830446f2c74ccc22adde70e (patch)
treee2220f020440ebf3d225e586f330fa660773fdab /gl
parentfd27a1bfa9b26ae706265322fa6eb20bbd6a1721 (diff)
downloadgnutls-8e5417ad28fd3821e830446f2c74ccc22adde70e.tar.gz
Updated gnulib.
Diffstat (limited to 'gl')
-rw-r--r--gl/Makefile.am5
-rw-r--r--gl/alloca.in.h7
-rw-r--r--gl/argp-ba.c2
-rw-r--r--gl/argp-help.c1
-rw-r--r--gl/argp-parse.c4
-rw-r--r--gl/argp-pv.c2
-rw-r--r--gl/fseeko.c6
-rw-r--r--gl/fseterr.c2
-rw-r--r--gl/fseterr.h22
-rw-r--r--gl/fstat.c2
-rw-r--r--gl/gettext.h9
-rw-r--r--gl/m4/argp.m422
-rw-r--r--gl/m4/extensions.m44
-rw-r--r--gl/m4/fdopen.m46
-rw-r--r--gl/m4/frexp.m44
-rw-r--r--gl/m4/frexpl.m414
-rw-r--r--gl/m4/fseterr.m410
-rw-r--r--gl/m4/getopt.m4291
-rw-r--r--gl/m4/gettext.m44
-rw-r--r--gl/m4/gnulib-common.m44
-rw-r--r--gl/m4/gnulib-comp.m45
-rw-r--r--gl/m4/intdiv0.m44
-rw-r--r--gl/m4/intlmacosx.m412
-rw-r--r--gl/m4/largefile.m42
-rw-r--r--gl/m4/ldexpl.m46
-rw-r--r--gl/m4/lock.m44
-rw-r--r--gl/m4/mmap-anon.m44
-rw-r--r--gl/m4/multiarch.m44
-rw-r--r--gl/m4/nocrash.m44
-rw-r--r--gl/m4/printf-frexpl.m46
-rw-r--r--gl/m4/printf.m429
-rw-r--r--gl/m4/signbit.m44
-rw-r--r--gl/m4/stdio_h.m44
-rw-r--r--gl/m4/strerror_r.m44
-rw-r--r--gl/m4/strndup.m44
-rw-r--r--gl/m4/sys_time_h.m48
-rw-r--r--gl/m4/threadlib.m454
-rw-r--r--gl/m4/time_h.m44
-rw-r--r--gl/m4/time_r.m42
-rw-r--r--gl/m4/visibility.m44
-rw-r--r--gl/printf-parse.c2
-rw-r--r--gl/signal.in.h12
-rw-r--r--gl/stdint.in.h2
-rw-r--r--gl/stdio-impl.h4
-rw-r--r--gl/stdlib.in.h4
-rw-r--r--gl/sys_select.in.h2
-rw-r--r--gl/tests/init.sh5
-rw-r--r--gl/tests/minus-zero.h6
-rw-r--r--gl/tests/stat.c1
-rw-r--r--gl/tests/test-alloca-opt.c2
-rw-r--r--gl/tests/test-malloca.c2
-rw-r--r--gl/tests/test-select.h2
-rw-r--r--gl/tests/test-time.c2
-rw-r--r--gl/timespec.h9
-rw-r--r--gl/unistd.in.h2
-rw-r--r--gl/vasnprintf.c2
56 files changed, 358 insertions, 290 deletions
diff --git a/gl/Makefile.am b/gl/Makefile.am
index a492e6a032..eb6b6bd8c5 100644
--- a/gl/Makefile.am
+++ b/gl/Makefile.am
@@ -428,9 +428,10 @@ EXTRA_libgnu_la_SOURCES += fseeko.c
## begin gnulib module fseterr
-libgnu_la_SOURCES += fseterr.c
-EXTRA_DIST += fseterr.h stdio-impl.h
+EXTRA_DIST += fseterr.c fseterr.h stdio-impl.h
+
+EXTRA_libgnu_la_SOURCES += fseterr.c
## end gnulib module fseterr
diff --git a/gl/alloca.in.h b/gl/alloca.in.h
index e94eb68c3c..d20f4b8f1c 100644
--- a/gl/alloca.in.h
+++ b/gl/alloca.in.h
@@ -44,6 +44,13 @@
# define alloca _alloca
# elif defined __DECC && defined __VMS
# define alloca __ALLOCA
+# elif defined __TANDEM && defined _TNS_E_TARGET
+# ifdef __cplusplus
+extern "C"
+# endif
+void *_alloca (unsigned short);
+# pragma intrinsic (_alloca)
+# define alloca _alloca
# else
# include <stddef.h>
# ifdef __cplusplus
diff --git a/gl/argp-ba.c b/gl/argp-ba.c
index 0b3d0bdb04..14776770f3 100644
--- a/gl/argp-ba.c
+++ b/gl/argp-ba.c
@@ -23,7 +23,7 @@
ADDR." */
const char *argp_program_bug_address
/* This variable should be zero-initialized. On most systems, putting it into
- BSS is sufficient. Not so on MacOS X 10.3 and 10.4, see
+ BSS is sufficient. Not so on Mac OS X 10.3 and 10.4, see
<http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00329.html>
<http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00096.html>. */
#if defined __ELF__
diff --git a/gl/argp-help.c b/gl/argp-help.c
index a126acb9ba..c46703c03b 100644
--- a/gl/argp-help.c
+++ b/gl/argp-help.c
@@ -29,6 +29,7 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <assert.h>
#include <stdarg.h>
#include <ctype.h>
diff --git a/gl/argp-parse.c b/gl/argp-parse.c
index 3b411d407b..6bbb14578b 100644
--- a/gl/argp-parse.c
+++ b/gl/argp-parse.c
@@ -880,11 +880,11 @@ __argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags,
#ifndef _LIBC
if (!(flags & ARGP_PARSE_ARGV0))
{
-#ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
+#if HAVE_DECL_PROGRAM_INVOCATION_NAME
if (!program_invocation_name)
program_invocation_name = argv[0];
#endif
-#ifdef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
if (!program_invocation_short_name)
program_invocation_short_name = __argp_base_name (argv[0]);
#endif
diff --git a/gl/argp-pv.c b/gl/argp-pv.c
index 1d5a010c9b..a615e7ab74 100644
--- a/gl/argp-pv.c
+++ b/gl/argp-pv.c
@@ -23,7 +23,7 @@
ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
const char *argp_program_version
/* This variable should be zero-initialized. On most systems, putting it into
- BSS is sufficient. Not so on MacOS X 10.3 and 10.4, see
+ BSS is sufficient. Not so on Mac OS X 10.3 and 10.4, see
<http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00329.html>
<http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00096.html>. */
#if defined __ELF__
diff --git a/gl/fseeko.c b/gl/fseeko.c
index c372a5c142..7364f7ffef 100644
--- a/gl/fseeko.c
+++ b/gl/fseeko.c
@@ -51,7 +51,7 @@ fseeko (FILE *fp, off_t offset, int whence)
if (fp->_IO_read_end == fp->_IO_read_ptr
&& fp->_IO_write_ptr == fp->_IO_write_base
&& fp->_IO_save_base == NULL)
-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
+#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
# if defined __SL64 && defined __SCLE /* Cygwin */
if ((fp->_flags & __SL64) == 0)
{
@@ -109,7 +109,7 @@ fseeko (FILE *fp, off_t offset, int whence)
off_t pos = lseek (fileno (fp), offset, whence);
if (pos == -1)
{
-#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
+#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
fp_->_flags &= ~__SOFF;
#endif
return -1;
@@ -118,7 +118,7 @@ fseeko (FILE *fp, off_t offset, int whence)
#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_flags &= ~_IO_EOF_SEEN;
fp->_offset = pos;
-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
+#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
# if defined __CYGWIN__
/* fp_->_offset is typed as an integer. */
fp_->_offset = pos;
diff --git a/gl/fseterr.c b/gl/fseterr.c
index 78791af3dc..4273a467b2 100644
--- a/gl/fseterr.c
+++ b/gl/fseterr.c
@@ -31,7 +31,7 @@ fseterr (FILE *fp)
fast macros. */
#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
fp->_flags |= _IO_ERR_SEEN;
-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
+#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
fp_->_flags |= __SERR;
#elif defined __EMX__ /* emx+gcc */
fp->_flags |= _IOERR;
diff --git a/gl/fseterr.h b/gl/fseterr.h
index b3930c5a88..16a1afeeae 100644
--- a/gl/fseterr.h
+++ b/gl/fseterr.h
@@ -19,19 +19,27 @@
#include <stdio.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
/* Set the error indicator of the stream FP.
The "error indicator" is set when an I/O operation on the stream fails, and
is cleared (together with the "end-of-file" indicator) by clearerr (FP). */
-extern void fseterr (FILE *fp);
+#if HAVE___FSETERR /* musl libc */
+
+# include <stdio_ext.h>
+# define fseterr(fp) __fseterr (fp)
-#ifdef __cplusplus
+#else
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+extern void fseterr (FILE *fp);
+
+# ifdef __cplusplus
}
+# endif
+
#endif
#endif /* _FSETERR_H */
diff --git a/gl/fstat.c b/gl/fstat.c
index ac2b1effe3..6d5f5c2b6f 100644
--- a/gl/fstat.c
+++ b/gl/fstat.c
@@ -24,7 +24,9 @@
#include <sys/types.h>
#include <sys/stat.h>
#if _GL_WINDOWS_64_BIT_ST_SIZE
+# undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
# define stat _stati64
+# undef fstat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
# define fstat _fstati64
#endif
#undef __need_system_sys_stat_h
diff --git a/gl/gettext.h b/gl/gettext.h
index 75875cdb0f..65ca1e6762 100644
--- a/gl/gettext.h
+++ b/gl/gettext.h
@@ -183,9 +183,12 @@ npgettext_aux (const char *domain,
#include <string.h>
-#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
- (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
- /* || __STDC_VERSION__ >= 199901L */ )
+#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
+ /* || __STDC_VERSION__ >= 199901L */ )
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
+#else
+# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0
+#endif
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
#include <stdlib.h>
diff --git a/gl/m4/argp.m4 b/gl/m4/argp.m4
index 87c7da68a9..0d1de3abdf 100644
--- a/gl/m4/argp.m4
+++ b/gl/m4/argp.m4
@@ -1,4 +1,4 @@
-# argp.m4 serial 13
+# argp.m4 serial 14
dnl Copyright (C) 2003-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -10,18 +10,14 @@ AC_DEFUN([gl_ARGP],
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
- AC_CHECK_DECL([program_invocation_name],
- [AC_DEFINE([HAVE_DECL_PROGRAM_INVOCATION_NAME], [1],
- [Define if program_invocation_name is declared])],
- [AC_DEFINE([GNULIB_PROGRAM_INVOCATION_NAME], [1],
- [Define to 1 to add extern declaration of program_invocation_name to argp.h])],
- [[#include <errno.h>]])
- AC_CHECK_DECL([program_invocation_short_name],
- [AC_DEFINE([HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME], [1],
- [Define if program_invocation_short_name is declared])],
- [AC_DEFINE([GNULIB_PROGRAM_INVOCATION_SHORT_NAME], [1],
- [Define to 1 to add extern declaration of program_invocation_short_name to argp.h])],
- [[#include <errno.h>]])
+ AC_CHECK_DECLS([program_invocation_name], [],
+ [AC_DEFINE([GNULIB_PROGRAM_INVOCATION_NAME], [1],
+ [Define to 1 to add extern declaration of program_invocation_name to argp.h])],
+ [[#include <errno.h>]])
+ AC_CHECK_DECLS([program_invocation_short_name], [],
+ [AC_DEFINE([GNULIB_PROGRAM_INVOCATION_SHORT_NAME], [1],
+ [Define to 1 to add extern declaration of program_invocation_short_name to argp.h])],
+ [[#include <errno.h>]])
# Check if program_invocation_name and program_invocation_short_name
# are defined elsewhere. It is improbable that only one of them will
diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4
index 0bfaef6f90..6d17d8a748 100644
--- a/gl/m4/extensions.m4
+++ b/gl/m4/extensions.m4
@@ -1,4 +1,4 @@
-# serial 11 -*- Autoconf -*-
+# serial 12 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
# Copyright (C) 2003, 2006-2012 Free Software Foundation, Inc.
@@ -67,7 +67,7 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
-/* Enable general extensions on MacOS X. */
+/* Enable general extensions on Mac OS X. */
#ifndef _DARWIN_C_SOURCE
# undef _DARWIN_C_SOURCE
#endif
diff --git a/gl/m4/fdopen.m4 b/gl/m4/fdopen.m4
index 9ca9d2aca6..14f15540c7 100644
--- a/gl/m4/fdopen.m4
+++ b/gl/m4/fdopen.m4
@@ -1,4 +1,4 @@
-# fdopen.m4 serial 2
+# fdopen.m4 serial 3
dnl Copyright (C) 2011-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -25,10 +25,8 @@ main (void)
FILE *fp;
errno = 0;
fp = fdopen (-1, "r");
- if (fp != NULL)
+ if (fp == NULL && errno == 0)
return 1;
- if (errno == 0)
- return 2;
return 0;
}]])],
[gl_cv_func_fdopen_works=yes],
diff --git a/gl/m4/frexp.m4 b/gl/m4/frexp.m4
index 4162195e53..fb8db7046e 100644
--- a/gl/m4/frexp.m4
+++ b/gl/m4/frexp.m4
@@ -1,4 +1,4 @@
-# frexp.m4 serial 13
+# frexp.m4 serial 14
dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -107,7 +107,7 @@ AC_DEFUN([gl_FUNC_FREXP_WORKS],
/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
ICC 10.0 has a bug when optimizing the expression -zero.
The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
- to PowerPC on MacOS X 10.5. */
+ to PowerPC on Mac OS X 10.5. */
#if defined __hpux || defined __sgi || defined __ICC
static double
compute_minus_zero (void)
diff --git a/gl/m4/frexpl.m4 b/gl/m4/frexpl.m4
index 9df87ab82f..774d540fd9 100644
--- a/gl/m4/frexpl.m4
+++ b/gl/m4/frexpl.m4
@@ -1,4 +1,4 @@
-# frexpl.m4 serial 19
+# frexpl.m4 serial 20
dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_FREXPL],
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
dnl Check whether it's declared.
- dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
+ dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
FREXPL_LIBM=
@@ -73,7 +73,7 @@ AC_DEFUN([gl_FUNC_FREXPL_NO_LIBM],
AC_REQUIRE([gl_MATH_H_DEFAULTS])
AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
dnl Check whether it's declared.
- dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
+ dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
if test $HAVE_DECL_FREXPL = 1; then
gl_CHECK_FREXPL_NO_LIBM
@@ -113,8 +113,8 @@ AC_DEFUN([gl_CHECK_FREXPL_NO_LIBM],
])
dnl Test whether frexpl() works on finite numbers (this fails on
-dnl MacOS X 10.4/PowerPC, on AIX 5.1, and on BeOS), on denormalized numbers
-dnl (this fails on MacOS X 10.5/i386), and also on infinite numbers (this
+dnl Mac OS X 10.4/PowerPC, on AIX 5.1, and on BeOS), on denormalized numbers
+dnl (this fails on Mac OS X 10.5/i386), and also on infinite numbers (this
dnl fails e.g. on IRIX 6.5 and mingw).
AC_DEFUN([gl_FUNC_FREXPL_WORKS],
[
@@ -162,7 +162,7 @@ int main()
if (exp != 5)
result |= 1;
}
- /* Test on finite numbers that fails on MacOS X 10.4, because its frexpl
+ /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
function returns an invalid (incorrectly normalized) value: it returns
y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
but the correct result is
@@ -201,7 +201,7 @@ int main()
int exp;
long double y = frexpl (x, &exp);
/* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
- exp = -16382, y = 0.5. On MacOS X 10.5: exp = -16384, y = 0.5. */
+ exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */
if (exp != LDBL_MIN_EXP - 1)
result |= 8;
}
diff --git a/gl/m4/fseterr.m4 b/gl/m4/fseterr.m4
new file mode 100644
index 0000000000..3eb3197f84
--- /dev/null
+++ b/gl/m4/fseterr.m4
@@ -0,0 +1,10 @@
+# fseterr.m4 serial 1
+dnl Copyright (C) 2012 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FSETERR],
+[
+ AC_CHECK_FUNCS_ONCE([__fseterr])
+])
diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4
index 2aea89595e..f6902b5859 100644
--- a/gl/m4/getopt.m4
+++ b/gl/m4/getopt.m4
@@ -1,4 +1,4 @@
-# getopt.m4 serial 39
+# getopt.m4 serial 44
dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -9,18 +9,17 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX],
[
m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX])
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
dnl Other modules can request the gnulib implementation of the getopt
dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS.
dnl argp.m4 does this.
m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [
- gl_GETOPT_IFELSE([], [])
REPLACE_GETOPT=1
], [
REPLACE_GETOPT=0
- gl_GETOPT_IFELSE([
+ if test -n "$gl_replace_getopt"; then
REPLACE_GETOPT=1
- ],
- [])
+ fi
])
if test $REPLACE_GETOPT = 1; then
dnl Arrange for getopt.h to be created.
@@ -38,13 +37,6 @@ AC_DEFUN([gl_FUNC_GETOPT_GNU],
AC_REQUIRE([gl_FUNC_GETOPT_POSIX])
])
-# emacs' configure.in uses this.
-AC_DEFUN([gl_GETOPT_IFELSE],
-[
- AC_REQUIRE([gl_GETOPT_CHECK_HEADERS])
- AS_IF([test -n "$gl_replace_getopt"], [$1], [$2])
-])
-
# Determine whether to replace the entire getopt facility.
AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
[
@@ -74,11 +66,6 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
AC_CHECK_FUNCS([getopt_long_only], [], [gl_replace_getopt=yes])
fi
- dnl mingw's getopt (in libmingwex.a) does weird things when the options
- dnl strings starts with '+' and it's not the first call. Some internal state
- dnl is left over from earlier calls, and neither setting optind = 0 nor
- dnl setting optreset = 1 get rid of this internal state.
- dnl POSIX is silent on optind vs. optreset, so we allow either behavior.
dnl POSIX 2008 does not specify leading '+' behavior, but see
dnl http://austingroupbugs.net/view.php?id=191 for a recommendation on
dnl the next version of POSIX. For now, we only guarantee leading '+'
@@ -87,30 +74,16 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
AC_CACHE_CHECK([whether getopt is POSIX compatible],
[gl_cv_func_getopt_posix],
[
- dnl BSD getopt_long uses an incompatible method to reset option
- dnl processing. Existence of the optreset variable, in and of
- dnl itself, is not a reason to replace getopt, but knowledge
- dnl of the variable is needed to determine how to reset and
- dnl whether a reset reparses the environment. Solaris
- dnl supports neither optreset nor optind=0, but keeps no state
- dnl that needs a reset beyond setting optind=1; detect Solaris
- dnl by getopt_clip.
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <unistd.h>]],
- [[int *p = &optreset; return optreset;]])],
- [gl_optind_min=1],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <getopt.h>]],
- [[return !getopt_clip;]])],
- [gl_optind_min=1],
- [gl_optind_min=0])])
-
- dnl This test fails on mingw and succeeds on many other platforms.
- gl_save_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -DOPTIND_MIN=$gl_optind_min"
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ dnl Merging these three different test programs into a single one
+ dnl would require a reset mechanism. On BSD systems, it can be done
+ dnl through 'optreset'; on some others (glibc), it can be done by
+ dnl setting 'optind' to 0; on others again (HP-UX, IRIX, OSF/1,
+ dnl Solaris 9, musl libc), there is no such mechanism.
+ if test $cross_compiling = no; then
+ dnl Sanity check. Succeeds everywhere (except on MSVC,
+ dnl which lacks <unistd.h> and getopt() entirely).
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
@@ -118,89 +91,107 @@ AC_DEFUN([gl_GETOPT_CHECK_HEADERS],
int
main ()
{
- {
- static char program[] = "program";
- static char a[] = "-a";
- static char foo[] = "foo";
- static char bar[] = "bar";
- char *argv[] = { program, a, foo, bar, NULL };
- int c;
+ static char program[] = "program";
+ static char a[] = "-a";
+ static char foo[] = "foo";
+ static char bar[] = "bar";
+ char *argv[] = { program, a, foo, bar, NULL };
+ int c;
- optind = OPTIND_MIN;
- opterr = 0;
-
- c = getopt (4, argv, "ab");
- if (!(c == 'a'))
- return 1;
- c = getopt (4, argv, "ab");
- if (!(c == -1))
- return 2;
- if (!(optind == 2))
- return 3;
- }
- /* Some internal state exists at this point. */
- {
- static char program[] = "program";
- static char donald[] = "donald";
- static char p[] = "-p";
- static char billy[] = "billy";
- static char duck[] = "duck";
- static char a[] = "-a";
- static char bar[] = "bar";
- char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
- int c;
+ c = getopt (4, argv, "ab");
+ if (!(c == 'a'))
+ return 1;
+ c = getopt (4, argv, "ab");
+ if (!(c == -1))
+ return 2;
+ if (!(optind == 2))
+ return 3;
+ return 0;
+}
+]])],
+ [gl_cv_func_getopt_posix=maybe],
+ [gl_cv_func_getopt_posix=no])
+ if test $gl_cv_func_getopt_posix = maybe; then
+ dnl Sanity check with '+'. Succeeds everywhere (except on MSVC,
+ dnl which lacks <unistd.h> and getopt() entirely).
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
- optind = OPTIND_MIN;
- opterr = 0;
+int
+main ()
+{
+ static char program[] = "program";
+ static char donald[] = "donald";
+ static char p[] = "-p";
+ static char billy[] = "billy";
+ static char duck[] = "duck";
+ static char a[] = "-a";
+ static char bar[] = "bar";
+ char *argv[] = { program, donald, p, billy, duck, a, bar, NULL };
+ int c;
- c = getopt (7, argv, "+abp:q:");
- if (!(c == -1))
- return 4;
- if (!(strcmp (argv[0], "program") == 0))
- return 5;
- if (!(strcmp (argv[1], "donald") == 0))
- return 6;
- if (!(strcmp (argv[2], "-p") == 0))
- return 7;
- if (!(strcmp (argv[3], "billy") == 0))
- return 8;
- if (!(strcmp (argv[4], "duck") == 0))
- return 9;
- if (!(strcmp (argv[5], "-a") == 0))
- return 10;
- if (!(strcmp (argv[6], "bar") == 0))
- return 11;
- if (!(optind == 1))
- return 12;
- }
- /* Detect MacOS 10.5, AIX 7.1 bug. */
- {
- static char program[] = "program";
- static char ab[] = "-ab";
- char *argv[3] = { program, ab, NULL };
- optind = OPTIND_MIN;
- opterr = 0;
- if (getopt (2, argv, "ab:") != 'a')
- return 13;
- if (getopt (2, argv, "ab:") != '?')
- return 14;
- if (optopt != 'b')
- return 15;
- if (optind != 2)
- return 16;
- }
+ c = getopt (7, argv, "+abp:q:");
+ if (!(c == -1))
+ return 4;
+ if (!(strcmp (argv[0], "program") == 0))
+ return 5;
+ if (!(strcmp (argv[1], "donald") == 0))
+ return 6;
+ if (!(strcmp (argv[2], "-p") == 0))
+ return 7;
+ if (!(strcmp (argv[3], "billy") == 0))
+ return 8;
+ if (!(strcmp (argv[4], "duck") == 0))
+ return 9;
+ if (!(strcmp (argv[5], "-a") == 0))
+ return 10;
+ if (!(strcmp (argv[6], "bar") == 0))
+ return 11;
+ if (!(optind == 1))
+ return 12;
+ return 0;
+}
+]])],
+ [gl_cv_func_getopt_posix=maybe],
+ [gl_cv_func_getopt_posix=no])
+ fi
+ if test $gl_cv_func_getopt_posix = maybe; then
+ dnl Detect Mac OS X 10.5, AIX 7.1, mingw bug.
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+int
+main ()
+{
+ static char program[] = "program";
+ static char ab[] = "-ab";
+ char *argv[3] = { program, ab, NULL };
+ if (getopt (2, argv, "ab:") != 'a')
+ return 13;
+ if (getopt (2, argv, "ab:") != '?')
+ return 14;
+ if (optopt != 'b')
+ return 15;
+ if (optind != 2)
+ return 16;
return 0;
}
]])],
- [gl_cv_func_getopt_posix=yes], [gl_cv_func_getopt_posix=no],
- [case "$host_os" in
- mingw*) gl_cv_func_getopt_posix="guessing no";;
- darwin* | aix*) gl_cv_func_getopt_posix="guessing no";;
- *) gl_cv_func_getopt_posix="guessing yes";;
- esac
- ])
- CPPFLAGS=$gl_save_CPPFLAGS
+ [gl_cv_func_getopt_posix=yes],
+ [gl_cv_func_getopt_posix=no])
+ fi
+ else
+ case "$host_os" in
+ darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";;
+ *) gl_cv_func_getopt_posix="guessing yes";;
+ esac
+ fi
])
case "$gl_cv_func_getopt_posix" in
*no) gl_replace_getopt=yes ;;
@@ -236,7 +227,7 @@ dnl is ambiguous with environment values that contain newlines.
nocrash_init();
/* This code succeeds on glibc 2.8, OpenBSD 4.0, Cygwin, mingw,
- and fails on MacOS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
+ and fails on Mac OS X 10.5, AIX 5.2, HP-UX 11, IRIX 6.5,
OSF/1 5.1, Solaris 10. */
{
static char conftest[] = "conftest";
@@ -247,7 +238,7 @@ dnl is ambiguous with environment values that contain newlines.
result |= 1;
}
/* This code succeeds on glibc 2.8, mingw,
- and fails on MacOS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
+ and fails on Mac OS X 10.5, OpenBSD 4.0, AIX 5.2, HP-UX 11,
IRIX 6.5, OSF/1 5.1, Solaris 10, Cygwin 1.5.x. */
{
static char program[] = "program";
@@ -276,7 +267,7 @@ dnl is ambiguous with environment values that contain newlines.
if (getopt (3, argv, "-p") != 1)
result |= 16;
else if (getopt (3, argv, "-p") != 'p')
- result |= 32;
+ result |= 16;
}
/* This code fails on glibc 2.11. */
{
@@ -286,9 +277,9 @@ dnl is ambiguous with environment values that contain newlines.
char *argv[] = { program, b, a, NULL };
optind = opterr = 0;
if (getopt (3, argv, "+:a:b") != 'b')
- result |= 64;
+ result |= 32;
else if (getopt (3, argv, "+:a:b") != ':')
- result |= 64;
+ result |= 32;
}
/* This code dumps core on glibc 2.14. */
{
@@ -298,18 +289,14 @@ dnl is ambiguous with environment values that contain newlines.
char *argv[] = { program, w, dummy, NULL };
optind = opterr = 1;
if (getopt (3, argv, "W;") != 'W')
- result |= 128;
+ result |= 64;
}
return result;
]])],
[gl_cv_func_getopt_gnu=yes],
[gl_cv_func_getopt_gnu=no],
- [dnl Cross compiling. Guess based on host and declarations.
- case $host_os:$ac_cv_have_decl_optreset in
- *-gnu*:* | mingw*:*) gl_cv_func_getopt_gnu=no;;
- *:yes) gl_cv_func_getopt_gnu=no;;
- *) gl_cv_func_getopt_gnu=yes;;
- esac
+ [dnl Cross compiling. Assume the worst, even on glibc platforms.
+ gl_cv_func_getopt_gnu="guessing no"
])
case $gl_had_POSIXLY_CORRECT in
exported) ;;
@@ -317,13 +304,54 @@ dnl is ambiguous with environment values that contain newlines.
*) AS_UNSET([POSIXLY_CORRECT]) ;;
esac
])
- if test "$gl_cv_func_getopt_gnu" = "no"; then
+ if test "$gl_cv_func_getopt_gnu" != yes; then
gl_replace_getopt=yes
+ else
+ AC_CACHE_CHECK([for working GNU getopt_long function],
+ [gl_cv_func_getopt_long_gnu],
+ [AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <getopt.h>
+ #include <stddef.h>
+ #include <string.h>
+ ]],
+ [[static const struct option long_options[] =
+ {
+ { "xtremely-",no_argument, NULL, 1003 },
+ { "xtra", no_argument, NULL, 1001 },
+ { "xtreme", no_argument, NULL, 1002 },
+ { "xtremely", no_argument, NULL, 1003 },
+ { NULL, 0, NULL, 0 }
+ };
+ /* This code fails on OpenBSD 5.0. */
+ {
+ static char program[] = "program";
+ static char xtremel[] = "--xtremel";
+ char *argv[] = { program, xtremel, NULL };
+ int option_index;
+ optind = 1; opterr = 0;
+ if (getopt_long (2, argv, "", long_options, &option_index) != 1003)
+ return 1;
+ }
+ return 0;
+ ]])],
+ [gl_cv_func_getopt_long_gnu=yes],
+ [gl_cv_func_getopt_long_gnu=no],
+ [dnl Cross compiling. Guess no on OpenBSD, yes otherwise.
+ case "$host_os" in
+ openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
+ *) gl_cv_func_getopt_long_gnu="guessing yes";;
+ esac
+ ])
+ ])
+ case "$gl_cv_func_getopt_long_gnu" in
+ *yes) ;;
+ *) gl_replace_getopt=yes ;;
+ esac
fi
fi
])
-# emacs' configure.in uses this.
AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
[
GETOPT_H=getopt.h
@@ -334,7 +362,6 @@ AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
])
# Prerequisites of lib/getopt*.
-# emacs' configure.in uses this.
AC_DEFUN([gl_PREREQ_GETOPT],
[
AC_CHECK_DECLS_ONCE([getenv])
diff --git a/gl/m4/gettext.m4 b/gl/m4/gettext.m4
index 5415f88ef0..017d025201 100644
--- a/gl/m4/gettext.m4
+++ b/gl/m4/gettext.m4
@@ -1,4 +1,4 @@
-# gettext.m4 serial 64 (gettext-0.18.2)
+# gettext.m4 serial 66 (gettext-0.18.2)
dnl Copyright (C) 1995-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -97,7 +97,7 @@ AC_DEFUN([AM_GNU_GETTEXT],
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
])
- dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
+ dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
gt_INTL_MACOSX
dnl Set USE_NLS.
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index d62b7677ab..15d2b2b3de 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 32
+# gnulib-common.m4 serial 33
dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -30,7 +30,7 @@ AC_DEFUN([gl_COMMON_BODY], [
[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
- __APPLE__ && __MACH__ test for MacOS X.
+ __APPLE__ && __MACH__ test for Mac OS X.
__APPLE_CC__ tests for the Apple compiler and its version.
__STDC_VERSION__ tests for the C99 mode. */
#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 4d134505cb..aad1024c14 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -450,6 +450,10 @@ if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
gl_PREREQ_FSEEKO
fi
gl_STDIO_MODULE_INDICATOR([fseeko])
+gl_FUNC_FSETERR
+if test $ac_cv_func___fseterr = no; then
+ AC_LIBOBJ([fseterr])
+fi
gl_FUNC_FSTAT
if test $REPLACE_FSTAT = 1; then
AC_LIBOBJ([fstat])
@@ -1333,6 +1337,7 @@ AC_DEFUN([gl_FILE_LIST], [
m4/frexpl.m4
m4/fseek.m4
m4/fseeko.m4
+ m4/fseterr.m4
m4/fstat.m4
m4/ftell.m4
m4/ftello.m4
diff --git a/gl/m4/intdiv0.m4 b/gl/m4/intdiv0.m4
index 6d89aebed4..55bef60505 100644
--- a/gl/m4/intdiv0.m4
+++ b/gl/m4/intdiv0.m4
@@ -1,4 +1,4 @@
-# intdiv0.m4 serial 5 (gettext-0.18.2)
+# intdiv0.m4 serial 6 (gettext-0.18.2)
dnl Copyright (C) 2002, 2007-2008, 2010-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,7 @@ AC_DEFUN([gt_INTDIV0],
changequote(,)dnl
case "$host_os" in
macos* | darwin[6-9]* | darwin[1-9][0-9]*)
- # On MacOS X 10.2 or newer, just assume the same as when cross-
+ # On Mac OS X 10.2 or newer, just assume the same as when cross-
# compiling. If we were to perform the real test, 1 Crash Report
# dialog window would pop up.
case "$host_cpu" in
diff --git a/gl/m4/intlmacosx.m4 b/gl/m4/intlmacosx.m4
index dc2ddfedfc..d4da19040f 100644
--- a/gl/m4/intlmacosx.m4
+++ b/gl/m4/intlmacosx.m4
@@ -1,4 +1,4 @@
-# intlmacosx.m4 serial 4 (gettext-0.18.2)
+# intlmacosx.m4 serial 5 (gettext-0.18.2)
dnl Copyright (C) 2004-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -13,11 +13,11 @@ dnl by the GNU Library General Public License, and the rest of the GNU
dnl gettext package package is covered by the GNU General Public License.
dnl They are *not* in the public domain.
-dnl Checks for special options needed on MacOS X.
+dnl Checks for special options needed on Mac OS X.
dnl Defines INTL_MACOSX_LIBS.
AC_DEFUN([gt_INTL_MACOSX],
[
- dnl Check for API introduced in MacOS X 10.2.
+ dnl Check for API introduced in Mac OS X 10.2.
AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
[gt_cv_func_CFPreferencesCopyAppValue],
[gt_save_LIBS="$LIBS"
@@ -31,9 +31,9 @@ AC_DEFUN([gt_INTL_MACOSX],
LIBS="$gt_save_LIBS"])
if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
- [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
+ [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
fi
- dnl Check for API introduced in MacOS X 10.3.
+ dnl Check for API introduced in Mac OS X 10.3.
AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
[gt_save_LIBS="$LIBS"
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
@@ -46,7 +46,7 @@ AC_DEFUN([gt_INTL_MACOSX],
LIBS="$gt_save_LIBS"])
if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
- [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
+ [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
fi
INTL_MACOSX_LIBS=
if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
diff --git a/gl/m4/largefile.m4 b/gl/m4/largefile.m4
index a159f4ab2c..a88850afed 100644
--- a/gl/m4/largefile.m4
+++ b/gl/m4/largefile.m4
@@ -136,7 +136,7 @@ AC_DEFUN([gl_LARGEFILE],
*)
dnl Nothing to do on gnulib's side.
dnl A 64-bit off_t is
- dnl - already the default on MacOS X, FreeBSD, NetBSD, OpenBSD, IRIX,
+ dnl - already the default on Mac OS X, FreeBSD, NetBSD, OpenBSD, IRIX,
dnl OSF/1, Cygwin,
dnl - enabled by _FILE_OFFSET_BITS=64 (ensured by AC_SYS_LARGEFILE) on
dnl glibc, HP-UX, Solaris,
diff --git a/gl/m4/ldexpl.m4 b/gl/m4/ldexpl.m4
index 11f20ca2a8..6ecdd4f76a 100644
--- a/gl/m4/ldexpl.m4
+++ b/gl/m4/ldexpl.m4
@@ -1,4 +1,4 @@
-# ldexpl.m4 serial 15
+# ldexpl.m4 serial 16
dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,7 @@ AC_DEFUN([gl_FUNC_LDEXPL],
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
dnl Check whether it's declared.
- dnl MacOS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
+ dnl Mac OS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include <math.h>]])
LDEXPL_LIBM=
@@ -87,7 +87,7 @@ AC_DEFUN([gl_CHECK_LDEXPL_NO_LIBM],
])
dnl Test whether ldexpl() works on finite numbers (this fails on AIX 5.1
-dnl and MacOS X 10.4/PowerPC).
+dnl and Mac OS X 10.4/PowerPC).
AC_DEFUN([gl_FUNC_LDEXPL_WORKS],
[
AC_REQUIRE([AC_PROG_CC])
diff --git a/gl/m4/lock.m4 b/gl/m4/lock.m4
index c0a620600a..19c6d459f1 100644
--- a/gl/m4/lock.m4
+++ b/gl/m4/lock.m4
@@ -1,4 +1,4 @@
-# lock.m4 serial 11 (gettext-0.18.2)
+# lock.m4 serial 12 (gettext-0.18.2)
dnl Copyright (C) 2005-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -10,7 +10,7 @@ AC_DEFUN([gl_LOCK],
[
AC_REQUIRE([gl_THREADLIB])
if test "$gl_threads_api" = posix; then
- # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
+ # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
# pthread_rwlock_* functions.
AC_CHECK_TYPE([pthread_rwlock_t],
[AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
diff --git a/gl/m4/mmap-anon.m4 b/gl/m4/mmap-anon.m4
index 579323f15a..748b17d97a 100644
--- a/gl/m4/mmap-anon.m4
+++ b/gl/m4/mmap-anon.m4
@@ -1,4 +1,4 @@
-# mmap-anon.m4 serial 9
+# mmap-anon.m4 serial 10
dnl Copyright (C) 2005, 2007, 2009-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -9,7 +9,7 @@ dnl with or without modifications, as long as this notice is preserved.
# - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS
# and MAP_ANON exist and have the same value.
# - On HP-UX, only MAP_ANONYMOUS exists.
-# - On MacOS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists.
+# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists.
# - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be
# used.
diff --git a/gl/m4/multiarch.m4 b/gl/m4/multiarch.m4
index b424dce652..0c288b8d2a 100644
--- a/gl/m4/multiarch.m4
+++ b/gl/m4/multiarch.m4
@@ -1,4 +1,4 @@
-# multiarch.m4 serial 6
+# multiarch.m4 serial 7
dnl Copyright (C) 2008-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -6,7 +6,7 @@ dnl with or without modifications, as long as this notice is preserved.
# Determine whether the compiler is or may be producing universal binaries.
#
-# On MacOS X 10.5 and later systems, the user can create libraries and
+# On Mac OS X 10.5 and later systems, the user can create libraries and
# executables that work on multiple system types--known as "fat" or
# "universal" binaries--by specifying multiple '-arch' options to the
# compiler but only a single '-arch' option to the preprocessor. Like
diff --git a/gl/m4/nocrash.m4 b/gl/m4/nocrash.m4
index 08ef825499..c2638df626 100644
--- a/gl/m4/nocrash.m4
+++ b/gl/m4/nocrash.m4
@@ -1,4 +1,4 @@
-# nocrash.m4 serial 3
+# nocrash.m4 serial 4
dnl Copyright (C) 2005, 2009-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,7 @@ dnl int main() { nocrash_init(); ... }
AC_DEFUN([GL_NOCRASH],[[
#include <stdlib.h>
#if defined __MACH__ && defined __APPLE__
-/* Avoid a crash on MacOS X. */
+/* Avoid a crash on Mac OS X. */
#include <mach/mach.h>
#include <mach/mach_error.h>
#include <mach/thread_status.h>
diff --git a/gl/m4/printf-frexpl.m4 b/gl/m4/printf-frexpl.m4
index 55dd6bc18e..c960a49c60 100644
--- a/gl/m4/printf-frexpl.m4
+++ b/gl/m4/printf-frexpl.m4
@@ -1,4 +1,4 @@
-# printf-frexpl.m4 serial 9
+# printf-frexpl.m4 serial 10
dnl Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -28,7 +28,7 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
AC_DEFINE([HAVE_FREXPL_IN_LIBC], [1],
[Define if the frexpl function is available in libc.])
dnl Also check whether it's declared.
- dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
+ dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
fi
@@ -40,7 +40,7 @@ AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
AC_DEFINE([HAVE_LDEXPL_IN_LIBC], [1],
[Define if the ldexpl function is available in libc.])
dnl Also check whether it's declared.
- dnl MacOS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
+ dnl Mac OS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include <math.h>]])
;;
esac
diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4
index d75aca0742..751e8966fd 100644
--- a/gl/m4/printf.m4
+++ b/gl/m4/printf.m4
@@ -1,4 +1,4 @@
-# printf.m4 serial 48
+# printf.m4 serial 50
dnl Copyright (C) 2003, 2007-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -63,7 +63,7 @@ changequote(,)dnl
# Guess yes on FreeBSD >= 5.
freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
- # Guess yes on MacOS X >= 10.3.
+ # Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";;
darwin*) gl_cv_func_printf_sizes_c99="guessing yes";;
# Guess yes on OpenBSD >= 3.9.
@@ -222,7 +222,7 @@ changequote(,)dnl
# Guess yes on FreeBSD >= 6.
freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
- # Guess yes on MacOS X >= 10.3.
+ # Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";;
darwin*) gl_cv_func_printf_infinite="guessing yes";;
# Guess yes on HP-UX >= 11.
@@ -507,14 +507,14 @@ int main ()
if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
|| buf[0] == '0')
result |= 8;
- /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug. */
+ /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug. */
if (sprintf (buf, "%.1a", 1.999) < 0
|| (strcmp (buf, "0x1.0p+1") != 0
&& strcmp (buf, "0x2.0p+0") != 0
&& strcmp (buf, "0x4.0p-1") != 0
&& strcmp (buf, "0x8.0p-2") != 0))
result |= 16;
- /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a
+ /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a
glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
if (sprintf (buf, "%.1La", 1.999L) < 0
|| (strcmp (buf, "0x1.0p+1") != 0
@@ -590,7 +590,7 @@ changequote(,)dnl
# Guess yes on FreeBSD >= 6.
freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
- # Guess yes on MacOS X >= 10.3.
+ # Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";;
darwin*) gl_cv_func_printf_directive_f="guessing yes";;
# Guess yes on Solaris >= 2.10.
@@ -1028,8 +1028,9 @@ int main()
changequote([,])dnl
])])
if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
- (./conftest
+ (./conftest 2>&AS_MESSAGE_LOG_FD
result=$?
+ _AS_ECHO_LOG([\$? = $result])
if test $result != 0 && test $result != 77; then result=1; fi
exit $result
) >/dev/null 2>/dev/null
@@ -1043,7 +1044,7 @@ changequote([,])dnl
fi
rm -fr conftest*
else
- dnl A universal build on Apple MacOS X platforms.
+ dnl A universal build on Apple Mac OS X platforms.
dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode.
dnl But we need a configuration result that is valid in both modes.
gl_cv_func_printf_enomem="guessing no"
@@ -1137,7 +1138,7 @@ changequote(,)dnl
# Guess yes on FreeBSD >= 5.
freebsd[1-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
- # Guess yes on MacOS X >= 10.3.
+ # Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
# Guess yes on OpenBSD >= 3.9.
@@ -1236,7 +1237,7 @@ changequote(,)dnl
# Guess yes on FreeBSD >= 5.
freebsd[1-4]*) gl_cv_func_snprintf_retval_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
- # Guess yes on MacOS X >= 10.3.
+ # Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";;
darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";;
# Guess yes on OpenBSD >= 3.9.
@@ -1317,7 +1318,7 @@ changequote(,)dnl
# Guess yes on FreeBSD >= 5.
freebsd[1-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
- # Guess yes on MacOS X >= 10.3.
+ # Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";;
darwin*) gl_cv_func_snprintf_directive_n="guessing yes";;
# Guess yes on Solaris >= 2.6.
@@ -1459,7 +1460,7 @@ changequote(,)dnl
# Guess yes on FreeBSD >= 5.
freebsd[1-4]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
- # Guess yes on MacOS X >= 10.3.
+ # Guess yes on Mac OS X >= 10.3.
darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
# Guess yes on Cygwin.
@@ -1539,8 +1540,8 @@ dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . .
dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . .
dnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . .
-dnl MacOS X 10.5.8 . . . # # . . . . . . # . . . . . . . .
-dnl MacOS X 10.3.9 . . . . # . . . . . . # . # . . . . . .
+dnl Mac OS X 10.5.8 . . . # # . . . . . . # . . . . . . . .
+dnl Mac OS X 10.3.9 . . . . # . . . . . . # . # . . . . . .
dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . .
dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . .
dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . .
diff --git a/gl/m4/signbit.m4 b/gl/m4/signbit.m4
index e9877f68f5..fb707c9074 100644
--- a/gl/m4/signbit.m4
+++ b/gl/m4/signbit.m4
@@ -1,4 +1,4 @@
-# signbit.m4 serial 12
+# signbit.m4 serial 13
dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -170,7 +170,7 @@ double m0d = -p0d;
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
So we use another constant expression instead.
But that expression does not work on other platforms, such as when
- cross-compiling to PowerPC on MacOS X 10.5. */
+ cross-compiling to PowerPC on Mac OS X 10.5. */
long double p0l = 0.0L;
#if defined __hpux || defined __sgi
long double m0l = -LDBL_MIN * LDBL_MIN;
diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4
index b03393b957..5298dd6d9d 100644
--- a/gl/m4/stdio_h.m4
+++ b/gl/m4/stdio_h.m4
@@ -1,4 +1,4 @@
-# stdio_h.m4 serial 41
+# stdio_h.m4 serial 42
dnl Copyright (C) 2007-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -13,7 +13,9 @@ AC_DEFUN([gl_STDIO_H],
dnl No need to create extra modules for these functions. Everyone who uses
dnl <stdio.h> likely needs them.
GNULIB_FSCANF=1
+ gl_MODULE_INDICATOR([fscanf])
GNULIB_SCANF=1
+ gl_MODULE_INDICATOR([scanf])
GNULIB_FGETC=1
GNULIB_GETC=1
GNULIB_GETCHAR=1
diff --git a/gl/m4/strerror_r.m4 b/gl/m4/strerror_r.m4
index 5bdf0abe73..bb035ebcaf 100644
--- a/gl/m4/strerror_r.m4
+++ b/gl/m4/strerror_r.m4
@@ -1,4 +1,4 @@
-# strerror_r.m4 serial 14
+# strerror_r.m4 serial 15
dnl Copyright (C) 2002, 2007-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -76,7 +76,7 @@ AC_DEFUN([gl_FUNC_STRERROR_R_WORKS],
dnl HP-UX 11.31 strerror_r always fails when the buffer length argument
dnl is less than 80.
dnl FreeBSD 8.s strerror_r claims failure on 0
- dnl MacOS X 10.5 strerror_r treats 0 like -1
+ dnl Mac OS X 10.5 strerror_r treats 0 like -1
dnl Solaris 10 strerror_r corrupts errno on failure
AC_CACHE_CHECK([whether strerror_r works],
[gl_cv_func_strerror_r_works],
diff --git a/gl/m4/strndup.m4 b/gl/m4/strndup.m4
index bdde5fe1d2..cef68892a8 100644
--- a/gl/m4/strndup.m4
+++ b/gl/m4/strndup.m4
@@ -1,4 +1,4 @@
-# strndup.m4 serial 20
+# strndup.m4 serial 21
dnl Copyright (C) 2002-2003, 2005-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -24,7 +24,7 @@ AC_DEFUN([gl_FUNC_STRNDUP],
[AC_RUN_IFELSE([
AC_LANG_PROGRAM([[#include <string.h>
#include <stdlib.h>]], [[
-#ifndef HAVE_DECL_STRNDUP
+#if !HAVE_DECL_STRNDUP
extern
#ifdef __cplusplus
"C"
diff --git a/gl/m4/sys_time_h.m4 b/gl/m4/sys_time_h.m4
index 26eaf8ea7f..c4a30cda77 100644
--- a/gl/m4/sys_time_h.m4
+++ b/gl/m4/sys_time_h.m4
@@ -52,7 +52,9 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
dnl (in <sys/time.h> and <winsock2.h> for mingw64, in <winsock2.h> only
dnl for MSVC) with a tv_sec field of type 'long' (32-bit!), which is
dnl smaller than the 'time_t' type mandated by POSIX.
- AC_CACHE_CHECK([for correct struct timeval.tv_sec member],
+ dnl On OpenBSD 5.1 amd64, tv_sec is 64 bits and time_t 32 bits, but
+ dnl that is good enough.
+ AC_CACHE_CHECK([for wide-enough struct timeval.tv_sec member],
[gl_cv_sys_struct_timeval_tv_sec],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
@@ -65,7 +67,9 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
#endif
]],
[[static struct timeval x;
- typedef int verify_tv_sec_type[sizeof (x.tv_sec) == sizeof (time_t) ? 1 : -1];
+ typedef int verify_tv_sec_type[
+ sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
+ ];
]])],
[gl_cv_sys_struct_timeval_tv_sec=yes],
[gl_cv_sys_struct_timeval_tv_sec=no])
diff --git a/gl/m4/threadlib.m4 b/gl/m4/threadlib.m4
index 9cedb67006..cb93391900 100644
--- a/gl/m4/threadlib.m4
+++ b/gl/m4/threadlib.m4
@@ -1,4 +1,4 @@
-# threadlib.m4 serial 9 (gettext-0.18.2)
+# threadlib.m4 serial 10 (gettext-0.18.2)
dnl Copyright (C) 2005-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -319,50 +319,50 @@ AC_DEFUN([gl_DISABLE_THREADS], [
dnl Survey of platforms:
dnl
-dnl Platform Available Compiler Supports test-lock
-dnl flavours option weak result
-dnl --------------- --------- --------- -------- ---------
-dnl Linux 2.4/glibc posix -lpthread Y OK
+dnl Platform Available Compiler Supports test-lock
+dnl flavours option weak result
+dnl --------------- --------- --------- -------- ---------
+dnl Linux 2.4/glibc posix -lpthread Y OK
dnl
-dnl GNU Hurd/glibc posix
+dnl GNU Hurd/glibc posix
dnl
-dnl FreeBSD 5.3 posix -lc_r Y
-dnl posix -lkse ? Y
-dnl posix -lpthread ? Y
-dnl posix -lthr Y
+dnl FreeBSD 5.3 posix -lc_r Y
+dnl posix -lkse ? Y
+dnl posix -lpthread ? Y
+dnl posix -lthr Y
dnl
-dnl FreeBSD 5.2 posix -lc_r Y
-dnl posix -lkse Y
-dnl posix -lthr Y
+dnl FreeBSD 5.2 posix -lc_r Y
+dnl posix -lkse Y
+dnl posix -lthr Y
dnl
-dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
+dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
dnl
-dnl NetBSD 1.6 --
+dnl NetBSD 1.6 --
dnl
-dnl OpenBSD 3.4 posix -lpthread Y OK
+dnl OpenBSD 3.4 posix -lpthread Y OK
dnl
-dnl MacOS X 10.[123] posix -lpthread Y OK
+dnl Mac OS X 10.[123] posix -lpthread Y OK
dnl
-dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
-dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
+dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
+dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
dnl
-dnl HP-UX 11 posix -lpthread N (cc) OK
+dnl HP-UX 11 posix -lpthread N (cc) OK
dnl Y (gcc)
dnl
-dnl IRIX 6.5 posix -lpthread Y 0.5
+dnl IRIX 6.5 posix -lpthread Y 0.5
dnl
-dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
+dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
dnl
-dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
+dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
dnl -lpthread (gcc) Y
dnl
-dnl Cygwin posix -lpthread Y OK
+dnl Cygwin posix -lpthread Y OK
dnl
-dnl Any of the above pth -lpth 0.0
+dnl Any of the above pth -lpth 0.0
dnl
-dnl Mingw windows N OK
+dnl Mingw windows N OK
dnl
-dnl BeOS 5 --
+dnl BeOS 5 --
dnl
dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
dnl turned off:
diff --git a/gl/m4/time_h.m4 b/gl/m4/time_h.m4
index b88da76463..6415bfbcb7 100644
--- a/gl/m4/time_h.m4
+++ b/gl/m4/time_h.m4
@@ -2,7 +2,7 @@
# Copyright (C) 2000-2001, 2003-2007, 2009-2012 Free Software Foundation, Inc.
-# serial 6
+# serial 7
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -25,7 +25,7 @@ AC_DEFUN([gl_HEADER_TIME_H_BODY],
AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
])
-dnl Define HAVE_STRUCT_TIMESPEC if 'struct timespec' is declared
+dnl Check whether 'struct timespec' is declared
dnl in time.h, sys/time.h, or pthread.h.
AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
diff --git a/gl/m4/time_r.m4 b/gl/m4/time_r.m4
index c3579fb3b8..9ddbd0199d 100644
--- a/gl/m4/time_r.m4
+++ b/gl/m4/time_r.m4
@@ -17,7 +17,7 @@ AC_DEFUN([gl_TIME_R],
dnl Some systems don't declare localtime_r() and gmtime_r() if _REENTRANT is
dnl not defined.
- AC_CHECK_DECLS_ONCE([localtime_r])
+ AC_CHECK_DECLS([localtime_r], [], [], [[#include <time.h>]])
if test $ac_cv_have_decl_localtime_r = no; then
HAVE_DECL_LOCALTIME_R=0
fi
diff --git a/gl/m4/visibility.m4 b/gl/m4/visibility.m4
index 7b24d39e68..a7d4d8c1dd 100644
--- a/gl/m4/visibility.m4
+++ b/gl/m4/visibility.m4
@@ -1,4 +1,4 @@
-# visibility.m4 serial 4 (gettext-0.18.2)
+# visibility.m4 serial 5 (gettext-0.18.2)
dnl Copyright (C) 2005, 2008, 2010-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -12,7 +12,7 @@ dnl __attribute__((__visibility__("hidden"))) and
dnl __attribute__((__visibility__("default"))).
dnl Does *not* test for __visibility__("protected") - which has tricky
dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
-dnl MacOS X.
+dnl Mac OS X.
dnl Does *not* test for __visibility__("internal") - which has processor
dnl dependent semantics.
dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
diff --git a/gl/printf-parse.c b/gl/printf-parse.c
index 308a1755b1..815fd43320 100644
--- a/gl/printf-parse.c
+++ b/gl/printf-parse.c
@@ -401,7 +401,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
cp++;
}
#if defined __APPLE__ && defined __MACH__
- /* On MacOS X 10.3, PRIdMAX is defined as "qd".
+ /* On Mac OS X 10.3, PRIdMAX is defined as "qd".
We cannot change it to "lld" because PRIdMAX must also
be understood by the system's printf routines. */
else if (*cp == 'q')
diff --git a/gl/signal.in.h b/gl/signal.in.h
index e0f0554bdb..8fb1ad119a 100644
--- a/gl/signal.in.h
+++ b/gl/signal.in.h
@@ -55,7 +55,7 @@
#ifndef _@GUARD_PREFIX@_SIGNAL_H
#define _@GUARD_PREFIX@_SIGNAL_H
-/* MacOS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6 declare
+/* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6 declare
pthread_sigmask in <pthread.h>, not in <signal.h>.
But avoid namespace pollution on glibc systems.*/
#if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
@@ -197,7 +197,7 @@ typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
/* Test whether a given signal is contained in a signal set. */
# if @HAVE_POSIX_SIGNALBLOCKING@
-/* This function is defined as a macro on MacOS X. */
+/* This function is defined as a macro on Mac OS X. */
# if defined __cplusplus && defined GNULIB_NAMESPACE
# undef sigismember
# endif
@@ -210,7 +210,7 @@ _GL_CXXALIASWARN (sigismember);
/* Initialize a signal set to the empty set. */
# if @HAVE_POSIX_SIGNALBLOCKING@
-/* This function is defined as a macro on MacOS X. */
+/* This function is defined as a macro on Mac OS X. */
# if defined __cplusplus && defined GNULIB_NAMESPACE
# undef sigemptyset
# endif
@@ -222,7 +222,7 @@ _GL_CXXALIASWARN (sigemptyset);
/* Add a signal to a signal set. */
# if @HAVE_POSIX_SIGNALBLOCKING@
-/* This function is defined as a macro on MacOS X. */
+/* This function is defined as a macro on Mac OS X. */
# if defined __cplusplus && defined GNULIB_NAMESPACE
# undef sigaddset
# endif
@@ -235,7 +235,7 @@ _GL_CXXALIASWARN (sigaddset);
/* Remove a signal from a signal set. */
# if @HAVE_POSIX_SIGNALBLOCKING@
-/* This function is defined as a macro on MacOS X. */
+/* This function is defined as a macro on Mac OS X. */
# if defined __cplusplus && defined GNULIB_NAMESPACE
# undef sigdelset
# endif
@@ -248,7 +248,7 @@ _GL_CXXALIASWARN (sigdelset);
/* Fill a signal set with all possible signals. */
# if @HAVE_POSIX_SIGNALBLOCKING@
-/* This function is defined as a macro on MacOS X. */
+/* This function is defined as a macro on Mac OS X. */
# if defined __cplusplus && defined GNULIB_NAMESPACE
# undef sigfillset
# endif
diff --git a/gl/stdint.in.h b/gl/stdint.in.h
index 59c00d59c0..e2a0eb19ac 100644
--- a/gl/stdint.in.h
+++ b/gl/stdint.in.h
@@ -83,7 +83,7 @@
/* <sys/types.h> defines some of the stdint.h types as well, on glibc,
IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
AIX 5.2 <sys/types.h> isn't needed and causes troubles.
- MacOS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
+ Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
relies on the system <stdint.h> definitions, so include
<sys/types.h> after @NEXT_STDINT_H@. */
#if @HAVE_SYS_TYPES_H@ && ! defined _AIX
diff --git a/gl/stdio-impl.h b/gl/stdio-impl.h
index 4935795374..920b4d47da 100644
--- a/gl/stdio-impl.h
+++ b/gl/stdio-impl.h
@@ -28,7 +28,7 @@
#include <errno.h> /* For detecting Plan9. */
-#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
+#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
# if defined __DragonFly__ /* DragonFly */
/* See <http://www.dragonflybsd.org/cvsweb/src/lib/libc/stdio/priv_stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup>. */
@@ -66,7 +66,7 @@
/* More fields, not relevant here. */
};
# define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub
-# else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, MacOS X, Cygwin */
+# else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin */
# define fp_ub fp_->_ub
# endif
diff --git a/gl/stdlib.in.h b/gl/stdlib.in.h
index b546133c3a..1d67ec64c6 100644
--- a/gl/stdlib.in.h
+++ b/gl/stdlib.in.h
@@ -87,8 +87,8 @@ struct random_data
#endif
#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
-/* On MacOS X 10.3, only <unistd.h> declares mkstemp. */
-/* On MacOS X 10.5, only <unistd.h> declares mkstemps. */
+/* On Mac OS X 10.3, only <unistd.h> declares mkstemp. */
+/* On Mac OS X 10.5, only <unistd.h> declares mkstemps. */
/* On Cygwin 1.7.1, only <unistd.h> declares getsubopt. */
/* But avoid namespace pollution on glibc systems and native Windows. */
# include <unistd.h>
diff --git a/gl/sys_select.in.h b/gl/sys_select.in.h
index 214d75d719..0aee2a16cb 100644
--- a/gl/sys_select.in.h
+++ b/gl/sys_select.in.h
@@ -63,7 +63,7 @@
/* On OSF/1 4.0, <sys/select.h> provides only a forward declaration
of 'struct timeval', and no definition of this type.
- Also, MacOS X, AIX, HP-UX, IRIX, Solaris, Interix declare select()
+ Also, Mac OS X, AIX, HP-UX, IRIX, Solaris, Interix declare select()
in <sys/time.h>.
But avoid namespace pollution on glibc systems. */
# ifndef __GLIBC__
diff --git a/gl/tests/init.sh b/gl/tests/init.sh
index f525a7cab4..5f6e6387e2 100644
--- a/gl/tests/init.sh
+++ b/gl/tests/init.sh
@@ -411,8 +411,7 @@ path_prepend_ ()
case $path_dir_ in
'') fail_ "invalid path dir: '$1'";;
/*) abs_path_dir_=$path_dir_;;
- *) abs_path_dir_=`cd "$initial_cwd_/$path_dir_" && echo "$PWD"` \
- || fail_ "invalid path dir: $path_dir_";;
+ *) abs_path_dir_=$initial_cwd_/$path_dir_;;
esac
case $abs_path_dir_ in
*:*) fail_ "invalid path dir: '$abs_path_dir_'";;
@@ -448,7 +447,7 @@ setup_ ()
pfx_=`testdir_prefix_`
test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
|| fail_ "failed to create temporary directory in $initial_cwd_"
- cd "$test_dir_"
+ cd "$test_dir_" || fail_ "failed to cd to temporary directory"
# As autoconf-generated configure scripts do, ensure that IFS
# is defined initially, so that saving and restoring $IFS works.
diff --git a/gl/tests/minus-zero.h b/gl/tests/minus-zero.h
index 491cef3872..b3c8dd29f5 100644
--- a/gl/tests/minus-zero.h
+++ b/gl/tests/minus-zero.h
@@ -24,7 +24,7 @@
/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0f.
ICC 10.0 has a bug when optimizing the expression -zero.
The expression -FLT_MIN * FLT_MIN does not work when cross-compiling
- to PowerPC on MacOS X 10.5. */
+ to PowerPC on Mac OS X 10.5. */
#if defined __hpux || defined __sgi || defined __ICC
static float
compute_minus_zerof (void)
@@ -42,7 +42,7 @@ float minus_zerof = -0.0f;
/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
ICC 10.0 has a bug when optimizing the expression -zero.
The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
- to PowerPC on MacOS X 10.5. */
+ to PowerPC on Mac OS X 10.5. */
#if defined __hpux || defined __sgi || defined __ICC
static double
compute_minus_zerod (void)
@@ -61,7 +61,7 @@ double minus_zerod = -0.0;
IRIX cc can't put -0.0L into .data, but can compute at runtime.
ICC 10.0 has a bug when optimizing the expression -zero.
The expression -LDBL_MIN * LDBL_MIN does not work when cross-compiling
- to PowerPC on MacOS X 10.5. */
+ to PowerPC on Mac OS X 10.5. */
#if defined __hpux || defined __sgi || defined __ICC
static long double
compute_minus_zerol (void)
diff --git a/gl/tests/stat.c b/gl/tests/stat.c
index 1fc633eeef..7599540890 100644
--- a/gl/tests/stat.c
+++ b/gl/tests/stat.c
@@ -29,6 +29,7 @@
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
# if _GL_WINDOWS_64_BIT_ST_SIZE
+# undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
# define stat _stati64
# define REPLACE_FUNC_STAT_DIR 1
# undef REPLACE_FUNC_STAT_FILE
diff --git a/gl/tests/test-alloca-opt.c b/gl/tests/test-alloca-opt.c
index 4e814c6f2c..6b9a4d70c0 100644
--- a/gl/tests/test-alloca-opt.c
+++ b/gl/tests/test-alloca-opt.c
@@ -44,7 +44,7 @@ main ()
{
/* Try various values.
n = 0 gave a crash on Alpha with gcc-2.5.8.
- Some versions of MacOS X have a stack size limit of 512 KB. */
+ Some versions of Mac OS X have a stack size limit of 512 KB. */
func (34);
func (134);
func (399);
diff --git a/gl/tests/test-malloca.c b/gl/tests/test-malloca.c
index d7732c32c8..9c7109c978 100644
--- a/gl/tests/test-malloca.c
+++ b/gl/tests/test-malloca.c
@@ -45,7 +45,7 @@ main ()
{
/* Try various values.
n = 0 gave a crash on Alpha with gcc-2.5.8.
- Some versions of MacOS X have a stack size limit of 512 KB. */
+ Some versions of Mac OS X have a stack size limit of 512 KB. */
func (34);
func (134);
func (399);
diff --git a/gl/tests/test-select.h b/gl/tests/test-select.h
index 9fe998c1dd..1169e59290 100644
--- a/gl/tests/test-select.h
+++ b/gl/tests/test-select.h
@@ -265,7 +265,7 @@ test_bad_fd (select_fn my_select)
#if !(defined __osf__ || defined WINDOWS_NATIVE)
int fd;
- /* On Linux, MacOS X, *BSD, values of fd like 99 or 399 are discarded
+ /* On Linux, Mac OS X, *BSD, values of fd like 99 or 399 are discarded
by the kernel early and therefore do *not* lead to EBADF, as required
by POSIX. */
# if defined __linux__ || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined __NetBSD__
diff --git a/gl/tests/test-time.c b/gl/tests/test-time.c
index acf3d2df6d..11a4208481 100644
--- a/gl/tests/test-time.c
+++ b/gl/tests/test-time.c
@@ -26,7 +26,7 @@
struct timespec t1;
#if 0
/* POSIX:2008 does not require pid_t in <time.h> unconditionally, and indeed
- it's missing on MacOS X 10.5, FreeBSD 6.4, OpenBSD 4.9, mingw. */
+ it's missing on Mac OS X 10.5, FreeBSD 6.4, OpenBSD 4.9, mingw. */
pid_t t2;
#endif
diff --git a/gl/timespec.h b/gl/timespec.h
index 388ddb83a7..a58707947c 100644
--- a/gl/timespec.h
+++ b/gl/timespec.h
@@ -65,9 +65,12 @@ timespec_sign (struct timespec a)
return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec;
}
-struct timespec timespec_add (struct timespec, struct timespec);
-struct timespec timespec_sub (struct timespec, struct timespec);
-struct timespec dtotimespec (double);
+struct timespec timespec_add (struct timespec, struct timespec)
+ _GL_ATTRIBUTE_CONST;
+struct timespec timespec_sub (struct timespec, struct timespec)
+ _GL_ATTRIBUTE_CONST;
+struct timespec dtotimespec (double)
+ _GL_ATTRIBUTE_CONST;
/* Return an approximation to A, of type 'double'. */
static inline double
diff --git a/gl/unistd.in.h b/gl/unistd.in.h
index 9115486cf3..e904e512ee 100644
--- a/gl/unistd.in.h
+++ b/gl/unistd.in.h
@@ -1318,7 +1318,7 @@ _GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
_GL_FUNCDECL_SYS (sethostname, int, (const char *name, size_t len)
_GL_ARG_NONNULL ((1)));
# endif
-/* Need to cast, because on Solaris 11 2011-10, MacOS X 10.5, IRIX 6.5
+/* Need to cast, because on Solaris 11 2011-10, Mac OS X 10.5, IRIX 6.5
and FreeBSD 6.4 the second parameter is int. On Solaris 11
2011-10, the first parameter is not const. */
_GL_CXXALIAS_SYS_CAST (sethostname, int, (const char *name, size_t len));
diff --git a/gl/vasnprintf.c b/gl/vasnprintf.c
index 0ebddf10a6..0261661d4e 100644
--- a/gl/vasnprintf.c
+++ b/gl/vasnprintf.c
@@ -275,7 +275,7 @@ decimal_point_char (void)
{
const char *point;
/* Determine it in a multithread-safe way. We know nl_langinfo is
- multithread-safe on glibc systems and MacOS X systems, but is not required
+ multithread-safe on glibc systems and Mac OS X systems, but is not required
to be multithread-safe by POSIX. sprintf(), however, is multithread-safe.
localeconv() is rarely multithread-safe. */
# if HAVE_NL_LANGINFO && (__GLIBC__ || defined __UCLIBC__ || (defined __APPLE__ && defined __MACH__))