aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2019-05-29 16:33:51 -0700
committerPaul Eggert2019-05-29 16:34:57 -0700
commit10582d0511f4455d5c0449fd8a1e0eca9be06d7b (patch)
tree24381cefbeedcf69b74bfc3968ccb3d71ac6199a
parentfe0cb43fb80db52a79ef898f8de49560cc5cdd90 (diff)
downloademacs-10582d0511f4455d5c0449fd8a1e0eca9be06d7b.tar.gz
emacs-10582d0511f4455d5c0449fd8a1e0eca9be06d7b.zip
Update from Gnulib
This incorporates: 2019-05-24 flexmember: update comments 2019-05-18 pthread_sigmask: fix --enable-threads=windows compilation 2019-05-14 close-stream, closein, closeout: simplify 2019-05-09 verify: remove verify_true 2019-05-09 verify: support C2X and C++17 static_assert * build-aux/config.guess, build-aux/config.sub: * doc/misc/texinfo.tex, lib/flexmember.h, lib/verify.h: * m4/flexmember.m4, m4/pthread_sigmask.m4: Copy from Gnulib * m4/gnulib-comp.m4: Regenerate. 2019-05-26 Paul Eggert <eggert@cs.ucla.edu> Update author/maintainer info This mostly updates email addresses and fixes spellings of author and maintainer names.
-rwxr-xr-xbuild-aux/config.guess61
-rwxr-xr-xbuild-aux/config.sub4
-rw-r--r--doc/misc/texinfo.tex17
-rw-r--r--lib/flexmember.h25
-rw-r--r--lib/verify.h110
-rw-r--r--m4/flexmember.m48
-rw-r--r--m4/gnulib-comp.m42
-rw-r--r--m4/pthread_sigmask.m4140
8 files changed, 195 insertions, 172 deletions
diff --git a/build-aux/config.guess b/build-aux/config.guess
index 4cd9454b35c..ae713942d8f 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -2,7 +2,7 @@
2# Attempt to guess a canonical system name. 2# Attempt to guess a canonical system name.
3# Copyright 1992-2019 Free Software Foundation, Inc. 3# Copyright 1992-2019 Free Software Foundation, Inc.
4 4
5timestamp='2019-04-28' 5timestamp='2019-05-28'
6 6
7# This file is free software; you can redistribute it and/or modify it 7# This file is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License as published by 8# under the terms of the GNU General Public License as published by
@@ -1325,38 +1325,39 @@ EOF
1325 echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" 1325 echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
1326 exit ;; 1326 exit ;;
1327 *:Darwin:*:*) 1327 *:Darwin:*:*)
1328 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 1328 UNAME_PROCESSOR=`uname -p`
1329 set_cc_for_build 1329 case $UNAME_PROCESSOR in
1330 if test "$UNAME_PROCESSOR" = unknown ; then 1330 unknown) UNAME_PROCESSOR=powerpc ;;
1331 UNAME_PROCESSOR=powerpc 1331 esac
1332 if command -v xcode-select > /dev/null 2> /dev/null && \
1333 ! xcode-select --print-path > /dev/null 2> /dev/null ; then
1334 # Avoid executing cc if there is no toolchain installed as
1335 # cc will be a stub that puts up a graphical alert
1336 # prompting the user to install developer tools.
1337 CC_FOR_BUILD=no_compiler_found
1338 else
1339 set_cc_for_build
1332 fi 1340 fi
1333 if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then 1341 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1334 if [ "$CC_FOR_BUILD" != no_compiler_found ]; then 1342 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1335 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1343 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1336 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 1344 grep IS_64BIT_ARCH >/dev/null
1337 grep IS_64BIT_ARCH >/dev/null 1345 then
1338 then 1346 case $UNAME_PROCESSOR in
1339 case $UNAME_PROCESSOR in 1347 i386) UNAME_PROCESSOR=x86_64 ;;
1340 i386) UNAME_PROCESSOR=x86_64 ;; 1348 powerpc) UNAME_PROCESSOR=powerpc64 ;;
1341 powerpc) UNAME_PROCESSOR=powerpc64 ;; 1349 esac
1342 esac 1350 fi
1343 fi 1351 # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1344 # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc 1352 if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1345 if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ 1353 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1346 (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 1354 grep IS_PPC >/dev/null
1347 grep IS_PPC >/dev/null 1355 then
1348 then 1356 UNAME_PROCESSOR=powerpc
1349 UNAME_PROCESSOR=powerpc
1350 fi
1351 fi 1357 fi
1352 elif test "$UNAME_PROCESSOR" = i386 ; then 1358 elif test "$UNAME_PROCESSOR" = i386 ; then
1353 # Avoid executing cc on OS X 10.9, as it ships with a stub 1359 # uname -m returns i386 or x86_64
1354 # that puts up a graphical alert prompting to install 1360 UNAME_PROCESSOR=$UNAME_MACHINE
1355 # developer tools. Any system running Mac OS X 10.7 or
1356 # later (Darwin 11 and later) is required to have a 64-bit
1357 # processor. This is not true of the ARM version of Darwin
1358 # that Apple uses in portable devices.
1359 UNAME_PROCESSOR=x86_64
1360 fi 1361 fi
1361 echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" 1362 echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
1362 exit ;; 1363 exit ;;
diff --git a/build-aux/config.sub b/build-aux/config.sub
index f53af5a2da7..5b158ac41c9 100755
--- a/build-aux/config.sub
+++ b/build-aux/config.sub
@@ -2,7 +2,7 @@
2# Configuration validation subroutine script. 2# Configuration validation subroutine script.
3# Copyright 1992-2019 Free Software Foundation, Inc. 3# Copyright 1992-2019 Free Software Foundation, Inc.
4 4
5timestamp='2019-01-05' 5timestamp='2019-05-23'
6 6
7# This file is free software; you can redistribute it and/or modify it 7# This file is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License as published by 8# under the terms of the GNU General Public License as published by
@@ -1172,7 +1172,7 @@ case $cpu-$vendor in
1172 | asmjs \ 1172 | asmjs \
1173 | ba \ 1173 | ba \
1174 | be32 | be64 \ 1174 | be32 | be64 \
1175 | bfin | bs2000 \ 1175 | bfin | bpf | bs2000 \
1176 | c[123]* | c30 | [cjt]90 | c4x \ 1176 | c[123]* | c30 | [cjt]90 | c4x \
1177 | c8051 | clipper | craynv | csky | cydra \ 1177 | c8051 | clipper | craynv | csky | cydra \
1178 | d10v | d30v | dlx | dsp16xx \ 1178 | d10v | d30v | dlx | dsp16xx \
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex
index ccd112941ac..53f2fc4835b 100644
--- a/doc/misc/texinfo.tex
+++ b/doc/misc/texinfo.tex
@@ -3,7 +3,7 @@
3% Load plain if necessary, i.e., if running under initex. 3% Load plain if necessary, i.e., if running under initex.
4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi 4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
5% 5%
6\def\texinfoversion{2019-04-12.13} 6\def\texinfoversion{2019-05-18.15}
7% 7%
8% Copyright 1985, 1986, 1988, 1990-2019 Free Software Foundation, Inc. 8% Copyright 1985, 1986, 1988, 1990-2019 Free Software Foundation, Inc.
9% 9%
@@ -4952,6 +4952,8 @@ end
4952 \definedummyword\sup 4952 \definedummyword\sup
4953 \definedummyword\textdegree 4953 \definedummyword\textdegree
4954 % 4954 %
4955 \definedummyword\subentry
4956 %
4955 % We want to disable all macros so that they are not expanded by \write. 4957 % We want to disable all macros so that they are not expanded by \write.
4956 \macrolist 4958 \macrolist
4957 \let\value\dummyvalue 4959 \let\value\dummyvalue
@@ -5224,10 +5226,10 @@ end
5224} 5226}
5225 5227
5226\def\indexwriteseealso#1{ 5228\def\indexwriteseealso#1{
5227 \gdef\pagenumbertext{@seealso{#1}}% 5229 \gdef\pagenumbertext{\string\seealso{#1}}%
5228} 5230}
5229\def\indexwriteseeentry#1{ 5231\def\indexwriteseeentry#1{
5230 \gdef\pagenumbertext{@seeentry{#1}}% 5232 \gdef\pagenumbertext{\string\seeentry{#1}}%
5231} 5233}
5232 5234
5233% The default definitions 5235% The default definitions
@@ -5315,6 +5317,15 @@ end
5315% the current value of \escapechar. 5317% the current value of \escapechar.
5316\def\escapeisbackslash{\escapechar=`\\} 5318\def\escapeisbackslash{\escapechar=`\\}
5317 5319
5320% Use \ in index files by default. texi2dvi didn't support @ as as the escape
5321% character (as it checked for "\entry" in the files, and not "@entry"). When
5322% the new version of texi2dvi has had a chance to become more prevalent, then
5323% the escape character can change back to @ again. This should be an easy
5324% change to make now because both @ and \ are only used as escape characters in
5325% index files, never standing for themselves.
5326%
5327\set txiindexescapeisbackslash
5328
5318% Write the entry in \indextext to the index file. 5329% Write the entry in \indextext to the index file.
5319% 5330%
5320\def\doindwrite{% 5331\def\doindwrite{%
diff --git a/lib/flexmember.h b/lib/flexmember.h
index 0d65f6da60f..af17b41d29f 100644
--- a/lib/flexmember.h
+++ b/lib/flexmember.h
@@ -33,11 +33,26 @@
33# define FLEXALIGNOF(type) _Alignof (type) 33# define FLEXALIGNOF(type) _Alignof (type)
34#endif 34#endif
35 35
36/* Upper bound on the size of a struct of type TYPE with a flexible 36/* Yield a properly aligned upper bound on the size of a struct of
37 array member named MEMBER that is followed by N bytes of other data. 37 type TYPE with a flexible array member named MEMBER that is
38 This is not simply sizeof (TYPE) + N, since it may require 38 followed by N bytes of other data. The result is suitable as an
39 alignment on unusually picky C11 platforms, and 39 argument to malloc. For example:
40 FLEXIBLE_ARRAY_MEMBER may be 1 on pre-C11 platforms. 40
41 struct s { int n; char d[FLEXIBLE_ARRAY_MEMBER]; };
42 struct s *p = malloc (FLEXSIZEOF (struct s, d, n * sizeof (char)));
43
44 FLEXSIZEOF (TYPE, MEMBER, N) is not simply (sizeof (TYPE) + N),
45 since FLEXIBLE_ARRAY_MEMBER may be 1 on pre-C11 platforms. Nor is
46 it simply (offsetof (TYPE, MEMBER) + N), as that might yield a size
47 that causes malloc to yield a pointer that is not properly aligned
48 for TYPE; for example, if sizeof (int) == alignof (int) == 4,
49 malloc (offsetof (struct s, d) + 3 * sizeof (char)) is equivalent
50 to malloc (7) and might yield a pointer that is not a multiple of 4
51 (which means the pointer is not properly aligned for struct s),
52 whereas malloc (FLEXSIZEOF (struct s, d, 3 * sizeof (char))) is
53 equivalent to malloc (8) and must yield a pointer that is a
54 multiple of 4.
55
41 Yield a value less than N if and only if arithmetic overflow occurs. */ 56 Yield a value less than N if and only if arithmetic overflow occurs. */
42 57
43#define FLEXSIZEOF(type, member, n) \ 58#define FLEXSIZEOF(type, member, n) \
diff --git a/lib/verify.h b/lib/verify.h
index 6930645a350..f8e4eff026d 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -21,29 +21,37 @@
21#define _GL_VERIFY_H 21#define _GL_VERIFY_H
22 22
23 23
24/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per C11. 24/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert (R, DIAGNOSTIC)
25 This is supported by GCC 4.6.0 and later, in C mode, and its use 25 works as per C11. This is supported by GCC 4.6.0 and later, in C
26 here generates easier-to-read diagnostics when verify (R) fails. 26 mode.
27 27
28 Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11. 28 Define _GL_HAVE__STATIC_ASSERT1 to 1 if _Static_assert (R) works as
29 This is supported by GCC 6.1.0 and later, in C++ mode. 29 per C2X, and define _GL_HAVE_STATIC_ASSERT1 if static_assert (R)
30 30 works as per C++17. This is supported by GCC 9.1 and later.
31 Use this only with GCC. If we were willing to slow 'configure' 31
32 down we could also use it with other compilers, but since this 32 Support compilers claiming conformance to the relevant standard,
33 affects only the quality of diagnostics, why bother? */ 33 and also support GCC when not pedantic. If we were willing to slow
34#if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \ 34 'configure' down we could also use it with other compilers, but
35 && (201112L <= __STDC_VERSION__ || !defined __STRICT_ANSI__) \ 35 since this affects only the quality of diagnostics, why bother? */
36 && !defined __cplusplus) 36#ifndef __cplusplus
37# define _GL_HAVE__STATIC_ASSERT 1 37# if (201112L <= __STDC_VERSION__ \
38#endif 38 || (!defined __STRICT_ANSI__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__)))
39#if (6 <= __GNUC__) && defined __cplusplus 39# define _GL_HAVE__STATIC_ASSERT 1
40# define _GL_HAVE_STATIC_ASSERT 1 40# endif
41# if (202000L <= __STDC_VERSION__ \
42 || (!defined __STRICT_ANSI__ && 9 <= __GNUC__))
43# define _GL_HAVE__STATIC_ASSERT1 1
44# endif
45#else
46# if 201703L <= __cplusplus || 9 <= __GNUC__
47# define _GL_HAVE_STATIC_ASSERT1 1
48# endif
41#endif 49#endif
42 50
43/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other 51/* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other
44 system headers, defines a conflicting _Static_assert that is no 52 system headers, defines a conflicting _Static_assert that is no
45 better than ours; override it. */ 53 better than ours; override it. */
46#ifndef _GL_HAVE_STATIC_ASSERT 54#ifndef _GL_HAVE__STATIC_ASSERT
47# include <stddef.h> 55# include <stddef.h>
48# undef _Static_assert 56# undef _Static_assert
49#endif 57#endif
@@ -141,9 +149,9 @@
141 which do not support _Static_assert, also do not warn about the 149 which do not support _Static_assert, also do not warn about the
142 last declaration mentioned above. 150 last declaration mentioned above.
143 151
144 * GCC warns if -Wnested-externs is enabled and verify() is used 152 * GCC warns if -Wnested-externs is enabled and 'verify' is used
145 within a function body; but inside a function, you can always 153 within a function body; but inside a function, you can always
146 arrange to use verify_expr() instead. 154 arrange to use verify_expr instead.
147 155
148 * In C++, any struct definition inside sizeof is invalid. 156 * In C++, any struct definition inside sizeof is invalid.
149 Use a template type to work around the problem. */ 157 Use a template type to work around the problem. */
@@ -167,11 +175,9 @@
167#define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER) 175#define _GL_GENSYM(prefix) _GL_CONCAT (prefix, _GL_COUNTER)
168 176
169/* Verify requirement R at compile-time, as an integer constant expression 177/* Verify requirement R at compile-time, as an integer constant expression
170 that returns 1. If R is false, fail at compile-time, preferably 178 that returns 1. If R is false, fail at compile-time. */
171 with a diagnostic that includes the string-literal DIAGNOSTIC. */
172 179
173#define _GL_VERIFY_TRUE(R, DIAGNOSTIC) \ 180#define _GL_VERIFY_TRUE(R) (!!sizeof (_GL_VERIFY_TYPE (R)))
174 (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC)))
175 181
176#ifdef __cplusplus 182#ifdef __cplusplus
177# if !GNULIB_defined_struct__gl_verify_type 183# if !GNULIB_defined_struct__gl_verify_type
@@ -181,40 +187,43 @@ template <int w>
181 }; 187 };
182# define GNULIB_defined_struct__gl_verify_type 1 188# define GNULIB_defined_struct__gl_verify_type 1
183# endif 189# endif
184# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ 190# define _GL_VERIFY_TYPE(R) _gl_verify_type<(R) ? 1 : -1>
185 _gl_verify_type<(R) ? 1 : -1> 191#elif defined _GL_HAVE__STATIC_ASSERT1
186#elif defined _GL_HAVE__STATIC_ASSERT 192# define _GL_VERIFY_TYPE(R) \
187# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
188 struct { \ 193 struct { \
189 _Static_assert (R, DIAGNOSTIC); \ 194 _Static_assert (R); \
190 int _gl_dummy; \ 195 int _gl_dummy; \
191 } 196 }
192#else 197#else
193# define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ 198# define _GL_VERIFY_TYPE(R) \
194 struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; } 199 struct { unsigned int _gl_verify_error_if_negative: (R) ? 1 : -1; }
195#endif 200#endif
196 201
197/* Verify requirement R at compile-time, as a declaration without a 202/* Verify requirement R at compile-time, as a declaration without a
198 trailing ';'. If R is false, fail at compile-time, preferably 203 trailing ';'. If R is false, fail at compile-time.
199 with a diagnostic that includes the string-literal DIAGNOSTIC. 204
205 This macro requires three or more arguments but uses at most the first
206 two, so that the _Static_assert macro optionally defined below supports
207 both the C11 two-argument syntax and the C2X one-argument syntax.
200 208
201 Unfortunately, unlike C11, this implementation must appear as an 209 Unfortunately, unlike C11, this implementation must appear as an
202 ordinary declaration, and cannot appear inside struct { ... }. */ 210 ordinary declaration, and cannot appear inside struct { ... }. */
203 211
204#ifdef _GL_HAVE__STATIC_ASSERT 212#if defined _GL_HAVE__STATIC_ASSERT
205# define _GL_VERIFY _Static_assert 213# define _GL_VERIFY(R, DIAGNOSTIC, ...) _Static_assert (R, DIAGNOSTIC)
206#else 214#else
207# define _GL_VERIFY(R, DIAGNOSTIC) \ 215# define _GL_VERIFY(R, DIAGNOSTIC, ...) \
208 extern int (*_GL_GENSYM (_gl_verify_function) (void)) \ 216 extern int (*_GL_GENSYM (_gl_verify_function) (void)) \
209 [_GL_VERIFY_TRUE (R, DIAGNOSTIC)] 217 [_GL_VERIFY_TRUE (R)]
210#endif 218#endif
211 219
212/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */ 220/* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */
213#ifdef _GL_STATIC_ASSERT_H 221#ifdef _GL_STATIC_ASSERT_H
214# if !defined _GL_HAVE__STATIC_ASSERT && !defined _Static_assert 222# if !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert
215# define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC) 223# define _Static_assert(...) \
224 _GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
216# endif 225# endif
217# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert 226# if !defined _GL_HAVE_STATIC_ASSERT1 && !defined static_assert
218# define static_assert _Static_assert /* C11 requires this #define. */ 227# define static_assert _Static_assert /* C11 requires this #define. */
219# endif 228# endif
220#endif 229#endif
@@ -226,31 +235,24 @@ template <int w>
226 assert (R), there is no run-time overhead. 235 assert (R), there is no run-time overhead.
227 236
228 There are two macros, since no single macro can be used in all 237 There are two macros, since no single macro can be used in all
229 contexts in C. verify_true (R) is for scalar contexts, including 238 contexts in C. verify_expr (R, E) is for scalar contexts, including
230 integer constant expression contexts. verify (R) is for declaration 239 integer constant expression contexts. verify (R) is for declaration
231 contexts, e.g., the top level. */ 240 contexts, e.g., the top level. */
232 241
233/* Verify requirement R at compile-time, as an integer constant expression.
234 Return 1. This is equivalent to verify_expr (R, 1).
235
236 verify_true is obsolescent; please use verify_expr instead. */
237
238#define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")")
239
240/* Verify requirement R at compile-time. Return the value of the 242/* Verify requirement R at compile-time. Return the value of the
241 expression E. */ 243 expression E. */
242 244
243#define verify_expr(R, E) \ 245#define verify_expr(R, E) (_GL_VERIFY_TRUE (R) ? (E) : (E))
244 (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E))
245 246
246/* Verify requirement R at compile-time, as a declaration without a 247/* Verify requirement R at compile-time, as a declaration without a
247 trailing ';'. */ 248 trailing ';'. verify (R) acts like static_assert (R) except that
249 it is portable to C11/C++14 and earlier, and its name is shorter
250 and may be more convenient. */
248 251
249#ifdef __GNUC__ 252#ifdef _GL_HAVE__STATIC_ASSERT1
250# define verify(R) _GL_VERIFY (R, "verify (" #R ")") 253# define verify(R) _Static_assert (R)
251#else 254#else
252/* PGI barfs if R is long. Play it safe. */ 255# define verify(R) _GL_VERIFY (R, "verify (...)", -)
253# define verify(R) _GL_VERIFY (R, "verify (...)")
254#endif 256#endif
255 257
256#ifndef __has_builtin 258#ifndef __has_builtin
diff --git a/m4/flexmember.m4 b/m4/flexmember.m4
index 1347068fe3c..c245ab025f6 100644
--- a/m4/flexmember.m4
+++ b/m4/flexmember.m4
@@ -34,12 +34,10 @@ AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER],
34 AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [], 34 AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [],
35 [Define to nothing if C supports flexible array members, and to 35 [Define to nothing if C supports flexible array members, and to
36 1 if it does not. That way, with a declaration like 'struct s 36 1 if it does not. That way, with a declaration like 'struct s
37 { int n; double d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack 37 { int n; short d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack
38 can be used with pre-C99 compilers. 38 can be used with pre-C99 compilers.
39 When computing the size of such an object, don't use 'sizeof (struct s)' 39 Use 'FLEXSIZEOF (struct s, d, N * sizeof (short))' to calculate
40 as it overestimates the size. Use 'offsetof (struct s, d)' instead. 40 the size in bytes of such a struct containing an N-element array.])
41 Don't use 'offsetof (struct s, d@<:@0@:>@)', as this doesn't work with
42 MSVC and with C++ compilers.])
43 else 41 else
44 AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [1]) 42 AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [1])
45 fi 43 fi
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index f648b7a495a..0a7a30e5ae2 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -200,7 +200,6 @@ AC_DEFUN([gl_INIT],
200 gl_BYTESWAP 200 gl_BYTESWAP
201 AC_CHECK_FUNCS_ONCE([readlinkat]) 201 AC_CHECK_FUNCS_ONCE([readlinkat])
202 gl_CLOCK_TIME 202 gl_CLOCK_TIME
203 gl_CLOSE_STREAM
204 gl_MODULE_INDICATOR([close-stream]) 203 gl_MODULE_INDICATOR([close-stream])
205 gl_COUNT_LEADING_ZEROS 204 gl_COUNT_LEADING_ZEROS
206 gl_COUNT_ONE_BITS 205 gl_COUNT_ONE_BITS
@@ -996,7 +995,6 @@ AC_DEFUN([gl_FILE_LIST], [
996 m4/builtin-expect.m4 995 m4/builtin-expect.m4
997 m4/byteswap.m4 996 m4/byteswap.m4
998 m4/clock_time.m4 997 m4/clock_time.m4
999 m4/close-stream.m4
1000 m4/count-leading-zeros.m4 998 m4/count-leading-zeros.m4
1001 m4/count-one-bits.m4 999 m4/count-one-bits.m4
1002 m4/count-trailing-zeros.m4 1000 m4/count-trailing-zeros.m4
diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4
index cadc239a3c6..648edf911fe 100644
--- a/m4/pthread_sigmask.m4
+++ b/m4/pthread_sigmask.m4
@@ -1,4 +1,4 @@
1# pthread_sigmask.m4 serial 16 1# pthread_sigmask.m4 serial 17
2dnl Copyright (C) 2011-2019 Free Software Foundation, Inc. 2dnl Copyright (C) 2011-2019 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -9,103 +9,101 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
9 AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) 9 AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
10 10
11 AC_CHECK_FUNCS_ONCE([pthread_sigmask]) 11 AC_CHECK_FUNCS_ONCE([pthread_sigmask])
12
13 dnl On MinGW pthread_sigmask is just a macro which always returns 0.
14 dnl It does not exist as a real function, which is required by POSIX.
15 AC_CACHE_CHECK([whether pthread_sigmask is a macro],
16 [gl_cv_func_pthread_sigmask_macro],
17 [AC_EGREP_CPP([headers_define_pthread_sigmask], [
18#include <pthread.h>
19#include <signal.h>
20#ifdef pthread_sigmask
21 headers_define_pthread_sigmask
22#endif],
23 [gl_cv_func_pthread_sigmask_macro=yes],
24 [gl_cv_func_pthread_sigmask_macro=no])
25 ])
26
12 LIB_PTHREAD_SIGMASK= 27 LIB_PTHREAD_SIGMASK=
13 28
14 dnl Test whether the gnulib module 'threadlib' is in use. 29 if test $gl_cv_func_pthread_sigmask_macro = yes; then
15 dnl Some packages like Emacs use --avoid=threadlib. 30 dnl pthread_sigmask is a dummy macro.
16 dnl Write the symbol in such a way that it does not cause 'aclocal' to pick 31 HAVE_PTHREAD_SIGMASK=0
17 dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/. 32 dnl Make sure to '#undef pthread_sigmask' before defining it.
18 m4_ifdef([gl_][THREADLIB], [ 33 REPLACE_PTHREAD_SIGMASK=1
19 AC_REQUIRE([gl_][THREADLIB]) 34 else
35 dnl Test whether the gnulib module 'threadlib' is in use.
36 dnl Some packages like Emacs use --avoid=threadlib.
37 dnl Write the symbol in such a way that it does not cause 'aclocal' to pick
38 dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/.
39 m4_ifdef([gl_][THREADLIB], [
40 AC_REQUIRE([gl_][THREADLIB])
20 41
21 if test "$gl_threads_api" = posix; then 42 if test "$gl_threads_api" = posix; then
22 if test $ac_cv_func_pthread_sigmask = yes; then 43 if test $ac_cv_func_pthread_sigmask = yes; then
23 dnl pthread_sigmask is available without -lpthread. 44 dnl pthread_sigmask is available without -lpthread.
24 : 45 :
25 else 46 else
26 if test -n "$LIBMULTITHREAD"; then 47 if test -n "$LIBMULTITHREAD"; then
27 AC_CACHE_CHECK([for pthread_sigmask in $LIBMULTITHREAD], 48 AC_CACHE_CHECK([for pthread_sigmask in $LIBMULTITHREAD],
28 [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD], 49 [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD],
29 [gl_save_LIBS="$LIBS"
30 LIBS="$LIBS $LIBMULTITHREAD"
31 AC_LINK_IFELSE(
32 [AC_LANG_PROGRAM(
33 [[#include <pthread.h>
34 #include <signal.h>
35 ]],
36 [[return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *) 0);]])
37 ],
38 [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=yes],
39 [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no])
40 LIBS="$gl_save_LIBS"
41 ])
42 if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
43 AC_CACHE_CHECK([whether pthread_sigmask is only a macro],
44 [gl_cv_func_pthread_sigmask_is_macro],
45 [gl_save_LIBS="$LIBS" 50 [gl_save_LIBS="$LIBS"
46 LIBS="$LIBS $LIBMULTITHREAD" 51 LIBS="$LIBS $LIBMULTITHREAD"
47 AC_LINK_IFELSE( 52 AC_LINK_IFELSE(
48 [AC_LANG_PROGRAM( 53 [AC_LANG_PROGRAM(
49 [[#include <pthread.h> 54 [[#include <pthread.h>
50 #include <signal.h> 55 #include <signal.h>
51 #undef pthread_sigmask
52 ]], 56 ]],
53 [[return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *) 0);]]) 57 [[return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *) 0);]])
54 ], 58 ],
55 [gl_cv_func_pthread_sigmask_is_macro=no], 59 [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=yes],
56 [gl_cv_func_pthread_sigmask_is_macro=yes]) 60 [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no])
57 LIBS="$gl_save_LIBS" 61 LIBS="$gl_save_LIBS"
58 ]) 62 ])
59 if test $gl_cv_func_pthread_sigmask_is_macro = yes; then 63 if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
60 dnl On MinGW pthread_sigmask is just a macro which always returns 0. 64 dnl pthread_sigmask is available with -pthread or -lpthread.
61 dnl It does not exist as a real function, which is required by POSIX. 65 LIB_PTHREAD_SIGMASK="$LIBMULTITHREAD"
62 REPLACE_PTHREAD_SIGMASK=1 66 else
63 gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no 67 dnl pthread_sigmask is not available at all.
68 HAVE_PTHREAD_SIGMASK=0
64 fi 69 fi
65 fi
66 if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
67 dnl pthread_sigmask is available with -pthread or -lpthread.
68 LIB_PTHREAD_SIGMASK="$LIBMULTITHREAD"
69 else 70 else
70 dnl pthread_sigmask is not available at all. 71 dnl pthread_sigmask is not available at all.
71 HAVE_PTHREAD_SIGMASK=0 72 HAVE_PTHREAD_SIGMASK=0
72 fi 73 fi
74 fi
75 else
76 dnl pthread_sigmask may exist but does not interoperate with the chosen
77 dnl multithreading facility.
78 dnl If "$gl_threads_api" = pth, we could use the function pth_sigmask,
79 dnl but it is equivalent to sigprocmask, so we choose to emulate
80 dnl pthread_sigmask with sigprocmask also in this case. This yields
81 dnl fewer link dependencies.
82 if test $ac_cv_func_pthread_sigmask = yes; then
83 REPLACE_PTHREAD_SIGMASK=1
73 else 84 else
74 dnl pthread_sigmask is not available at all.
75 HAVE_PTHREAD_SIGMASK=0 85 HAVE_PTHREAD_SIGMASK=0
76 fi 86 fi
77 fi 87 fi
78 else 88 ], [
79 dnl pthread_sigmask may exist but does not interoperate with the chosen 89 dnl The module 'threadlib' is not in use, due to --avoid=threadlib being
80 dnl multithreading facility. 90 dnl specified.
81 dnl If "$gl_threads_api" = pth, we could use the function pth_sigmask, 91 dnl The package either has prepared CPPFLAGS and LIBS for use of
82 dnl but it is equivalent to sigprocmask, so we choose to emulate 92 dnl POSIX:2008 threads, or wants to build single-threaded programs.
83 dnl pthread_sigmask with sigprocmask also in this case. This yields fewer
84 dnl link dependencies.
85 if test $ac_cv_func_pthread_sigmask = yes; then 93 if test $ac_cv_func_pthread_sigmask = yes; then
86 REPLACE_PTHREAD_SIGMASK=1 94 dnl pthread_sigmask exists and does not require extra libraries.
95 dnl Assume that it is declared.
96 :
87 else 97 else
98 dnl pthread_sigmask either does not exist or needs extra libraries.
88 HAVE_PTHREAD_SIGMASK=0 99 HAVE_PTHREAD_SIGMASK=0
100 dnl Define the symbol rpl_pthread_sigmask, not pthread_sigmask,
101 dnl so as to not accidentally override the system's pthread_sigmask
102 dnl symbol from libpthread. This is necessary on IRIX 6.5.
103 REPLACE_PTHREAD_SIGMASK=1
89 fi 104 fi
90 fi 105 ])
91 ], [ 106 fi
92 dnl The module 'threadlib' is not in use, due to --avoid=threadlib being
93 dnl specified.
94 dnl The package either has prepared CPPFLAGS and LIBS for use of POSIX:2008
95 dnl threads, or wants to build single-threaded programs.
96 if test $ac_cv_func_pthread_sigmask = yes; then
97 dnl pthread_sigmask exists and does not require extra libraries.
98 dnl Assume that it is declared.
99 :
100 else
101 dnl pthread_sigmask either does not exist or needs extra libraries.
102 HAVE_PTHREAD_SIGMASK=0
103 dnl Define the symbol rpl_pthread_sigmask, not pthread_sigmask,
104 dnl so as to not accidentally override the system's pthread_sigmask
105 dnl symbol from libpthread. This is necessary on IRIX 6.5.
106 REPLACE_PTHREAD_SIGMASK=1
107 fi
108 ])
109 107
110 AC_SUBST([LIB_PTHREAD_SIGMASK]) 108 AC_SUBST([LIB_PTHREAD_SIGMASK])
111 dnl We don't need a variable LTLIB_PTHREAD_SIGMASK, because when 109 dnl We don't need a variable LTLIB_PTHREAD_SIGMASK, because when