aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Eggert2018-08-27 18:59:46 -0700
committerPaul Eggert2018-08-27 19:00:14 -0700
commitf1acdff5e04df90821732333c1bb9d8f586f08d2 (patch)
tree71b9a449169d96a7eaeb1bf07d0f14327cf9bfa0 /lib
parent717b0341aafb9ae9b93395dba1192b12c4459f0c (diff)
downloademacs-f1acdff5e04df90821732333c1bb9d8f586f08d2.tar.gz
emacs-f1acdff5e04df90821732333c1bb9d8f586f08d2.zip
Update from Gnulib
* build-aux/config.sub, lib/intprops.h, lib/regex_internal.c: * lib/regex_internal.h, lib/unistd.in.h, m4/limits-h.m4: * m4/stdint.m4, m4/unistd_h.m4: Copy from Gnulib. * lib/gnulib.mk.in: Regenerate.
Diffstat (limited to 'lib')
-rw-r--r--lib/gnulib.mk.in6
-rw-r--r--lib/intprops.h16
-rw-r--r--lib/regex_internal.c4
-rw-r--r--lib/regex_internal.h3
-rw-r--r--lib/unistd.in.h30
5 files changed, 50 insertions, 9 deletions
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index 666105b74bb..2e265b3068b 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -303,6 +303,7 @@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
303GNULIB_GETLOGIN = @GNULIB_GETLOGIN@ 303GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
304GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@ 304GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
305GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@ 305GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
306GNULIB_GETPASS = @GNULIB_GETPASS@
306GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ 307GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
307GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ 308GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
308GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ 309GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
@@ -548,6 +549,7 @@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
548HAVE_GETLOGIN = @HAVE_GETLOGIN@ 549HAVE_GETLOGIN = @HAVE_GETLOGIN@
549HAVE_GETOPT_H = @HAVE_GETOPT_H@ 550HAVE_GETOPT_H = @HAVE_GETOPT_H@
550HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ 551HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
552HAVE_GETPASS = @HAVE_GETPASS@
551HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ 553HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
552HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@ 554HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
553HAVE_GRANTPT = @HAVE_GRANTPT@ 555HAVE_GRANTPT = @HAVE_GRANTPT@
@@ -854,6 +856,7 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
854REPLACE_GETLINE = @REPLACE_GETLINE@ 856REPLACE_GETLINE = @REPLACE_GETLINE@
855REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@ 857REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
856REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@ 858REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
859REPLACE_GETPASS = @REPLACE_GETPASS@
857REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ 860REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
858REPLACE_GMTIME = @REPLACE_GMTIME@ 861REPLACE_GMTIME = @REPLACE_GMTIME@
859REPLACE_ISATTY = @REPLACE_ISATTY@ 862REPLACE_ISATTY = @REPLACE_ISATTY@
@@ -3098,6 +3101,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
3098 -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \ 3101 -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \
3099 -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \ 3102 -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \
3100 -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \ 3103 -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \
3104 -e 's/@''GNULIB_GETPASS''@/$(GNULIB_GETPASS)/g' \
3101 -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \ 3105 -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
3102 -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \ 3106 -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
3103 -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \ 3107 -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \
@@ -3141,6 +3145,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
3141 -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ 3145 -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
3142 -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ 3146 -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
3143 -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ 3147 -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
3148 -e 's|@''HAVE_GETPASS''@|$(HAVE_GETPASS)|g' \
3144 -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ 3149 -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
3145 -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ 3150 -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
3146 -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ 3151 -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
@@ -3184,6 +3189,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
3184 -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \ 3189 -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
3185 -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \ 3190 -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
3186 -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \ 3191 -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
3192 -e 's|@''REPLACE_GETPASS''@|$(REPLACE_GETPASS)|g' \
3187 -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \ 3193 -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
3188 -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \ 3194 -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
3189 -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \ 3195 -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
diff --git a/lib/intprops.h b/lib/intprops.h
index 15e470cbc6e..3d6b3cf4d9b 100644
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -22,12 +22,13 @@
22 22
23#include <limits.h> 23#include <limits.h>
24 24
25/* Return a value with the common real type of E and V and the value of V. */ 25/* Return a value with the common real type of E and V and the value of V.
26#define _GL_INT_CONVERT(e, v) (0 * (e) + (v)) 26 Do not evaluate E. */
27#define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v))
27 28
28/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see 29/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
29 <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>. */ 30 <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>. */
30#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v)) 31#define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v))
31 32
32/* The extra casts in the following macros work around compiler bugs, 33/* The extra casts in the following macros work around compiler bugs,
33 e.g., in Cray C 5.0.3.0. */ 34 e.g., in Cray C 5.0.3.0. */
@@ -40,13 +41,14 @@
40#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) 41#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
41 42
42/* Return 1 if the real expression E, after promotion, has a 43/* Return 1 if the real expression E, after promotion, has a
43 signed or floating type. */ 44 signed or floating type. Do not evaluate E. */
44#define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) 45#define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
45 46
46 47
47/* Minimum and maximum values for integer types and expressions. */ 48/* Minimum and maximum values for integer types and expressions. */
48 49
49/* The width in bits of the integer type or expression T. 50/* The width in bits of the integer type or expression T.
51 Do not evaluate T.
50 Padding bits are not supported; this is checked at compile-time below. */ 52 Padding bits are not supported; this is checked at compile-time below. */
51#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) 53#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
52 54
@@ -58,7 +60,7 @@
58 : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1))) 60 : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
59 61
60/* The maximum and minimum values for the type of the expression E, 62/* The maximum and minimum values for the type of the expression E,
61 after integer promotion. E should not have side effects. */ 63 after integer promotion. E is not evaluated. */
62#define _GL_INT_MINIMUM(e) \ 64#define _GL_INT_MINIMUM(e) \
63 (EXPR_SIGNED (e) \ 65 (EXPR_SIGNED (e) \
64 ? ~ _GL_SIGNED_INT_MAXIMUM (e) \ 66 ? ~ _GL_SIGNED_INT_MAXIMUM (e) \
@@ -340,8 +342,8 @@
340 Arguments should be free of side effects. */ 342 Arguments should be free of side effects. */
341#define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \ 343#define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \
342 op_result_overflow (a, b, \ 344 op_result_overflow (a, b, \
343 _GL_INT_MINIMUM (0 * (b) + (a)), \ 345 _GL_INT_MINIMUM ((1 ? 0 : (b)) + (a)), \
344 _GL_INT_MAXIMUM (0 * (b) + (a))) 346 _GL_INT_MAXIMUM ((1 ? 0 : (b)) + (a)))
345 347
346/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R. 348/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
347 Return 1 if the result overflows. See above for restrictions. */ 349 Return 1 if the result overflows. See above for restrictions. */
diff --git a/lib/regex_internal.c b/lib/regex_internal.c
index 32373565e6d..e3ce4abfa6b 100644
--- a/lib/regex_internal.c
+++ b/lib/regex_internal.c
@@ -317,7 +317,7 @@ build_wcs_upper_buffer (re_string_t *pstr)
317 mbclen = __mbrtowc (&wc, 317 mbclen = __mbrtowc (&wc,
318 ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx 318 ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx
319 + byte_idx), remain_len, &pstr->cur_state); 319 + byte_idx), remain_len, &pstr->cur_state);
320 if (BE (mbclen < (size_t) -2, 1)) 320 if (BE (0 < mbclen && mbclen < (size_t) -2, 1))
321 { 321 {
322 wchar_t wcu = __towupper (wc); 322 wchar_t wcu = __towupper (wc);
323 if (wcu != wc) 323 if (wcu != wc)
@@ -386,7 +386,7 @@ build_wcs_upper_buffer (re_string_t *pstr)
386 else 386 else
387 p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + src_idx; 387 p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + src_idx;
388 mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state); 388 mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state);
389 if (BE (mbclen < (size_t) -2, 1)) 389 if (BE (0 < mbclen && mbclen < (size_t) -2, 1))
390 { 390 {
391 wchar_t wcu = __towupper (wc); 391 wchar_t wcu = __towupper (wc);
392 if (wcu != wc) 392 if (wcu != wc)
diff --git a/lib/regex_internal.h b/lib/regex_internal.h
index 7bbe802bc53..dd0900b719f 100644
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -149,7 +149,10 @@
149/* Rename to standard API for using out of glibc. */ 149/* Rename to standard API for using out of glibc. */
150#ifndef _LIBC 150#ifndef _LIBC
151# undef __wctype 151# undef __wctype
152# undef __iswalnum
152# undef __iswctype 153# undef __iswctype
154# undef __towlower
155# undef __towupper
153# define __wctype wctype 156# define __wctype wctype
154# define __iswalnum iswalnum 157# define __iswalnum iswalnum
155# define __iswctype iswctype 158# define __iswctype iswctype
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index 55bbb6ca3b7..66f254d60f5 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -935,6 +935,36 @@ _GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
935#endif 935#endif
936 936
937 937
938#if @GNULIB_GETPASS@
939/* Function getpass() from module 'getpass':
940 Read a password from /dev/tty or stdin.
941 Function getpass() from module 'getpass-gnu':
942 Read a password of arbitrary length from /dev/tty or stdin. */
943# if @REPLACE_GETPASS@
944# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
945# undef getpass
946# define getpass rpl_getpass
947# endif
948_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt)
949 _GL_ARG_NONNULL ((1)));
950_GL_CXXALIAS_RPL (getpass, char *, (const char *prompt));
951# else
952# if !@HAVE_GETPASS@
953_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt)
954 _GL_ARG_NONNULL ((1)));
955# endif
956_GL_CXXALIAS_SYS (getpass, char *, (const char *prompt));
957# endif
958_GL_CXXALIASWARN (getpass);
959#elif defined GNULIB_POSIXCHECK
960# undef getpass
961# if HAVE_RAW_DECL_GETPASS
962_GL_WARN_ON_USE (getpass, "getpass is unportable - "
963 "use gnulib module getpass or getpass-gnu for portability");
964# endif
965#endif
966
967
938#if @GNULIB_GETUSERSHELL@ 968#if @GNULIB_GETUSERSHELL@
939/* Return the next valid login shell on the system, or NULL when the end of 969/* Return the next valid login shell on the system, or NULL when the end of
940 the list has been reached. */ 970 the list has been reached. */