Update to gnulib 312af25ba220ccff068245f0dc698e9bcc8f03f8

* lib/.gitignore, lib/c-ctype.h, lib/msvc-inval.c, lib/stdalign.in.h,
lib/vasnprintf.c, lib/verify.h, m4/extern-inline.m4, m4/stdalign.m4:
Update.
This commit is contained in:
Alexandre Duret-Lutz 2013-07-18 17:27:53 +02:00
parent 904ff6a555
commit 96f32c73fb
8 changed files with 108 additions and 76 deletions

3
lib/.gitignore vendored
View file

@ -1,7 +1,9 @@
alloca.h alloca.h
arg-nonnull.h arg-nonnull.h
c++defs.h c++defs.h
configmake.h
dummy.c dummy.c
errno.h
fcntl.h fcntl.h
getopt.h getopt.h
libgnu.a libgnu.a
@ -11,6 +13,7 @@ stdlib.h
string.h string.h
strings.h strings.h
sys/ sys/
sysexits.h
time.h time.h
unistd.h unistd.h
warn-on-use.h warn-on-use.h

View file

@ -136,7 +136,8 @@ extern int c_tolower (int c) _GL_ATTRIBUTE_CONST;
extern int c_toupper (int c) _GL_ATTRIBUTE_CONST; extern int c_toupper (int c) _GL_ATTRIBUTE_CONST;
#if defined __GNUC__ && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS #if (defined __GNUC__ && !defined __STRICT_ANSI__ && defined __OPTIMIZE__ \
&& !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS)
/* ASCII optimizations. */ /* ASCII optimizations. */

View file

