summaryrefslogtreecommitdiff
path: root/src/gl
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2014-12-23 12:40:17 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2014-12-23 13:12:07 +0200
commitf8fef13d33dbe80c44f800ca0312c0e03c5ae137 (patch)
treebf3650597de0825ae181122b7bcdfd67475af7d1 /src/gl
parent23d96f1b9613d33a6fb50bf892a7accbab1332ba (diff)
downloadgnutls-f8fef13d33dbe80c44f800ca0312c0e03c5ae137.tar.gz
updated gnulib
Diffstat (limited to 'src/gl')
-rw-r--r--src/gl/Makefile.am1
-rw-r--r--src/gl/m4/extensions.m45
-rw-r--r--src/gl/m4/extern-inline.m49
-rw-r--r--src/gl/m4/gnulib-comp.m46
-rw-r--r--src/gl/m4/printf.m42
-rw-r--r--src/gl/m4/stdalign.m48
-rw-r--r--src/gl/m4/stddef_h.m48
-rw-r--r--src/gl/m4/stdio_h.m43
-rw-r--r--src/gl/parse-datetime.y2
-rw-r--r--src/gl/stdalign.in.h5
-rw-r--r--src/gl/stddef.in.h41
-rw-r--r--src/gl/timespec.h4
-rw-r--r--src/gl/unistd.in.h9
-rw-r--r--src/gl/vasnprintf.c15
14 files changed, 76 insertions, 42 deletions
diff --git a/src/gl/Makefile.am b/src/gl/Makefile.am
index 7e42d126ea..2d31405d9d 100644
--- a/src/gl/Makefile.am
+++ b/src/gl/Makefile.am
@@ -860,6 +860,7 @@ stddef.h: stddef.in.h $(top_builddir)/config.status
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
+ -e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \
-e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
-e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
< $(srcdir)/stddef.in.h; \
diff --git a/src/gl/m4/extensions.m4 b/src/gl/m4/extensions.m4
index 37f55ca3d1..cf285ba273 100644
--- a/src/gl/m4/extensions.m4
+++ b/src/gl/m4/extensions.m4
@@ -68,6 +68,10 @@ dnl configure.ac when using autoheader 2.62.
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
+/* Use GNU style printf and scanf. */
+#ifndef __USE_MINGW_ANSI_STDIO
+# undef __USE_MINGW_ANSI_STDIO
+#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
@@ -100,6 +104,7 @@ dnl configure.ac when using autoheader 2.62.
AC_DEFINE([_ALL_SOURCE])
AC_DEFINE([_DARWIN_C_SOURCE])
AC_DEFINE([_GNU_SOURCE])
+ AC_DEFINE([__USE_MINGW_ANSI_STDIO])
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
AC_DEFINE([_TANDEM_SOURCE])
AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
diff --git a/src/gl/m4/extern-inline.m4 b/src/gl/m4/extern-inline.m4
index 7f1bb397c4..0edbe3c81c 100644
--- a/src/gl/m4/extern-inline.m4
+++ b/src/gl/m4/extern-inline.m4
@@ -74,6 +74,11 @@ AC_DEFUN([gl_EXTERN_INLINE],
# define _GL_EXTERN_INLINE static _GL_UNUSED
#endif
+/* In GCC, suppress bogus "no previous prototype for 'FOO'"
+ and "no previous declaration for 'FOO'" diagnostics,
+ when FOO is an inline function in the header; see
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and
+ <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>. */
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
# define _GL_INLINE_HEADER_CONST_PRAGMA
@@ -81,10 +86,6 @@ AC_DEFUN([gl_EXTERN_INLINE],
# define _GL_INLINE_HEADER_CONST_PRAGMA \
_Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
# endif
- /* Suppress GCC's bogus "no previous prototype for 'FOO'"
- and "no previous declaration for 'FOO'" diagnostics,
- when FOO is an inline function in the header; see
- <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>. */
# define _GL_INLINE_HEADER_BEGIN \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
diff --git a/src/gl/m4/gnulib-comp.m4 b/src/gl/m4/gnulib-comp.m4
index edd03a71fd..8dae6a8d3e 100644
--- a/src/gl/m4/gnulib-comp.m4
+++ b/src/gl/m4/gnulib-comp.m4
@@ -387,8 +387,8 @@ AC_SUBST([LTALLOCA])
SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
fi
gl_SYS_SOCKET_MODULE_INDICATOR([socket])
- gl_SOCKETLIB
- gl_SOCKETS
+ AC_REQUIRE([gl_SOCKETLIB])
+ AC_REQUIRE([gl_SOCKETS])
gl_TYPE_SOCKLEN_T
gt_TYPE_SSIZE_T
gl_STDALIGN_H
@@ -418,7 +418,7 @@ AC_SUBST([LTALLOCA])
gl_HEADER_STRING_H
gl_HEADER_SYS_SELECT
AC_PROG_MKDIR_P
- gl_HEADER_SYS_SOCKET
+ AC_REQUIRE([gl_HEADER_SYS_SOCKET])
AC_PROG_MKDIR_P
gl_HEADER_SYS_STAT_H
AC_PROG_MKDIR_P
diff --git a/src/gl/m4/printf.m4 b/src/gl/m4/printf.m4
index 3d7b381efd..652fa1cdc1 100644
--- a/src/gl/m4/printf.m4
+++ b/src/gl/m4/printf.m4
@@ -328,7 +328,7 @@ int main ()
# ifdef WORDS_BIGENDIAN
# define LDBL80_WORDS(exponent,manthi,mantlo) \
{ ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
- ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \
+ ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \
(unsigned int) (mantlo) << 16 \
}
# else
diff --git a/src/gl/m4/stdalign.m4 b/src/gl/m4/stdalign.m4
index 9efafe5c5b..f60257f16a 100644
--- a/src/gl/m4/stdalign.m4
+++ b/src/gl/m4/stdalign.m4
@@ -32,8 +32,12 @@ AC_DEFUN([gl_STDALIGN_H],
/* Test _Alignas only on platforms where gnulib can help. */
#if \
((defined __cplusplus && 201103 <= __cplusplus) \
- || __GNUC__ || __IBMC__ || __IBMCPP__ || __ICC \
- || 0x5110 <= __SUNPRO_C || 1300 <= _MSC_VER)
+ || (defined __APPLE__ && defined __MACH__ \
+ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ : __GNUC__) \
+ || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__ \
+ || __ICC || 0x5110 <= __SUNPRO_C \
+ || 1300 <= _MSC_VER)
struct alignas_test { char c; char alignas (8) alignas_8; };
char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
? 1 : -1];
diff --git a/src/gl/m4/stddef_h.m4 b/src/gl/m4/stddef_h.m4
index c555e29524..9659813bda 100644
--- a/src/gl/m4/stddef_h.m4
+++ b/src/gl/m4/stddef_h.m4
@@ -1,5 +1,5 @@
-dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues.
-# stddef_h.m4 serial 4
+dnl A placeholder for <stddef.h>, for platforms that have issues.
+# stddef_h.m4 serial 5
dnl Copyright (C) 2009-2014 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,6 +10,9 @@ AC_DEFUN([gl_STDDEF_H],
AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
AC_REQUIRE([gt_TYPE_WCHAR_T])
STDDEF_H=
+ AC_CHECK_TYPE([max_align_t], [], [HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h],
+ [[#include <stddef.h>
+ ]])
if test $gt_cv_c_wchar_t = no; then
HAVE_WCHAR_T=0
STDDEF_H=stddef.h
@@ -43,5 +46,6 @@ AC_DEFUN([gl_STDDEF_H_DEFAULTS],
[
dnl Assume proper GNU behavior unless another module says otherwise.
REPLACE_NULL=0; AC_SUBST([REPLACE_NULL])
+ HAVE_MAX_ALIGN_T=1; AC_SUBST([HAVE_MAX_ALIGN_T])
HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T])
])
diff --git a/src/gl/m4/stdio_h.m4 b/src/gl/m4/stdio_h.m4
index d15913a3ca..ef0dcc12d2 100644
--- a/src/gl/m4/stdio_h.m4
+++ b/src/gl/m4/stdio_h.m4
@@ -6,6 +6,9 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_STDIO_H],
[
+ dnl For __USE_MINGW_ANSI_STDIO
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
gl_NEXT_HEADERS([stdio.h])
diff --git a/src/gl/parse-datetime.y b/src/gl/parse-datetime.y
index 52e6a0c215..72d6c38600 100644
--- a/src/gl/parse-datetime.y
+++ b/src/gl/parse-datetime.y
@@ -1031,7 +1031,7 @@ lookup_word (parser_control const *pc, char *word)
}
static int
-yylex (YYSTYPE *lvalp, parser_control *pc)
+yylex (union YYSTYPE *lvalp, parser_control *pc)
{
unsigned char c;
size_t count;
diff --git a/src/gl/stdalign.in.h b/src/gl/stdalign.in.h
index dcaab55b57..413936df78 100644
--- a/src/gl/stdalign.in.h
+++ b/src/gl/stdalign.in.h
@@ -95,7 +95,10 @@
#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
# if defined __cplusplus && 201103 <= __cplusplus
# define _Alignas(a) alignas (a)
-# elif (__GNUC__ || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__ \
+# elif ((defined __APPLE__ && defined __MACH__ \
+ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+ : __GNUC__) \
+ || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__ \
|| __ICC || 0x5110 <= __SUNPRO_C)
# define _Alignas(a) __attribute__ ((__aligned__ (a)))
# elif 1300 <= _MSC_VER
diff --git a/src/gl/stddef.in.h b/src/gl/stddef.in.h
index f5c0e05655..9924a327fc 100644
--- a/src/gl/stddef.in.h
+++ b/src/gl/stddef.in.h
@@ -39,7 +39,6 @@
# if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T)
# ifdef __need_wint_t
-# undef _@GUARD_PREFIX@_STDDEF_H
# define _GL_STDDEF_WINT_T
# endif
# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
@@ -54,33 +53,45 @@
# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
-# ifndef _@GUARD_PREFIX@_STDDEF_H
-# define _@GUARD_PREFIX@_STDDEF_H
-
/* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */
-#if @REPLACE_NULL@
-# undef NULL
-# ifdef __cplusplus
+# if (@REPLACE_NULL@ \
+ && (!defined _@GUARD_PREFIX@_STDDEF_H || defined _GL_STDDEF_WINT_T))
+# undef NULL
+# ifdef __cplusplus
/* ISO C++ says that the macro NULL must expand to an integer constant
expression, hence '((void *) 0)' is not allowed in C++. */
-# if __GNUG__ >= 3
+# if __GNUG__ >= 3
/* GNU C++ has a __null macro that behaves like an integer ('int' or
'long') but has the same size as a pointer. Use that, to avoid
warnings. */
-# define NULL __null
-# else
-# define NULL 0L
+# define NULL __null
+# else
+# define NULL 0L
+# endif
+# else
+# define NULL ((void *) 0)
+# endif
# endif
-# else
-# define NULL ((void *) 0)
-# endif
-#endif
+
+# ifndef _@GUARD_PREFIX@_STDDEF_H
+# define _@GUARD_PREFIX@_STDDEF_H
/* Some platforms lack wchar_t. */
#if !@HAVE_WCHAR_T@
# define wchar_t int
#endif
+/* Some platforms lack max_align_t. */
+#if !@HAVE_MAX_ALIGN_T@
+typedef union
+{
+ char *__p;
+ double __d;
+ long double __ld;
+ long int __i;
+} max_align_t;
+#endif
+
# endif /* _@GUARD_PREFIX@_STDDEF_H */
# endif /* _@GUARD_PREFIX@_STDDEF_H */
#endif /* __need_XXX */
diff --git a/src/gl/timespec.h b/src/gl/timespec.h
index 872cbb76e3..dfc1277a71 100644
--- a/src/gl/timespec.h
+++ b/src/gl/timespec.h
@@ -74,7 +74,7 @@ make_timespec (time_t s, long int ns)
The (int) cast avoids a gcc -Wconversion warning. */
-_GL_TIMESPEC_INLINE int
+_GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE
timespec_cmp (struct timespec a, struct timespec b)
{
return (a.tv_sec < b.tv_sec ? -1
@@ -84,7 +84,7 @@ timespec_cmp (struct timespec a, struct timespec b)
/* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be
nonnegative. */
-_GL_TIMESPEC_INLINE int
+_GL_TIMESPEC_INLINE int _GL_ATTRIBUTE_PURE
timespec_sign (struct timespec a)
{
return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec;
diff --git a/src/gl/unistd.in.h b/src/gl/unistd.in.h
index 4e70ba464d..dda0b4d104 100644
--- a/src/gl/unistd.in.h
+++ b/src/gl/unistd.in.h
@@ -401,13 +401,12 @@ _GL_WARN_ON_USE (dup3, "dup3 is unportable - "
/* Set of environment variables and values. An array of strings of the form
"VARIABLE=VALUE", terminated with a NULL. */
# if defined __APPLE__ && defined __MACH__
-# include "TargetConditionals.h"
-# if !defined(TARGET_OS_IPHONE) && !defined(TARGET_IPHONE_SIMULATOR)
-# define APPLE_USE_CRT_EXTERNS
+# include <TargetConditionals.h>
+# if !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
+# define _GL_USE_CRT_EXTERNS
# endif
# endif
-#
-# ifdef APPLE_USE_CRT_EXTERNS
+# ifdef _GL_USE_CRT_EXTERNS
# include <crt_externs.h>
# define environ (*_NSGetEnviron ())
# else
diff --git a/src/gl/vasnprintf.c b/src/gl/vasnprintf.c
index ec7302a96e..6b30cebdff 100644
--- a/src/gl/vasnprintf.c
+++ b/src/gl/vasnprintf.c
@@ -5179,18 +5179,21 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
/* SNPRINTF or sprintf failed. Save and use the errno
that it has set, if any. */
int saved_errno = errno;
+ if (saved_errno == 0)
+ {
+ if (dp->conversion == 'c' || dp->conversion == 's')
+ saved_errno = EILSEQ;
+ else
+ saved_errno = EINVAL;
+ }
if (!(result == resultbuf || result == NULL))
free (result);
if (buf_malloced != NULL)
free (buf_malloced);
CLEANUP ();
- errno =
- (saved_errno != 0
- ? saved_errno
- : (dp->conversion == 'c' || dp->conversion == 's'
- ? EILSEQ
- : EINVAL));
+
+ errno = saved_errno;
return NULL;
}