From: Paul Eggert Date: Thu, 2 Feb 2017 15:49:55 +0000 (-0800) Subject: Merge from gnulib X-Git-Tag: emacs-26.0.90~858^2~23 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=46aa9a30095241cabef463fd01f71ce9ee50c4dc;p=emacs.git Merge from gnulib 2017-01-30 Port to PGI 16.10 x86-64 2017-01-20 time_rz: fix comment typo 2017-01-14 strftime: %z is -00 if unknown This incorporates: * doc/misc/texinfo.tex, lib/c-ctype.h, lib/strftime.c: * lib/time-internal.h, lib/verify.h: Copy from gnulib. --- diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index c8913ab918e..338bcf65040 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2016-09-18.18} +\def\texinfoversion{2017-01-14.15} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -165,6 +165,9 @@ % Give the space character the catcode for a space. \def\spaceisspace{\catcode`\ =10\relax} +% Likewise for ^^M, the end of line character. +\def\endlineisspace{\catcode13=10\relax} + \chardef\dashChar = `\- \chardef\slashChar = `\/ \chardef\underChar = `\_ @@ -950,21 +953,14 @@ where each line of input produces a line of output.} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment -% -\def\comment{\begingroup \catcode`\^^M=\active% -\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other\commentxxx}% -{\catcode`\^^M=\active% -\gdef\commentxxx#1^^M{\endgroup% -\futurelet\nexttoken\commentxxxx}% -\gdef\commentxxxx{\ifx\nexttoken\aftermacro\expandafter\comment\fi}% -} \def\c{\begingroup \catcode`\^^M=\active% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \cxxx} {\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}} -% See comment in \scanmacro about why the definitions of @c and @comment differ +% +\let\comment\c % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. @@ -8031,9 +8027,6 @@ end } \fi -\let\aftermacroxxx\relax -\def\aftermacro{\aftermacroxxx} - % alias because \c means cedilla in @tex or @math \let\texinfoc=\c @@ -8055,18 +8048,13 @@ end \catcode`\\=\active % % Process the macro body under the current catcode regime. - \scantokens{#1@texinfoc}\aftermacro% + \scantokens{#1@texinfoc}% % \catcode`\@=\savedcatcodeone \catcode`\\=\savedcatcodetwo % % The \texinfoc is to remove the \newlinechar added by \scantokens, and % can be noticed by \parsearg. - % The \aftermacro allows a \comment at the end of the macro definition - % to duplicate itself past the final \newlinechar added by \scantokens: - % this is used in the definition of \group to comment out a newline. We - % don't do the same for \c to support Texinfo files with macros that ended - % with a @c, which should no longer be necessary. % We avoid surrounding the call to \scantokens with \bgroup and \egroup % to allow macros to open or close groups themselves. } @@ -8538,6 +8526,13 @@ end \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup + \noexpand\spaceisspace + \noexpand\endlineisspace + \noexpand\expandafter % skip any whitespace after the macro name. + \expandafter\noexpand\csname\the\macname @@@\endcsname}% + \expandafter\xdef\csname\the\macname @@@\endcsname{% + \egroup \noexpand\scanmacro{\macrobody}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% diff --git a/lib/c-ctype.h b/lib/c-ctype.h index faf21581ca0..bcdba6b9962 100644 --- a/lib/c-ctype.h +++ b/lib/c-ctype.h @@ -115,16 +115,16 @@ extern "C" { /* Cases for lowercase hex letters, and lowercase letters, all offset by N. */ -#define _C_CTYPE_LOWER_A_THRU_F_N(n) \ - case 'a' + (n): case 'b' + (n): case 'c' + (n): case 'd' + (n): \ - case 'e' + (n): case 'f' + (n) -#define _C_CTYPE_LOWER_N(n) \ - _C_CTYPE_LOWER_A_THRU_F_N(n): \ - case 'g' + (n): case 'h' + (n): case 'i' + (n): case 'j' + (n): \ - case 'k' + (n): case 'l' + (n): case 'm' + (n): case 'n' + (n): \ - case 'o' + (n): case 'p' + (n): case 'q' + (n): case 'r' + (n): \ - case 's' + (n): case 't' + (n): case 'u' + (n): case 'v' + (n): \ - case 'w' + (n): case 'x' + (n): case 'y' + (n): case 'z' + (n) +#define _C_CTYPE_LOWER_A_THRU_F_N(N) \ + case 'a' + (N): case 'b' + (N): case 'c' + (N): case 'd' + (N): \ + case 'e' + (N): case 'f' + (N) +#define _C_CTYPE_LOWER_N(N) \ + _C_CTYPE_LOWER_A_THRU_F_N(N): \ + case 'g' + (N): case 'h' + (N): case 'i' + (N): case 'j' + (N): \ + case 'k' + (N): case 'l' + (N): case 'm' + (N): case 'n' + (N): \ + case 'o' + (N): case 'p' + (N): case 'q' + (N): case 'r' + (N): \ + case 's' + (N): case 't' + (N): case 'u' + (N): case 'v' + (N): \ + case 'w' + (N): case 'x' + (N): case 'y' + (N): case 'z' + (N) /* Cases for hex letters, digits, lower, punct, and upper. */ diff --git a/lib/strftime.c b/lib/strftime.c index 9aabcc6748c..e4d78ef7011 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -739,11 +739,10 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) /* The mask is not what you might think. When the ordinal i'th bit is set, insert a colon before the i'th digit of the time zone representation. */ -#define DO_TZ_OFFSET(d, negative, mask, v) \ +#define DO_TZ_OFFSET(d, mask, v) \ do \ { \ digits = d; \ - negative_number = negative; \ tz_colon_mask = mask; \ u_number_value = v; \ goto do_tz_offset; \ @@ -1444,6 +1443,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) } #endif + negative_number = diff < 0 || (diff == 0 && *zone == '-'); hour_diff = diff / 60 / 60; min_diff = diff / 60 % 60; sec_diff = diff % 60; @@ -1451,13 +1451,13 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) switch (colons) { case 0: /* +hhmm */ - DO_TZ_OFFSET (5, diff < 0, 0, hour_diff * 100 + min_diff); + DO_TZ_OFFSET (5, 0, hour_diff * 100 + min_diff); case 1: tz_hh_mm: /* +hh:mm */ - DO_TZ_OFFSET (6, diff < 0, 04, hour_diff * 100 + min_diff); + DO_TZ_OFFSET (6, 04, hour_diff * 100 + min_diff); case 2: tz_hh_mm_ss: /* +hh:mm:ss */ - DO_TZ_OFFSET (9, diff < 0, 024, + DO_TZ_OFFSET (9, 024, hour_diff * 10000 + min_diff * 100 + sec_diff); case 3: /* +hh if possible, else +hh:mm, else +hh:mm:ss */ @@ -1465,7 +1465,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) goto tz_hh_mm_ss; if (min_diff != 0) goto tz_hh_mm; - DO_TZ_OFFSET (3, diff < 0, 0, hour_diff); + DO_TZ_OFFSET (3, 0, hour_diff); default: goto bad_format; diff --git a/lib/time-internal.h b/lib/time-internal.h index 79cb5621991..bf22834b2e1 100644 --- a/lib/time-internal.h +++ b/lib/time-internal.h @@ -38,8 +38,8 @@ struct tm_zone /* A sequence of null-terminated strings packed next to each other. The strings are followed by an extra null byte. If TZ_IS_SET, there must be at least one string and the first string (which is - actually a TZ environment value value) may be empty. Otherwise - all strings must be nonempty. + actually a TZ environment value) may be empty. Otherwise all + strings must be nonempty. Abbreviations are stored here because otherwise the values of tm_zone and/or tzname would be dead after changing TZ and calling diff --git a/lib/verify.h b/lib/verify.h index dcaf7cab938..dcba9c8cb0a 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -248,7 +248,12 @@ template /* Verify requirement R at compile-time, as a declaration without a trailing ';'. */ -#define verify(R) _GL_VERIFY (R, "verify (" #R ")") +#ifdef __GNUC__ +# define verify(R) _GL_VERIFY (R, "verify (" #R ")") +#else +/* PGI barfs if R is long. Play it safe. */ +# define verify(R) _GL_VERIFY (R, "verify (...)") +#endif #ifndef __has_builtin # define __has_builtin(x) 0