@ -28,7 +28,7 @@
# if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING # if MSVC_INVALID_PARAMETER_HANDLING == DEFAULT_HANDLING
static void cdecl static void __cdecl
gl_msvc_invalid_parameter_handler (const wchar_t *expression, gl_msvc_invalid_parameter_handler (const wchar_t *expression,
const wchar_t *function, const wchar_t *function,
const wchar_t *file, const wchar_t *file,
@ -45,7 +45,7 @@ gl_msvc_invalid_parameter_handler (const wchar_t *expression,
# if defined _MSC_VER # if defined _MSC_VER
static void cdecl static void __cdecl
gl_msvc_invalid_parameter_handler (const wchar_t *expression, gl_msvc_invalid_parameter_handler (const wchar_t *expression,
const wchar_t *function, const wchar_t *function,
const wchar_t *file, const wchar_t *file,
@ -94,7 +94,7 @@ gl_msvc_inval_current (void)
} }
} }
static void cdecl static void __cdecl
gl_msvc_invalid_parameter_handler (const wchar_t *expression, gl_msvc_invalid_parameter_handler (const wchar_t *expression,
const wchar_t *function, const wchar_t *function,
const wchar_t *file, const wchar_t *file,

View file

@ -41,14 +41,29 @@
are 4 unless the option '-malign-double' is used. are 4 unless the option '-malign-double' is used.
The result cannot be used as a value for an 'enum' constant, if you The result cannot be used as a value for an 'enum' constant, if you
want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. */ want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc.
Include <stddef.h> for offsetof. */
#include <stddef.h> #include <stddef.h>
#if defined __cplusplus
/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other
standard headers, defines conflicting implementations of _Alignas
and _Alignof that are no better than ours; override them. */
#undef _Alignas
#undef _Alignof
#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
# ifdef __cplusplus
# if 201103 <= __cplusplus
# define _Alignof(type) alignof (type)
# else
template <class __t> struct __alignof_helper { char __a; __t __b; }; template <class __t> struct __alignof_helper { char __a; __t __b; };
# define _Alignof(type) offsetof (__alignof_helper<type>, __b) # define _Alignof(type) offsetof (__alignof_helper<type>, __b)
# endif
# else # else
# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b) # define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
# endif # endif
#endif
#define alignof _Alignof #define alignof _Alignof
#define __alignof_is_defined 1 #define __alignof_is_defined 1
@ -77,12 +92,16 @@
*/ */
#if __GNUC__ || __IBMC__ || __IBMCPP__ || 0x5110 <= __SUNPRO_C #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
# if defined __cplusplus && 201103 <= __cplusplus
# define _Alignas(a) alignas (a)
# elif __GNUC__ || __IBMC__ || __IBMCPP__ || __ICC || 0x5110 <= __SUNPRO_C
# define _Alignas(a) __attribute__ ((__aligned__ (a))) # define _Alignas(a) __attribute__ ((__aligned__ (a)))
# elif 1300 <= _MSC_VER # elif 1300 <= _MSC_VER
# define _Alignas(a) __declspec (align (a)) # define _Alignas(a) __declspec (align (a))
# endif # endif
#ifdef _Alignas #endif
#if defined _Alignas || (defined __STDC_VERSION && 201112 <= __STDC_VERSION__)
# define alignas _Alignas # define alignas _Alignas
# define __alignas_is_defined 1 # define __alignas_is_defined 1
#endif #endif

View file

@ -5153,7 +5153,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
size_t tmp_length = size_t tmp_length =
MAX_ROOM_NEEDED (&a, dp->arg_index, MAX_ROOM_NEEDED (&a, dp->arg_index,
dp->conversion, type, flags, dp->conversion, type, flags,
width, has_precision, has_width ? width : 0,
has_precision,
precision, pad_ourselves); precision, pad_ourselves);
if (maxlen < tmp_length) if (maxlen < tmp_length)

View file

@ -31,7 +31,9 @@
Use this only with GCC. If we were willing to slow 'configure' Use this only with GCC. If we were willing to slow 'configure'
down we could also use it with other compilers, but since this down we could also use it with other compilers, but since this
affects only the quality of diagnostics, why bother? */ affects only the quality of diagnostics, why bother? */
# if (4 < __GNUC__ || (__GNUC__ == 4 && 6 <= __GNUC_MINOR__)) && !defined __cplusplus #if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
&& (201112L <= __STDC_VERSION__ || !defined __STRICT_ANSI__) \
&& !defined __cplusplus)
# define _GL_HAVE__STATIC_ASSERT 1 # define _GL_HAVE__STATIC_ASSERT 1
#endif #endif
/* The condition (99 < __GNUC__) is temporary, until we know about the /* The condition (99 < __GNUC__) is temporary, until we know about the
@ -40,6 +42,14 @@
# define _GL_HAVE_STATIC_ASSERT 1 # define _GL_HAVE_STATIC_ASSERT 1
#endif #endif
/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other
system headers, defines a conflicting _Static_assert that is no
better than ours; override it. */
#ifndef _GL_HAVE_STATIC_ASSERT
# include <stddef.h>
# undef _Static_assert
#endif
/* Each of these macros verifies that its argument R is nonzero. To /* Each of these macros verifies that its argument R is nonzero. To
be portable, R should be an integer constant expression. Unlike be portable, R should be an integer constant expression. Unlike
assert (R), there is no run-time overhead. assert (R), there is no run-time overhead.

View file

@ -8,15 +8,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_EXTERN_INLINE], AC_DEFUN([gl_EXTERN_INLINE],
[ [
AH_VERBATIM([extern_inline], AH_VERBATIM([extern_inline],
[/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'. [/* Please see the Gnulib manual for how to use these macros.
_GL_EXTERN_INLINE is a portable alternative to 'extern inline'.
_GL_INLINE_HEADER_BEGIN contains useful stuff to put
in an include file, before uses of _GL_INLINE.
It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic,
when FOO is an inline function in the header; see
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>.
_GL_INLINE_HEADER_END contains useful stuff to put
in the same include file, after uses of _GL_INLINE.
Suppress extern inline with HP-UX cc, as it appears to be broken; see Suppress extern inline with HP-UX cc, as it appears to be broken; see
<http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>. <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
@ -39,7 +31,8 @@ AC_DEFUN([gl_EXTERN_INLINE],
&& !defined __APPLE__) && !defined __APPLE__)
# define _GL_INLINE inline # define _GL_INLINE inline
# define _GL_EXTERN_INLINE extern inline # define _GL_EXTERN_INLINE extern inline
#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __APPLE__ #elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
&& !defined __APPLE__)
# if __GNUC_GNU_INLINE__ # if __GNUC_GNU_INLINE__
/* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) # define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
@ -59,6 +52,10 @@ AC_DEFUN([gl_EXTERN_INLINE],
# define _GL_INLINE_HEADER_CONST_PRAGMA \ # define _GL_INLINE_HEADER_CONST_PRAGMA \
_Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
# endif # 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 \ # define _GL_INLINE_HEADER_BEGIN \
_Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \

View file

@ -31,7 +31,8 @@ AC_DEFUN([gl_STDALIGN_H],
/* Test _Alignas only on platforms where gnulib can help. */ /* Test _Alignas only on platforms where gnulib can help. */
#if \ #if \
(__GNUC__ || __IBMC__ || __IBMCPP__ \ ((defined __cplusplus && 201103 <= __cplusplus) \
|| __GNUC__ || __IBMC__ || __IBMCPP__ || __ICC \
|| 0x5110 <= __SUNPRO_C || 1300 <= _MSC_VER) || 0x5110 <= __SUNPRO_C || 1300 <= _MSC_VER)
struct alignas_test { char c; char alignas (8) alignas_8; }; struct alignas_test { char c; char alignas (8) alignas_8; };
char test_alignas[offsetof (struct alignas_test, alignas_8) == 8 char test_alignas[offsetof (struct alignas_test, alignas_8) == 8