diff options
| author | Paul Eggert | 2017-02-02 07:49:55 -0800 |
|---|---|---|
| committer | Paul Eggert | 2017-02-02 07:50:22 -0800 |
| commit | 46aa9a30095241cabef463fd01f71ce9ee50c4dc (patch) | |
| tree | 7c28ccb5f765954c760bdb750fd7b5978ef7114f | |
| parent | a362b56b51f49963dbb63cd318967bca9b9fef74 (diff) | |
| download | emacs-46aa9a30095241cabef463fd01f71ce9ee50c4dc.tar.gz emacs-46aa9a30095241cabef463fd01f71ce9ee50c4dc.zip | |
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.
| -rw-r--r-- | doc/misc/texinfo.tex | 33 | ||||
| -rw-r--r-- | lib/c-ctype.h | 20 | ||||
| -rw-r--r-- | lib/strftime.c | 12 | ||||
| -rw-r--r-- | lib/time-internal.h | 4 | ||||
| -rw-r--r-- | lib/verify.h | 7 |
5 files changed, 38 insertions, 38 deletions
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 @@ | |||
| 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{2016-09-18.18} | 6 | \def\texinfoversion{2017-01-14.15} |
| 7 | % | 7 | % |
| 8 | % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, | 8 | % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, |
| 9 | % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, | 9 | % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, |
| @@ -165,6 +165,9 @@ | |||
| 165 | % Give the space character the catcode for a space. | 165 | % Give the space character the catcode for a space. |
| 166 | \def\spaceisspace{\catcode`\ =10\relax} | 166 | \def\spaceisspace{\catcode`\ =10\relax} |
| 167 | 167 | ||
| 168 | % Likewise for ^^M, the end of line character. | ||
| 169 | \def\endlineisspace{\catcode13=10\relax} | ||
| 170 | |||
| 168 | \chardef\dashChar = `\- | 171 | \chardef\dashChar = `\- |
| 169 | \chardef\slashChar = `\/ | 172 | \chardef\slashChar = `\/ |
| 170 | \chardef\underChar = `\_ | 173 | \chardef\underChar = `\_ |
| @@ -950,21 +953,14 @@ where each line of input produces a line of output.} | |||
| 950 | % @comment ...line which is ignored... | 953 | % @comment ...line which is ignored... |
| 951 | % @c is the same as @comment | 954 | % @c is the same as @comment |
| 952 | % @ignore ... @end ignore is another way to write a comment | 955 | % @ignore ... @end ignore is another way to write a comment |
| 953 | % | ||
| 954 | \def\comment{\begingroup \catcode`\^^M=\active% | ||
| 955 | \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other\commentxxx}% | ||
| 956 | 956 | ||
| 957 | {\catcode`\^^M=\active% | ||
| 958 | \gdef\commentxxx#1^^M{\endgroup% | ||
| 959 | \futurelet\nexttoken\commentxxxx}% | ||
| 960 | \gdef\commentxxxx{\ifx\nexttoken\aftermacro\expandafter\comment\fi}% | ||
| 961 | } | ||
| 962 | 957 | ||
| 963 | \def\c{\begingroup \catcode`\^^M=\active% | 958 | \def\c{\begingroup \catcode`\^^M=\active% |
| 964 | \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% | 959 | \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% |
| 965 | \cxxx} | 960 | \cxxx} |
| 966 | {\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}} | 961 | {\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}} |
| 967 | % See comment in \scanmacro about why the definitions of @c and @comment differ | 962 | % |
| 963 | \let\comment\c | ||
| 968 | 964 | ||
| 969 | % @paragraphindent NCHARS | 965 | % @paragraphindent NCHARS |
| 970 | % We'll use ems for NCHARS, close enough. | 966 | % We'll use ems for NCHARS, close enough. |
| @@ -8031,9 +8027,6 @@ end | |||
| 8031 | } | 8027 | } |
| 8032 | \fi | 8028 | \fi |
| 8033 | 8029 | ||
| 8034 | \let\aftermacroxxx\relax | ||
| 8035 | \def\aftermacro{\aftermacroxxx} | ||
| 8036 | |||
| 8037 | % alias because \c means cedilla in @tex or @math | 8030 | % alias because \c means cedilla in @tex or @math |
| 8038 | \let\texinfoc=\c | 8031 | \let\texinfoc=\c |
| 8039 | 8032 | ||
| @@ -8055,18 +8048,13 @@ end | |||
| 8055 | \catcode`\\=\active | 8048 | \catcode`\\=\active |
| 8056 | % | 8049 | % |
| 8057 | % Process the macro body under the current catcode regime. | 8050 | % Process the macro body under the current catcode regime. |
| 8058 | \scantokens{#1@texinfoc}\aftermacro% | 8051 | \scantokens{#1@texinfoc}% |
| 8059 | % | 8052 | % |
| 8060 | \catcode`\@=\savedcatcodeone | 8053 | \catcode`\@=\savedcatcodeone |
| 8061 | \catcode`\\=\savedcatcodetwo | 8054 | \catcode`\\=\savedcatcodetwo |
| 8062 | % | 8055 | % |
| 8063 | % The \texinfoc is to remove the \newlinechar added by \scantokens, and | 8056 | % The \texinfoc is to remove the \newlinechar added by \scantokens, and |
| 8064 | % can be noticed by \parsearg. | 8057 | % can be noticed by \parsearg. |
| 8065 | % The \aftermacro allows a \comment at the end of the macro definition | ||
| 8066 | % to duplicate itself past the final \newlinechar added by \scantokens: | ||
| 8067 | % this is used in the definition of \group to comment out a newline. We | ||
| 8068 | % don't do the same for \c to support Texinfo files with macros that ended | ||
| 8069 | % with a @c, which should no longer be necessary. | ||
| 8070 | % We avoid surrounding the call to \scantokens with \bgroup and \egroup | 8058 | % We avoid surrounding the call to \scantokens with \bgroup and \egroup |
| 8071 | % to allow macros to open or close groups themselves. | 8059 | % to allow macros to open or close groups themselves. |
| 8072 | } | 8060 | } |
| @@ -8538,6 +8526,13 @@ end | |||
| 8538 | \ifcase\paramno | 8526 | \ifcase\paramno |
| 8539 | % 0 | 8527 | % 0 |
| 8540 | \expandafter\xdef\csname\the\macname\endcsname{% | 8528 | \expandafter\xdef\csname\the\macname\endcsname{% |
| 8529 | \bgroup | ||
| 8530 | \noexpand\spaceisspace | ||
| 8531 | \noexpand\endlineisspace | ||
| 8532 | \noexpand\expandafter % skip any whitespace after the macro name. | ||
| 8533 | \expandafter\noexpand\csname\the\macname @@@\endcsname}% | ||
| 8534 | \expandafter\xdef\csname\the\macname @@@\endcsname{% | ||
| 8535 | \egroup | ||
| 8541 | \noexpand\scanmacro{\macrobody}}% | 8536 | \noexpand\scanmacro{\macrobody}}% |
| 8542 | \or % 1 | 8537 | \or % 1 |
| 8543 | \expandafter\xdef\csname\the\macname\endcsname{% | 8538 | \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" { | |||
| 115 | 115 | ||
| 116 | /* Cases for lowercase hex letters, and lowercase letters, all offset by N. */ | 116 | /* Cases for lowercase hex letters, and lowercase letters, all offset by N. */ |
| 117 | 117 | ||
| 118 | #define _C_CTYPE_LOWER_A_THRU_F_N(n) \ | 118 | #define _C_CTYPE_LOWER_A_THRU_F_N(N) \ |
| 119 | case 'a' + (n): case 'b' + (n): case 'c' + (n): case 'd' + (n): \ | 119 | case 'a' + (N): case 'b' + (N): case 'c' + (N): case 'd' + (N): \ |
| 120 | case 'e' + (n): case 'f' + (n) | 120 | case 'e' + (N): case 'f' + (N) |
| 121 | #define _C_CTYPE_LOWER_N(n) \ | 121 | #define _C_CTYPE_LOWER_N(N) \ |
| 122 | _C_CTYPE_LOWER_A_THRU_F_N(n): \ | 122 | _C_CTYPE_LOWER_A_THRU_F_N(N): \ |
| 123 | case 'g' + (n): case 'h' + (n): case 'i' + (n): case 'j' + (n): \ | 123 | case 'g' + (N): case 'h' + (N): case 'i' + (N): case 'j' + (N): \ |
| 124 | case 'k' + (n): case 'l' + (n): case 'm' + (n): case 'n' + (n): \ | 124 | case 'k' + (N): case 'l' + (N): case 'm' + (N): case 'n' + (N): \ |
| 125 | case 'o' + (n): case 'p' + (n): case 'q' + (n): case 'r' + (n): \ | 125 | case 'o' + (N): case 'p' + (N): case 'q' + (N): case 'r' + (N): \ |
| 126 | case 's' + (n): case 't' + (n): case 'u' + (n): case 'v' + (n): \ | 126 | case 's' + (N): case 't' + (N): case 'u' + (N): case 'v' + (N): \ |
| 127 | case 'w' + (n): case 'x' + (n): case 'y' + (n): case 'z' + (n) | 127 | case 'w' + (N): case 'x' + (N): case 'y' + (N): case 'z' + (N) |
| 128 | 128 | ||
| 129 | /* Cases for hex letters, digits, lower, punct, and upper. */ | 129 | /* Cases for hex letters, digits, lower, punct, and upper. */ |
| 130 | 130 | ||
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) | |||
| 739 | /* The mask is not what you might think. | 739 | /* The mask is not what you might think. |
| 740 | When the ordinal i'th bit is set, insert a colon | 740 | When the ordinal i'th bit is set, insert a colon |
| 741 | before the i'th digit of the time zone representation. */ | 741 | before the i'th digit of the time zone representation. */ |
| 742 | #define DO_TZ_OFFSET(d, negative, mask, v) \ | 742 | #define DO_TZ_OFFSET(d, mask, v) \ |
| 743 | do \ | 743 | do \ |
| 744 | { \ | 744 | { \ |
| 745 | digits = d; \ | 745 | digits = d; \ |
| 746 | negative_number = negative; \ | ||
| 747 | tz_colon_mask = mask; \ | 746 | tz_colon_mask = mask; \ |
| 748 | u_number_value = v; \ | 747 | u_number_value = v; \ |
| 749 | goto do_tz_offset; \ | 748 | goto do_tz_offset; \ |
| @@ -1444,6 +1443,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) | |||
| 1444 | } | 1443 | } |
| 1445 | #endif | 1444 | #endif |
| 1446 | 1445 | ||
| 1446 | negative_number = diff < 0 || (diff == 0 && *zone == '-'); | ||
| 1447 | hour_diff = diff / 60 / 60; | 1447 | hour_diff = diff / 60 / 60; |
| 1448 | min_diff = diff / 60 % 60; | 1448 | min_diff = diff / 60 % 60; |
| 1449 | sec_diff = diff % 60; | 1449 | sec_diff = diff % 60; |
| @@ -1451,13 +1451,13 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) | |||
| 1451 | switch (colons) | 1451 | switch (colons) |
| 1452 | { | 1452 | { |
| 1453 | case 0: /* +hhmm */ | 1453 | case 0: /* +hhmm */ |
| 1454 | DO_TZ_OFFSET (5, diff < 0, 0, hour_diff * 100 + min_diff); | 1454 | DO_TZ_OFFSET (5, 0, hour_diff * 100 + min_diff); |
| 1455 | 1455 | ||
| 1456 | case 1: tz_hh_mm: /* +hh:mm */ | 1456 | case 1: tz_hh_mm: /* +hh:mm */ |
| 1457 | DO_TZ_OFFSET (6, diff < 0, 04, hour_diff * 100 + min_diff); | 1457 | DO_TZ_OFFSET (6, 04, hour_diff * 100 + min_diff); |
| 1458 | 1458 | ||
| 1459 | case 2: tz_hh_mm_ss: /* +hh:mm:ss */ | 1459 | case 2: tz_hh_mm_ss: /* +hh:mm:ss */ |
| 1460 | DO_TZ_OFFSET (9, diff < 0, 024, | 1460 | DO_TZ_OFFSET (9, 024, |
| 1461 | hour_diff * 10000 + min_diff * 100 + sec_diff); | 1461 | hour_diff * 10000 + min_diff * 100 + sec_diff); |
| 1462 | 1462 | ||
| 1463 | case 3: /* +hh if possible, else +hh:mm, else +hh:mm:ss */ | 1463 | 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) | |||
| 1465 | goto tz_hh_mm_ss; | 1465 | goto tz_hh_mm_ss; |
| 1466 | if (min_diff != 0) | 1466 | if (min_diff != 0) |
| 1467 | goto tz_hh_mm; | 1467 | goto tz_hh_mm; |
| 1468 | DO_TZ_OFFSET (3, diff < 0, 0, hour_diff); | 1468 | DO_TZ_OFFSET (3, 0, hour_diff); |
| 1469 | 1469 | ||
| 1470 | default: | 1470 | default: |
| 1471 | goto bad_format; | 1471 | 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 | |||
| 38 | /* A sequence of null-terminated strings packed next to each other. | 38 | /* A sequence of null-terminated strings packed next to each other. |
| 39 | The strings are followed by an extra null byte. If TZ_IS_SET, | 39 | The strings are followed by an extra null byte. If TZ_IS_SET, |
| 40 | there must be at least one string and the first string (which is | 40 | there must be at least one string and the first string (which is |
| 41 | actually a TZ environment value value) may be empty. Otherwise | 41 | actually a TZ environment value) may be empty. Otherwise all |
| 42 | all strings must be nonempty. | 42 | strings must be nonempty. |
| 43 | 43 | ||
| 44 | Abbreviations are stored here because otherwise the values of | 44 | Abbreviations are stored here because otherwise the values of |
| 45 | tm_zone and/or tzname would be dead after changing TZ and calling | 45 | 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 <int w> | |||
| 248 | /* Verify requirement R at compile-time, as a declaration without a | 248 | /* Verify requirement R at compile-time, as a declaration without a |
| 249 | trailing ';'. */ | 249 | trailing ';'. */ |
| 250 | 250 | ||
| 251 | #define verify(R) _GL_VERIFY (R, "verify (" #R ")") | 251 | #ifdef __GNUC__ |
| 252 | # define verify(R) _GL_VERIFY (R, "verify (" #R ")") | ||
| 253 | #else | ||
| 254 | /* PGI barfs if R is long. Play it safe. */ | ||
| 255 | # define verify(R) _GL_VERIFY (R, "verify (...)") | ||
| 256 | #endif | ||
| 252 | 257 | ||
| 253 | #ifndef __has_builtin | 258 | #ifndef __has_builtin |
| 254 | # define __has_builtin(x) 0 | 259 | # define __has_builtin(x) 0 |