diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2022-11-26 10:49:04 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2022-11-26 10:56:53 -0800 |
commit | b27e8f26284770162cc9e9d95d4d273902d35927 (patch) | |
tree | 4d51d3b369f849c8ef5f0f9d58ea0779f63e2519 | |
parent | d440ca47ed6251f134e87386853798228983dd85 (diff) | |
download | emacs-b27e8f26284770162cc9e9d95d4d273902d35927.tar.gz emacs-b27e8f26284770162cc9e9d95d4d273902d35927.tar.bz2 emacs-b27e8f26284770162cc9e9d95d4d273902d35927.zip |
Update from Gnulib by running admin/merge-gnulib
-rwxr-xr-x | build-aux/config.guess | 8 | ||||
-rwxr-xr-x | build-aux/config.sub | 27 | ||||
-rw-r--r-- | doc/misc/texinfo.tex | 428 | ||||
-rw-r--r-- | lib/canonicalize-lgpl.c | 122 | ||||
-rw-r--r-- | lib/gnulib.mk.in | 136 | ||||
-rw-r--r-- | lib/malloc/scratch_buffer.h | 16 | ||||
-rw-r--r-- | lib/scratch_buffer.h | 10 | ||||
-rw-r--r-- | lib/stat-time.h | 5 | ||||
-rw-r--r-- | m4/assert_h.m4 | 6 | ||||
-rw-r--r-- | m4/gnulib-comp.m4 | 78 | ||||
-rw-r--r-- | m4/pthread_sigmask.m4 | 7 |
11 files changed, 486 insertions, 357 deletions
diff --git a/build-aux/config.guess b/build-aux/config.guess index a419d8643b6..980b0208381 100755 --- a/build-aux/config.guess +++ b/build-aux/config.guess @@ -4,7 +4,7 @@ # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2022-08-01' +timestamp='2022-09-17' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -966,6 +966,12 @@ EOF GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; + x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-pc-managarm-mlibc" + ;; + *:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" + ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; diff --git a/build-aux/config.sub b/build-aux/config.sub index fbaa37f2352..baf1512b3c0 100755 --- a/build-aux/config.sub +++ b/build-aux/config.sub @@ -4,7 +4,7 @@ # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2022-08-01' +timestamp='2022-09-17' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -145,7 +145,7 @@ case $1 in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova*) + | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*) basic_machine=$field1 basic_os=$maybe_os ;; @@ -1341,6 +1341,10 @@ EOF kernel=linux os=`echo "$basic_os" | sed -e 's|linux|gnu|'` ;; + managarm*) + kernel=managarm + os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'` + ;; *) kernel= os=$basic_os @@ -1754,7 +1758,7 @@ case $os in | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ - | fiwix* ) + | fiwix* | mlibc* ) ;; # This one is extra strict with allowed versions sco3.2v2 | sco3.2v[4-9]* | sco5v6*) @@ -1762,6 +1766,9 @@ case $os in ;; none) ;; + kernel* ) + # Restricted further below + ;; *) echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 exit 1 @@ -1772,16 +1779,26 @@ esac # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ - | linux-musl* | linux-relibc* | linux-uclibc* ) + | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* ) ;; uclinux-uclibc* ) ;; - -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + managarm-mlibc* | managarm-kernel* ) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 exit 1 ;; + -kernel* ) + echo "Invalid configuration \`$1': \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + *-kernel* ) + echo "Invalid configuration \`$1': \`$kernel' does not support \`$os'." 1>&2 + exit 1 + ;; kfreebsd*-gnu* | kopensolaris*-gnu*) ;; vxworks-simlinux | vxworks-simwindows | vxworks-spe) diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index 09f2d28c2f2..cfc77a84ea8 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{2022-09-21.15} +\def\texinfoversion{2022-11-12.22} % % Copyright 1985, 1986, 1988, 1990-2022 Free Software Foundation, Inc. % @@ -2544,34 +2544,30 @@ end \scriptfont\sffam=\sevensf } -% -% The font-changing commands (all called \...fonts) redefine the meanings -% of \STYLEfont, instead of just \STYLE. We do this because \STYLE needs -% to also set the current \fam for math mode. Our \STYLE (e.g., \rm) -% commands hardwire \STYLEfont to set the current font. -% -% The fonts used for \ifont are for "math italics" (\itfont is for italics -% in regular text). \syfont is also used in math mode only. -% -% Each font-changing command also sets the names \lsize (one size lower) -% and \lllsize (three sizes lower). These relative commands are used -% in, e.g., the LaTeX logo and acronyms. -% -% This all needs generalizing, badly. + +% \defineassignfonts{SIZE} - +% Define sequence \assignfontsSIZE, which switches between font sizes +% by redefining the meanings of \STYLEfont. (Just \STYLE additionally sets +% the current \fam for math mode.) % +\def\defineassignfonts#1{% + \expandafter\edef\csname assignfonts#1\endcsname{% + \let\noexpand\rmfont\csname #1rm\endcsname + \let\noexpand\itfont\csname #1it\endcsname + \let\noexpand\slfont\csname #1sl\endcsname + \let\noexpand\bffont\csname #1bf\endcsname + \let\noexpand\ttfont\csname #1tt\endcsname + \let\noexpand\smallcaps\csname #1sc\endcsname + \let\noexpand\sffont \csname #1sf\endcsname + \let\noexpand\ifont \csname #1i\endcsname + \let\noexpand\syfont \csname #1sy\endcsname + \let\noexpand\ttslfont\csname #1ttsl\endcsname + } +} \def\assignfonts#1{% - \expandafter\let\expandafter\rmfont\csname #1rm\endcsname - \expandafter\let\expandafter\itfont\csname #1it\endcsname - \expandafter\let\expandafter\slfont\csname #1sl\endcsname - \expandafter\let\expandafter\bffont\csname #1bf\endcsname - \expandafter\let\expandafter\ttfont\csname #1tt\endcsname - \expandafter\let\expandafter\smallcaps\csname #1sc\endcsname - \expandafter\let\expandafter\sffont \csname #1sf\endcsname - \expandafter\let\expandafter\ifont \csname #1i\endcsname - \expandafter\let\expandafter\syfont \csname #1sy\endcsname - \expandafter\let\expandafter\ttslfont\csname #1ttsl\endcsname + \csname assignfonts#1\endcsname } \newif\ifrmisbold @@ -2595,12 +2591,21 @@ end \csname\curfontstyle\endcsname }% +% Define the font-changing commands (all called \...fonts). +% Each font-changing command also sets the names \lsize (one size lower) +% and \lllsize (three sizes lower). These relative commands are used +% in, e.g., the LaTeX logo and acronyms. +% +% Note: The fonts used for \ifont are for "math italics" (\itfont is for +% italics in regular text). \syfont is also used in math mode only. +% \def\definefontsetatsize#1#2#3#4#5{% + \defineassignfonts{#1}% \expandafter\def\csname #1fonts\endcsname{% \def\curfontsize{#1}% \def\lsize{#2}\def\lllsize{#3}% \csname rmisbold#5\endcsname - \assignfonts{#1}% + \csname assignfonts#1\endcsname \resetmathfonts \setleading{#4}% }} @@ -2645,9 +2650,16 @@ end % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have -% this property, we can check that font parameter. -% -\def\ifmonospace{\ifdim\fontdimen3\font=0pt } +% this property, we can check that font parameter. #1 is what to +% print if we are indeed using \tt; #2 is what to print otherwise. +\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} + +% Same as above, but check for italic font. Actually this also catches +% non-italic slanted fonts since it is impossible to distinguish them from +% italic fonts. But since this is only used by $ and it uses \sl anyway +% this is not a problem. +\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} + % Check if internal flag is clear, i.e. has not been @set. \def\ifflagclear#1#2#3{% @@ -2655,8 +2667,6 @@ end #2\else#3\fi } - - { \catcode`\'=\active \catcode`\`=\active @@ -2672,33 +2682,28 @@ end % lilypond developers report. xpdf does work with the regular 0x27. % \def\codequoteright{% - \ifmonospace - \ifflagclear{txicodequoteundirected}{% - \ifflagclear{codequoteundirected}{% - '% - }{\char'15 }% - }{\char'15 }% - \else - '% - \fi + \ifusingtt + {\ifflagclear{txicodequoteundirected}% + {\ifflagclear{codequoteundirected}% + {'}% + {\char'15 }}% + {\char'15 }}% + {'}% } -% + % and a similar option for the left quote char vs. a grave accent. % Modern fonts display ASCII 0x60 as a grave accent, so some people like % the code environments to do likewise. +% \relax disables Spanish ligatures ?` and !` of \tt font. % \def\codequoteleft{% - \ifmonospace - \ifflagclear{txicodequotebacktick}{% - \ifflagclear{codequotebacktick}{% - % [Knuth] pp. 380,381,391 - % \relax disables Spanish ligatures ?` and !` of \tt font. - \relax`% - }{\char'22 }% - }{\char'22 }% - \else - \relax`% - \fi + \ifusingtt + {\ifflagclear{txicodequotebacktick}% + {\ifflagclear{codequotebacktick}% + {\relax`}% + {\char'22 }}% + {\char'22 }}% + {\relax`}% } % Commands to set the quote options. @@ -2817,20 +2822,29 @@ end \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } +\newif\iffrenchspacing +\frenchspacingfalse + % Set sfcode to normal for the chars that usually have another value. % Can't use plain's \frenchspacing because it uses the `\x notation, and % sometimes \x has an active definition that messes things up. % \catcode`@=11 \def\plainfrenchspacing{% - \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m - \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m - \def\endofsentencespacefactor{1000}% for @. and friends + \iffrenchspacing\else + \frenchspacingtrue + \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m + \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m + \def\endofsentencespacefactor{1000}% for @. and friends + \fi } \def\plainnonfrenchspacing{% - \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 - \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 - \def\endofsentencespacefactor{3000}% for @. and friends + \iffrenchspacing + \frenchspacingfalse + \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 + \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 + \def\endofsentencespacefactor{3000}% for @. and friends + \fi } \catcode`@=\other \def\endofsentencespacefactor{3000}% default @@ -3389,8 +3403,8 @@ $$% \let\atchar=\@ % @{ @} @lbracechar{} @rbracechar{} all generate brace characters. -\def\lbracechar{{\ifmonospace\char123\else\ensuremath\lbrace\fi}} -\def\rbracechar{{\ifmonospace\char125\else\ensuremath\rbrace\fi}} +\def\lbracechar{{\ifusingtt{\char123}{\ensuremath\lbrace}}} +\def\rbracechar{{\ifusingtt{\char125}{\ensuremath\rbrace}}} \let\{=\lbracechar \let\}=\rbracechar @@ -3537,7 +3551,7 @@ $$% % @pounds{} is a sterling sign, which Knuth put in the CM italic font. % -\def\pounds{\ifmonospace{\ecfont\char"BF}\else{\it\$}\fi} +\def\pounds{{\ifusingtt{\ecfont\char"BF}{\it\$}}} % @euro{} comes from a separate font, depending on the current style. % We use the free feym* fonts from the eurosym package by Henrik @@ -3651,18 +3665,17 @@ $$% % hopefully nobody will notice/care. \edef\ecsize{\csname\curfontsize ecsize\endcsname}% \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% - \ifmonospace - % typewriter: - \font\thisecfont = #1ctt\ecsize \space at \nominalsize - \else - \ifx\curfontstyle\bfstylename - % bold: - \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize - \else - % regular: - \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize - \fi - \fi + \ifusingtt + % typewriter: + {\font\thisecfont = #1ctt\ecsize \space at \nominalsize}% + % else + {\ifx\curfontstyle\bfstylename + % bold: + \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize + \else + % regular: + \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \fi}% \thisecfont } @@ -3678,7 +3691,10 @@ $$% % @textdegree - the normal degrees sign. % -\def\textdegree{$^\circ$} +\def\textdegree{% + \ifmmode ^\circ + \else {\tcfont \char 176}% + \fi} % Laurent Siebenmann reports \Orb undefined with: % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 @@ -3695,11 +3711,11 @@ $$% % only change font for tt for correct kerning and to avoid using % \ecfont unless necessary. \def\quotedblleft{% - \ifmonospace{\ecfont\char"10}\else{\char"5C}\fi + \ifusingtt{{\ecfont\char"10}}{{\char"5C}}% } \def\quotedblright{% - \ifmonospace{\ecfont\char"11}\else{\char`\"}\fi + \ifusingtt{{\ecfont\char"11}}{{\char`\"}}% } @@ -5257,7 +5273,10 @@ $$% \xdef\trimmed{\segment}% \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}% \xdef\indexsortkey{\trimmed}% - \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi + \ifx\indexsortkey\empty + \message{Empty index sort key near line \the\inputlineno}% + \xdef\indexsortkey{ }% + \fi }\fi % % Append to \fullindexsortkey. @@ -6386,6 +6405,16 @@ might help (with 'rm \jobname.?? \jobname.??s')% \def\Yappendixkeyword{Yappendix} \def\Yomitfromtockeyword{Yomitfromtoc} % +% +% Definitions for @thischapter. These can be overridden in translation +% files. +\def\thischapterAppendix{% + \putwordAppendix{} \thischapternum: \thischaptername} + +\def\thischapterChapter{% + \putwordChapter{} \thischapternum: \thischaptername} +% +% \def\chapmacro#1#2#3{% \expandafter\ifx\thisenv\titlepage\else \checkenv{}% chapters, etc., should not start inside an environment. @@ -6408,22 +6437,14 @@ might help (with 'rm \jobname.?? \jobname.??s')% \xdef\currentchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\appendixletter}% - % \noexpand\putwordAppendix avoids expanding indigestible - % commands in some of the translations. - \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} - \noexpand\thischapternum: - \noexpand\thischaptername}% + \let\noexpand\thischapter\noexpand\thischapterAppendix }% \else \toks0={#1}% \xdef\currentchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\the\chapno}% - % \noexpand\putwordChapter avoids expanding indigestible - % commands in some of the translations. - \gdef\noexpand\thischapter{\noexpand\putwordChapter{} - \noexpand\thischapternum: - \noexpand\thischaptername}% + \let\noexpand\thischapter\noexpand\thischapterChapter }% \fi\fi\fi % @@ -6509,6 +6530,12 @@ might help (with 'rm \jobname.?? \jobname.??s')% \def\subsubsecheadingskip{\subsecheadingskip} \def\subsubsecheadingbreak{\subsecheadingbreak} +% Definition for @thissection. This can be overridden in translation +% files. +\def\thissectionDef{% + \putwordSection{} \thissectionnum: \thissectionname} +% + % Print any size, any type, section title. % @@ -6550,11 +6577,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \xdef\currentsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% - % \noexpand\putwordSection avoids expanding indigestible - % commands in some of the translations. - \gdef\noexpand\thissection{\noexpand\putwordSection{} - \noexpand\thissectionnum: - \noexpand\thissectionname}% + \let\noexpand\thissection\noexpand\thissectionDef }% \fi \else @@ -6563,11 +6586,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \xdef\currentsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% - % \noexpand\putwordSection avoids expanding indigestible - % commands in some of the translations. - \gdef\noexpand\thissection{\noexpand\putwordSection{} - \noexpand\thissectionnum: - \noexpand\thissectionname}% + \let\noexpand\thissection\noexpand\thissectionDef }% \fi \fi\fi\fi @@ -7107,12 +7126,19 @@ might help (with 'rm \jobname.?? \jobname.??s')% \startsavinginserts \lskip=\leftskip \rskip=\rightskip \leftskip=0pt\rightskip=0pt % we want these *outside*. + % + % Set paragraph width for text inside cartouche. There are + % left and right margins of 3pt each plus two vrules 0.4pt each. \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip + \advance\cartinner by -6.8pt + % + % For drawing top and bottom of cartouche. Each corner char + % adds 6pt and we take off the width of a rule to line up with the + % right boundary perfectly. \cartouter=\hsize - \advance\cartouter by 18.4pt % allow for 3pt kerns on either - % side, and for 6pt waste from - % each corner char, and rule thickness + \advance\cartouter by 11.6pt + % \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % % If this cartouche directly follows a sectioning command, we need the @@ -8405,21 +8431,21 @@ might help (with 'rm \jobname.?? \jobname.??s')% \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup + \begingroup \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 + \endgroup \noexpand\scanmacro{\macrobody}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup + \begingroup \noexpand\braceorline \expandafter\noexpand\csname\the\macname @@@\endcsname}% \expandafter\xdef\csname\the\macname @@@\endcsname##1{% - \egroup + \endgroup \noexpand\scanmacro{\macrobody}% }% \else % at most 9 @@ -8430,7 +8456,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % @MACNAME@@@ removes braces surrounding the argument list. % @MACNAME@@@@ scans the macro body with arguments substituted. \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup + \begingroup \noexpand\expandafter % This \expandafter skip any spaces after the \noexpand\macroargctxt % macro before we change the catcode of space. \noexpand\expandafter @@ -8444,7 +8470,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \expandafter\xdef \expandafter\expandafter \csname\the\macname @@@@\endcsname\paramlist{% - \egroup\noexpand\scanmacro{\macrobody}}% + \endgroup\noexpand\scanmacro{\macrobody}}% \else % 10 or more: \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% @@ -8887,11 +8913,10 @@ might help (with 'rm \jobname.?? \jobname.??s')% \xrefprintnodename\printedrefname % \ifflagclear{txiomitxrefpg}{% - % But we always want a comma and a space: - ,\space - % + % We always want a comma + ,% % output the `page 3'. - \turnoffactive \putwordpage\tie\refx{#1-pg}% + \turnoffactive \putpageref{#1}% % Add a , if xref followed by a space \if\space\noexpand\tokenafterxref ,% \else\ifx\ \tokenafterxref ,% @TAB @@ -8907,6 +8932,10 @@ might help (with 'rm \jobname.?? \jobname.??s')% \endlink \endgroup} +% can be overridden in translation files +\def\putpageref#1{% + \space\putwordpage\tie\refx{#1-pg}} + % Output a cross-manual xref to #1. Used just above (twice). % % Only include the text "Section ``foo'' in" if the foo is neither @@ -9338,13 +9367,6 @@ might help (with 'rm \jobname.?? \jobname.??s')% \makevalueexpandable \ifvmode \imagevmodetrue - \else \ifx\centersub\centerV - % for @center @image, we need a vbox so we can have our vertical space - \imagevmodetrue - \vbox\bgroup % vbox has better behavior than vtop here - \fi\fi - % - \ifimagevmode \medskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space @@ -9356,14 +9378,17 @@ might help (with 'rm \jobname.?? \jobname.??s')% \vtop\bgroup \kern -\capheight \vskip-\parskip \fi % - % Enter horizontal mode so that indentation from an enclosing - % environment such as @quotation is respected. - % However, if we're at the top level, we don't want the - % normal paragraph indentation. - % On the other hand, if we are in the case of @center @image, we don't - % want to start a paragraph, which will create a hsize-width box and - % eradicate the centering. - \ifx\centersub\centerV \else \imageindent \fi + \ifx\centersub\centerV + % For @center @image, enter vertical mode and add vertical space + % Enter an extra \parskip because @center doesn't add space itself. + \vbox\bgroup\vskip\parskip\medskip\vskip\parskip + \else + % Enter horizontal mode so that indentation from an enclosing + % environment such as @quotation is respected. + % However, if we're at the top level, we don't want the + % normal paragraph indentation. + \imageindent + \fi % % Output the image. \ifpdf @@ -9388,7 +9413,10 @@ might help (with 'rm \jobname.?? \jobname.??s')% \egroup \medskip % space after a standalone image \fi - \ifx\centersub\centerV \egroup \fi + \ifx\centersub\centerV % @center @image + \medskip + \egroup % close \vbox + \fi \endgroup} @@ -10038,7 +10066,7 @@ directory should work if nowhere else does.} \gdefchar^^ae{\v Z} \gdefchar^^af{\dotaccent Z} % - \gdefchar^^b0{\textdegree{}} + \gdefchar^^b0{\textdegree} \gdefchar^^b1{\ogonek{a}} \gdefchar^^b2{\ogonek{ }} \gdefchar^^b3{\l} @@ -10461,7 +10489,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}% \DeclareUnicodeCharacter{00AF}{\={ }}% % - \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}% + \DeclareUnicodeCharacter{00B0}{\textdegree} \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}% \DeclareUnicodeCharacter{00B2}{$^2$}% \DeclareUnicodeCharacter{00B3}{$^3$}% @@ -10965,7 +10993,7 @@ directory should work if nowhere else does.} % \DeclareUnicodeCharacter{20AC}{\euro{}}% % - \DeclareUnicodeCharacter{2192}{\expansion{}}% + \DeclareUnicodeCharacter{2192}{\arrow}% \DeclareUnicodeCharacter{21D2}{\result{}}% % % Mathematical symbols @@ -11401,6 +11429,131 @@ directory should work if nowhere else does.} \hfuzz = 1pt +\message{microtype,} + +% protrusion, from Thanh's protcode.tex. +\def\mtsetprotcode#1{% + \rpcode#1`\!=200 \rpcode#1`\,=700 \rpcode#1`\-=700 \rpcode#1`\.=700 + \rpcode#1`\;=500 \rpcode#1`\:=500 \rpcode#1`\?=200 + \rpcode#1`\'=700 + \rpcode#1 34=500 % '' + \rpcode#1 123=300 % -- + \rpcode#1 124=200 % --- + \rpcode#1`\)=50 \rpcode#1`\A=50 \rpcode#1`\F=50 \rpcode#1`\K=50 + \rpcode#1`\L=50 \rpcode#1`\T=50 \rpcode#1`\V=50 \rpcode#1`\W=50 + \rpcode#1`\X=50 \rpcode#1`\Y=50 \rpcode#1`\k=50 \rpcode#1`\r=50 + \rpcode#1`\t=50 \rpcode#1`\v=50 \rpcode#1`\w=50 \rpcode#1`\x=50 + \rpcode#1`\y=50 + % + \lpcode#1`\`=700 + \lpcode#1 92=500 % `` + \lpcode#1`\(=50 \lpcode#1`\A=50 \lpcode#1`\J=50 \lpcode#1`\T=50 + \lpcode#1`\V=50 \lpcode#1`\W=50 \lpcode#1`\X=50 \lpcode#1`\Y=50 + \lpcode#1`\v=50 \lpcode#1`\w=50 \lpcode#1`\x=50 \lpcode#1`\y=0 + % + \mtadjustprotcode#1\relax +} + +\newcount\countC +\def\mtadjustprotcode#1{% + \countC=0 + \loop + \ifcase\lpcode#1\countC\else + \mtadjustcp\lpcode#1\countC + \fi + \ifcase\rpcode#1\countC\else + \mtadjustcp\rpcode#1\countC + \fi + \advance\countC 1 + \ifnum\countC < 256 \repeat +} + +\newcount\countB +\def\mtadjustcp#1#2#3{% + \setbox\boxA=\hbox{% + \ifx#2\font\else#2\fi + \char#3}% + \countB=\wd\boxA + \multiply\countB #1#2#3\relax + \divide\countB \fontdimen6 #2\relax + #1#2#3=\countB\relax +} + +\ifx\XeTeXrevision\thisisundefined + \ifx\luatexversion\thisisundefined + \ifpdf % pdfTeX + \mtsetprotcode\textrm + \def\mtfontexpand#1{\pdffontexpand#1 20 20 1 autoexpand\relax} + \else % TeX + \def\mtfontexpand#1{} + \fi + \else % LuaTeX + \mtsetprotcode\textrm + \def\mtfontexpand#1{\expandglyphsinfont#1 20 20 1\relax} + \fi +\else % XeTeX + \mtsetprotcode\textrm + \def\mtfontexpand#1{} +\fi + + +\newif\ifmicrotype + +\def\microtypeON{% + \microtypetrue + % + \ifx\XeTeXrevision\thisisundefined + \ifx\luatexversion\thisisundefined + \ifpdf % pdfTeX + \pdfadjustspacing=2 + \pdfprotrudechars=2 + \fi + \else % LuaTeX + \adjustspacing=2 + \protrudechars=2 + \fi + \else % XeTeX + \XeTeXprotrudechars=2 + \fi + % + \mtfontexpand\textrm + \mtfontexpand\textsl + \mtfontexpand\textbf +} + +\def\microtypeOFF{% + \microtypefalse + % + \ifx\XeTeXrevision\thisisundefined + \ifx\luatexversion\thisisundefined + \ifpdf % pdfTeX + \pdfadjustspacing=0 + \pdfprotrudechars=0 + \fi + \else % LuaTeX + \adjustspacing=0 + \protrudechars=0 + \fi + \else % XeTeX + \XeTeXprotrudechars=0 + \fi +} + +\microtypeON + +\parseargdef\microtype{% + \def\txiarg{#1}% + \ifx\txiarg\onword + \microtypeON + \else\ifx\txiarg\offword + \microtypeOFF + \else + \errhelp = \EMsimple + \errmessage{Unknown @microtype option `\txiarg', must be on|off}% + \fi\fi +} + + \message{and turning on texinfo input format.} \def^^L{\par} % remove \outer, so ^L can appear in an @comment @@ -11420,23 +11573,6 @@ directory should work if nowhere else does.} \catcode`\|=\other \def\normalverticalbar{|} \catcode`\~=\other \def\normaltilde{~} -% This macro is used to make a character print one way in \tt -% (where it can probably be output as-is), and another way in other fonts, -% where something hairier probably needs to be done. -% -% #1 is what to print if we are indeed using \tt; #2 is what to print -% otherwise. Since all the Computer Modern typewriter fonts have zero -% interword stretch (and shrink), and it is reasonable to expect all -% typewriter fonts to have this, we can check that font parameter. -% -\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} - -% Same as above, but check for italic font. Actually this also catches -% non-italic slanted fonts since it is impossible to distinguish them from -% italic fonts. But since this is only used by $ and it uses \sl anyway -% this is not a problem. -\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} - % Set catcodes for Texinfo file % Active characters for printing the wanted glyph. diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c index 8c3d7f7cf80..870a663505d 100644 --- a/lib/canonicalize-lgpl.c +++ b/lib/canonicalize-lgpl.c @@ -47,6 +47,7 @@ #else # define __canonicalize_file_name canonicalize_file_name # define __realpath realpath +# define __strdup strdup # include "pathmax.h" # define __faccessat faccessat # if defined _WIN32 && !defined __CYGWIN__ @@ -179,27 +180,16 @@ get_path_max (void) return path_max < 0 ? 1024 : path_max <= IDX_MAX ? path_max : IDX_MAX; } -/* Act like __realpath (see below), with an additional argument - rname_buf that can be used as temporary storage. - - If GCC_LINT is defined, do not inline this function with GCC 10.1 - and later, to avoid creating a pointer to the stack that GCC - -Wreturn-local-addr incorrectly complains about. See: - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644 - Although the noinline attribute can hurt performance a bit, no better way - to pacify GCC is known; even an explicit #pragma does not pacify GCC. - When the GCC bug is fixed this workaround should be limited to the - broken GCC versions. */ -# if __GNUC_PREREQ (10, 1) -# if defined GCC_LINT || defined lint -__attribute__ ((__noinline__)) -# elif __OPTIMIZE__ && !__NO_INLINE__ -# define GCC_BOGUS_WRETURN_LOCAL_ADDR -# endif -# endif +/* Scratch buffers used by realpath_stk and managed by __realpath. */ +struct realpath_bufs +{ + struct scratch_buffer rname; + struct scratch_buffer extra; + struct scratch_buffer link; +}; + static char * -realpath_stk (const char *name, char *resolved, - struct scratch_buffer *rname_buf) +realpath_stk (const char *name, char *resolved, struct realpath_bufs *bufs) { char *dest; char const *start; @@ -224,12 +214,7 @@ realpath_stk (const char *name, char *resolved, return NULL; } - struct scratch_buffer extra_buffer, link_buffer; - scratch_buffer_init (&extra_buffer); - scratch_buffer_init (&link_buffer); - scratch_buffer_init (rname_buf); - char *rname_on_stack = rname_buf->data; - char *rname = rname_on_stack; + char *rname = bufs->rname.data; bool end_in_extra_buffer = false; bool failed = true; @@ -239,16 +224,16 @@ realpath_stk (const char *name, char *resolved, if (!IS_ABSOLUTE_FILE_NAME (name)) { - while (!__getcwd (rname, rname_buf->length)) + while (!__getcwd (bufs->rname.data, bufs->rname.length)) { if (errno != ERANGE) { dest = rname; goto error; } - if (!scratch_buffer_grow (rname_buf)) - goto error_nomem; - rname = rname_buf->data; + if (!scratch_buffer_grow (&bufs->rname)) + return NULL; + rname = bufs->rname.data; } dest = __rawmemchr (rname, '\0'); start = name; @@ -302,13 +287,13 @@ realpath_stk (const char *name, char *resolved, if (!ISSLASH (dest[-1])) *dest++ = '/'; - while (rname + rname_buf->length - dest + while (rname + bufs->rname.length - dest < startlen + sizeof dir_suffix) { idx_t dest_offset = dest - rname; - if (!scratch_buffer_grow_preserve (rname_buf)) - goto error_nomem; - rname = rname_buf->data; + if (!scratch_buffer_grow_preserve (&bufs->rname)) + return NULL; + rname = bufs->rname.data; dest = rname + dest_offset; } @@ -319,13 +304,13 @@ realpath_stk (const char *name, char *resolved, ssize_t n; while (true) { - buf = link_buffer.data; - idx_t bufsize = link_buffer.length; + buf = bufs->link.data; + idx_t bufsize = bufs->link.length; n = __readlink (rname, buf, bufsize - 1); if (n < bufsize - 1) break; - if (!scratch_buffer_grow (&link_buffer)) - goto error_nomem; + if (!scratch_buffer_grow (&bufs->link)) + return NULL; } if (0 <= n) { @@ -337,7 +322,7 @@ realpath_stk (const char *name, char *resolved, buf[n] = '\0'; - char *extra_buf = extra_buffer.data; + char *extra_buf = bufs->extra.data; idx_t end_idx IF_LINT (= 0); if (end_in_extra_buffer) end_idx = end - extra_buf; @@ -345,13 +330,13 @@ realpath_stk (const char *name, char *resolved, if (INT_ADD_OVERFLOW (len, n)) { __set_errno (ENOMEM); - goto error_nomem; + return NULL; } - while (extra_buffer.length <= len + n) + while (bufs->extra.length <= len + n) { - if (!scratch_buffer_grow_preserve (&extra_buffer)) - goto error_nomem; - extra_buf = extra_buffer.data; + if (!scratch_buffer_grow_preserve (&bufs->extra)) + return NULL; + extra_buf = bufs->extra.data; } if (end_in_extra_buffer) end = extra_buf + end_idx; @@ -403,20 +388,30 @@ realpath_stk (const char *name, char *resolved, error: *dest++ = '\0'; - if (resolved != NULL && dest - rname <= get_path_max ()) - rname = strcpy (resolved, rname); - -error_nomem: - scratch_buffer_free (&extra_buffer); - scratch_buffer_free (&link_buffer); - - if (failed || rname == resolved) + if (resolved != NULL) + { + /* Copy the full result on success or partial result if failure was due + to the path not existing or not being accessible. */ + if ((!failed || errno == ENOENT || errno == EACCES) + && dest - rname <= get_path_max ()) + { + strcpy (resolved, rname); + if (failed) + return NULL; + else + return resolved; + } + if (!failed) + __set_errno (ENAMETOOLONG); + return NULL; + } + else { - scratch_buffer_free (rname_buf); - return failed ? NULL : resolved; + if (failed) + return NULL; + else + return __strdup (bufs->rname.data); } - - return scratch_buffer_dupfree (rname_buf, dest - rname); } /* Return the canonical absolute name of file NAME. A canonical name @@ -433,12 +428,15 @@ error_nomem: char * __realpath (const char *name, char *resolved) { - #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR - #warning "GCC might issue a bogus -Wreturn-local-addr warning here." - #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>." - #endif - struct scratch_buffer rname_buffer; - return realpath_stk (name, resolved, &rname_buffer); + struct realpath_bufs bufs; + scratch_buffer_init (&bufs.rname); + scratch_buffer_init (&bufs.extra); + scratch_buffer_init (&bufs.link); + char *result = realpath_stk (name, resolved, &bufs); + scratch_buffer_free (&bufs.link); + scratch_buffer_free (&bufs.extra); + scratch_buffer_free (&bufs.rname); + return result; } libc_hidden_def (__realpath) versioned_symbol (libc, __realpath, realpath, GLIBC_2_3); diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index 04644bdabe3..9af8fd0c579 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -222,6 +222,8 @@ DEFS = @DEFS@ DESLIB = @DESLIB@ DOCMISC_W32 = @DOCMISC_W32@ DUMPING = @DUMPING@ +DYNAMIC_LIB_SECONDARY_SUFFIX = @DYNAMIC_LIB_SECONDARY_SUFFIX@ +DYNAMIC_LIB_SUFFIX = @DYNAMIC_LIB_SUFFIX@ DYNLIB_OBJ = @DYNLIB_OBJ@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ @@ -953,6 +955,7 @@ MKDIR_P = @MKDIR_P@ MODULES_OBJ = @MODULES_OBJ@ MODULES_SECONDARY_SUFFIX = @MODULES_SECONDARY_SUFFIX@ MODULES_SUFFIX = @MODULES_SUFFIX@ +NATIVE_COMPILATION_AOT = @NATIVE_COMPILATION_AOT@ NEXT_ASSERT_H = @NEXT_ASSERT_H@ NEXT_AS_FIRST_DIRECTIVE_ASSERT_H = @NEXT_AS_FIRST_DIRECTIVE_ASSERT_H@ NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@ @@ -1218,6 +1221,8 @@ TERMCAP_OBJ = @TERMCAP_OBJ@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@ TOOLKIT_LIBW = @TOOLKIT_LIBW@ +TREE_SITTER_CFLAGS = @TREE_SITTER_CFLAGS@ +TREE_SITTER_LIBS = @TREE_SITTER_LIBS@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ @@ -1309,23 +1314,22 @@ gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31_CONDITION = @gl_GNULIB_ENABLE gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_CONDITION = @gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c_CONDITION@ gl_GNULIB_ENABLED_61bcaca76b3e6f9ae55d57a1c3193bc4_CONDITION = @gl_GNULIB_ENABLED_61bcaca76b3e6f9ae55d57a1c3193bc4_CONDITION@ gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_CONDITION = @gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec_CONDITION@ +gl_GNULIB_ENABLED_8444034ea779b88768865bb60b4fb8c9_CONDITION = @gl_GNULIB_ENABLED_8444034ea779b88768865bb60b4fb8c9_CONDITION@ gl_GNULIB_ENABLED_925677f0343de64b89a9f0c790b4104c_CONDITION = @gl_GNULIB_ENABLED_925677f0343de64b89a9f0c790b4104c_CONDITION@ gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1_CONDITION = @gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1_CONDITION@ gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_CONDITION = @gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36_CONDITION@ gl_GNULIB_ENABLED_cloexec_CONDITION = @gl_GNULIB_ENABLED_cloexec_CONDITION@ gl_GNULIB_ENABLED_d3b2383720ee0e541357aa2aac598e2b_CONDITION = @gl_GNULIB_ENABLED_d3b2383720ee0e541357aa2aac598e2b_CONDITION@ gl_GNULIB_ENABLED_dirfd_CONDITION = @gl_GNULIB_ENABLED_dirfd_CONDITION@ -gl_GNULIB_ENABLED_dynarray_CONDITION = @gl_GNULIB_ENABLED_dynarray_CONDITION@ gl_GNULIB_ENABLED_e80bf6f757095d2e5fc94dafb8f8fc8b_CONDITION = @gl_GNULIB_ENABLED_e80bf6f757095d2e5fc94dafb8f8fc8b_CONDITION@ gl_GNULIB_ENABLED_ef455225c00f5049c808c2eda3e76866_CONDITION = @gl_GNULIB_ENABLED_ef455225c00f5049c808c2eda3e76866_CONDITION@ gl_GNULIB_ENABLED_euidaccess_CONDITION = @gl_GNULIB_ENABLED_euidaccess_CONDITION@ +gl_GNULIB_ENABLED_fd38c7e463b54744b77b98aeafb4fa7c_CONDITION = @gl_GNULIB_ENABLED_fd38c7e463b54744b77b98aeafb4fa7c_CONDITION@ gl_GNULIB_ENABLED_getdtablesize_CONDITION = @gl_GNULIB_ENABLED_getdtablesize_CONDITION@ gl_GNULIB_ENABLED_getgroups_CONDITION = @gl_GNULIB_ENABLED_getgroups_CONDITION@ gl_GNULIB_ENABLED_lchmod_CONDITION = @gl_GNULIB_ENABLED_lchmod_CONDITION@ gl_GNULIB_ENABLED_open_CONDITION = @gl_GNULIB_ENABLED_open_CONDITION@ gl_GNULIB_ENABLED_rawmemchr_CONDITION = @gl_GNULIB_ENABLED_rawmemchr_CONDITION@ -gl_GNULIB_ENABLED_scratch_buffer_CONDITION = @gl_GNULIB_ENABLED_scratch_buffer_CONDITION@ -gl_GNULIB_ENABLED_stdckdint_CONDITION = @gl_GNULIB_ENABLED_stdckdint_CONDITION@ gl_GNULIB_ENABLED_strtoll_CONDITION = @gl_GNULIB_ENABLED_strtoll_CONDITION@ gl_GNULIB_ENABLED_utimens_CONDITION = @gl_GNULIB_ENABLED_utimens_CONDITION@ gl_LIBOBJDEPS = @gl_LIBOBJDEPS@ @@ -1770,43 +1774,6 @@ endif endif ## end gnulib module dup2 -## begin gnulib module dynarray -ifeq (,$(OMIT_GNULIB_MODULE_dynarray)) - -ifneq (,$(gl_GNULIB_ENABLED_dynarray_CONDITION)) -BUILT_SOURCES += malloc/dynarray.gl.h malloc/dynarray-skeleton.gl.h - -malloc/dynarray.gl.h: malloc/dynarray.h - $(AM_V_GEN)$(MKDIR_P) 'malloc' - $(AM_V_at)$(SED_HEADER_STDOUT) \ - -e '/libc_hidden_proto/d' \ - $(srcdir)/malloc/dynarray.h > $@-t - $(AM_V_at)mv $@-t $@ -MOSTLYCLEANFILES += malloc/dynarray.gl.h malloc/dynarray.gl.h-t - -malloc/dynarray-skeleton.gl.h: malloc/dynarray-skeleton.c - $(AM_V_GEN)$(MKDIR_P) 'malloc' - $(AM_V_at)$(SED_HEADER_STDOUT) \ - -e 's|<malloc/dynarray\.h>|<malloc/dynarray.gl.h>|g' \ - -e 's|__attribute_maybe_unused__|_GL_ATTRIBUTE_MAYBE_UNUSED|g' \ - -e 's|__attribute_nonnull__|_GL_ATTRIBUTE_NONNULL|g' \ - -e 's|__attribute_warn_unused_result__|_GL_ATTRIBUTE_NODISCARD|g' \ - -e 's|__glibc_likely|_GL_LIKELY|g' \ - -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \ - $(srcdir)/malloc/dynarray-skeleton.c > $@-t - $(AM_V_at)mv $@-t $@ -MOSTLYCLEANFILES += malloc/dynarray-skeleton.gl.h malloc/dynarray-skeleton.gl.h-t - -libgnu_a_SOURCES += malloc/dynarray_at_failure.c malloc/dynarray_emplace_enlarge.c malloc/dynarray_finalize.c malloc/dynarray_resize.c malloc/dynarray_resize_clear.c - -endif -EXTRA_DIST += dynarray.h malloc/dynarray-skeleton.c malloc/dynarray.h - -EXTRA_libgnu_a_SOURCES += malloc/dynarray-skeleton.c - -endif -## end gnulib module dynarray - ## begin gnulib module eloop-threshold ifeq (,$(OMIT_GNULIB_MODULE_eloop-threshold)) @@ -2251,6 +2218,68 @@ EXTRA_DIST += $(top_srcdir)/build-aux/gitlog-to-changelog endif ## end gnulib module gitlog-to-changelog +## begin gnulib module glibc-internal/dynarray +ifeq (,$(OMIT_GNULIB_MODULE_glibc-internal/dynarray)) + +ifneq (,$(gl_GNULIB_ENABLED_fd38c7e463b54744b77b98aeafb4fa7c_CONDITION)) +BUILT_SOURCES += malloc/dynarray.gl.h malloc/dynarray-skeleton.gl.h + +malloc/dynarray.gl.h: malloc/dynarray.h + $(AM_V_GEN)$(MKDIR_P) 'malloc' + $(AM_V_at)$(SED_HEADER_STDOUT) \ + -e '/libc_hidden_proto/d' \ + $(srcdir)/malloc/dynarray.h > $@-t + $(AM_V_at)mv $@-t $@ +MOSTLYCLEANFILES += malloc/dynarray.gl.h malloc/dynarray.gl.h-t + +malloc/dynarray-skeleton.gl.h: malloc/dynarray-skeleton.c + $(AM_V_GEN)$(MKDIR_P) 'malloc' + $(AM_V_at)$(SED_HEADER_STDOUT) \ + -e 's|<malloc/dynarray\.h>|<malloc/dynarray.gl.h>|g' \ + -e 's|__attribute_maybe_unused__|_GL_ATTRIBUTE_MAYBE_UNUSED|g' \ + -e 's|__attribute_nonnull__|_GL_ATTRIBUTE_NONNULL|g' \ + -e 's|__attribute_warn_unused_result__|_GL_ATTRIBUTE_NODISCARD|g' \ + -e 's|__glibc_likely|_GL_LIKELY|g' \ + -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \ + $(srcdir)/malloc/dynarray-skeleton.c > $@-t + $(AM_V_at)mv $@-t $@ +MOSTLYCLEANFILES += malloc/dynarray-skeleton.gl.h malloc/dynarray-skeleton.gl.h-t + +libgnu_a_SOURCES += malloc/dynarray_at_failure.c malloc/dynarray_emplace_enlarge.c malloc/dynarray_finalize.c malloc/dynarray_resize.c malloc/dynarray_resize_clear.c + +endif +EXTRA_DIST += dynarray.h malloc/dynarray-skeleton.c malloc/dynarray.h + +EXTRA_libgnu_a_SOURCES += malloc/dynarray-skeleton.c + +endif +## end gnulib module glibc-internal/dynarray + +## begin gnulib module glibc-internal/scratch_buffer +ifeq (,$(OMIT_GNULIB_MODULE_glibc-internal/scratch_buffer)) + +ifneq (,$(gl_GNULIB_ENABLED_8444034ea779b88768865bb60b4fb8c9_CONDITION)) +BUILT_SOURCES += malloc/scratch_buffer.gl.h + +malloc/scratch_buffer.gl.h: malloc/scratch_buffer.h + $(AM_V_GEN)$(MKDIR_P) 'malloc' + $(AM_V_at)$(SED_HEADER_STDOUT) \ + -e 's|__always_inline|inline _GL_ATTRIBUTE_ALWAYS_INLINE|g' \ + -e 's|__glibc_likely|_GL_LIKELY|g' \ + -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \ + -e '/libc_hidden_proto/d' \ + $(srcdir)/malloc/scratch_buffer.h > $@-t + $(AM_V_at)mv $@-t $@ +MOSTLYCLEANFILES += malloc/scratch_buffer.gl.h malloc/scratch_buffer.gl.h-t + +libgnu_a_SOURCES += malloc/scratch_buffer_grow.c malloc/scratch_buffer_grow_preserve.c malloc/scratch_buffer_set_array_size.c + +endif +EXTRA_DIST += malloc/scratch_buffer.h scratch_buffer.h + +endif +## end gnulib module glibc-internal/scratch_buffer + ## begin gnulib module group-member ifeq (,$(OMIT_GNULIB_MODULE_group-member)) @@ -2736,31 +2765,6 @@ EXTRA_DIST += root-uid.h endif ## end gnulib module root-uid -## begin gnulib module scratch_buffer -ifeq (,$(OMIT_GNULIB_MODULE_scratch_buffer)) - -ifneq (,$(gl_GNULIB_ENABLED_scratch_buffer_CONDITION)) -BUILT_SOURCES += malloc/scratch_buffer.gl.h - -malloc/scratch_buffer.gl.h: malloc/scratch_buffer.h - $(AM_V_GEN)$(MKDIR_P) 'malloc' - $(AM_V_at)$(SED_HEADER_STDOUT) \ - -e 's|__always_inline|inline _GL_ATTRIBUTE_ALWAYS_INLINE|g' \ - -e 's|__glibc_likely|_GL_LIKELY|g' \ - -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \ - -e '/libc_hidden_proto/d' \ - $(srcdir)/malloc/scratch_buffer.h > $@-t - $(AM_V_at)mv $@-t $@ -MOSTLYCLEANFILES += malloc/scratch_buffer.gl.h malloc/scratch_buffer.gl.h-t - -libgnu_a_SOURCES += malloc/scratch_buffer_dupfree.c malloc/scratch_buffer_grow.c malloc/scratch_buffer_grow_preserve.c malloc/scratch_buffer_set_array_size.c - -endif -EXTRA_DIST += malloc/scratch_buffer.h scratch_buffer.h - -endif -## end gnulib module scratch_buffer - ## begin gnulib module sig2str ifeq (,$(OMIT_GNULIB_MODULE_sig2str)) @@ -2916,7 +2920,6 @@ endif ## begin gnulib module stdckdint ifeq (,$(OMIT_GNULIB_MODULE_stdckdint)) -ifneq (,$(gl_GNULIB_ENABLED_stdckdint_CONDITION)) BUILT_SOURCES += $(STDCKDINT_H) # We need the following in order to create <stdckdint.h> when the system @@ -2932,7 +2935,6 @@ stdckdint.h: $(top_builddir)/config.status endif MOSTLYCLEANFILES += stdckdint.h stdckdint.h-t -endif EXTRA_DIST += intprops-internal.h stdckdint.in.h endif diff --git a/lib/malloc/scratch_buffer.h b/lib/malloc/scratch_buffer.h index e4c5c8a85da..a9bdcadec21 100644 --- a/lib/malloc/scratch_buffer.h +++ b/lib/malloc/scratch_buffer.h @@ -132,20 +132,4 @@ scratch_buffer_set_array_size (struct scratch_buffer *buffer, (buffer, nelem, size)); } -/* Return a copy of *BUFFER's first SIZE bytes as a heap-allocated block, - deallocating *BUFFER if it was heap-allocated. SIZE must be at - most *BUFFER's size. Return NULL (setting errno) on memory - exhaustion. */ -void *__libc_scratch_buffer_dupfree (struct scratch_buffer *buffer, - size_t size); -libc_hidden_proto (__libc_scratch_buffer_dupfree) - -/* Alias for __libc_scratch_dupfree. */ -static __always_inline void * -scratch_buffer_dupfree (struct scratch_buffer *buffer, size_t size) -{ - void *r = __libc_scratch_buffer_dupfree (buffer, size); - return __glibc_likely (r != NULL) ? r : NULL; -} - #endif /* _SCRATCH_BUFFER_H */ diff --git a/lib/scratch_buffer.h b/lib/scratch_buffer.h index f4fe5e8d344..c0aa21630f5 100644 --- a/lib/scratch_buffer.h +++ b/lib/scratch_buffer.h @@ -98,20 +98,10 @@ extern bool scratch_buffer_set_array_size (struct scratch_buffer *buffer, size_t nelem, size_t size); #endif -/* Return a copy of *BUFFER's first SIZE bytes as a heap-allocated block, - deallocating *BUFFER if it was heap-allocated. SIZE must be at - most *BUFFER's size. Return NULL (setting errno) on memory - exhaustion. */ -#if 0 -extern void *scratch_buffer_dupfree (struct scratch_buffer *buffer, - size_t size); -#endif - /* The implementation is imported from glibc. */ /* Avoid possible conflicts with symbols exported by the GNU libc. */ -#define __libc_scratch_buffer_dupfree gl_scratch_buffer_dupfree #define __libc_scratch_buffer_grow gl_scratch_buffer_grow #define __libc_scratch_buffer_grow_preserve gl_scratch_buffer_grow_preserve #define __libc_scratch_buffer_set_array_size gl_scratch_buffer_set_array_size diff --git a/lib/stat-time.h b/lib/stat-time.h index 6b0088e3285..b661196ea58 100644 --- a/lib/stat-time.h +++ b/lib/stat-time.h @@ -20,9 +20,8 @@ #ifndef STAT_TIME_H #define STAT_TIME_H 1 -#include "intprops.h" - #include <errno.h> +#include <stdckdint.h> #include <stddef.h> #include <sys/stat.h> #include <time.h> @@ -232,7 +231,7 @@ stat_time_normalize (int result, _GL_UNUSED struct stat *st) /* Overflow is possible, as Solaris 11 stat can yield tv_sec == TYPE_MINIMUM (time_t) && tv_nsec == -1000000000. INT_ADD_WRAPV is OK, since time_t is signed on Solaris. */ - if (INT_ADD_WRAPV (q, ts->tv_sec, &ts->tv_sec)) + if (ckd_add (&ts->tv_sec, q, ts->tv_sec)) { errno = EOVERFLOW; return -1; diff --git a/m4/assert_h.m4 b/m4/assert_h.m4 index c1306daef4f..e892ea2f01b 100644 --- a/m4/assert_h.m4 +++ b/m4/assert_h.m4 @@ -57,5 +57,11 @@ AC_DEFUN([gl_ASSERT_H], && __GNUG__ < 6 && __clang_major__ < 6))) #include <assert.h> #undef/**/assert + /* Solaris 11.4 <assert.h> defines static_assert as a macro with 2 arguments. + We need it also to be invocable with a single argument. */ + #if defined __sun && (__STDC_VERSION__ - 0 >= 201112L) && !defined __cplusplus + #undef static_assert + #define static_assert _Static_assert + #endif #endif]) ]) diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index f1ac4991324..1a8bf8b7cdf 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -77,7 +77,6 @@ AC_DEFUN([gl_EARLY], # Code from module dtoastr: # Code from module dtotimespec: # Code from module dup2: - # Code from module dynarray: # Code from module eloop-threshold: # Code from module environ: # Code from module errno: @@ -115,6 +114,8 @@ AC_DEFUN([gl_EARLY], # Code from module gettime: # Code from module gettimeofday: # Code from module gitlog-to-changelog: + # Code from module glibc-internal/dynarray: + # Code from module glibc-internal/scratch_buffer: # Code from module group-member: # Code from module idx: # Code from module ieee754-h: @@ -159,7 +160,6 @@ AC_DEFUN([gl_EARLY], # Code from module realloc-posix: # Code from module regex: # Code from module root-uid: - # Code from module scratch_buffer: # Code from module sig2str: # Code from module sigdescr_np: # Code from module signal-h: @@ -492,6 +492,14 @@ AC_DEFUN([gl_INIT], gl_CONDITIONAL_HEADER([stdalign.h]) AC_PROG_MKDIR_P gl_C_BOOL + AC_CHECK_HEADERS_ONCE([stdckdint.h]) + if test $ac_cv_header_stdckdint_h = yes; then + GL_GENERATE_STDCKDINT_H=false + else + GL_GENERATE_STDCKDINT_H=true + fi + gl_CONDITIONAL_HEADER([stdckdint.h]) + AC_PROG_MKDIR_P gl_STDDEF_H gl_STDDEF_H_REQUIRE_DEFAULTS gl_CONDITIONAL_HEADER([stddef.h]) @@ -620,12 +628,13 @@ AC_DEFUN([gl_INIT], gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=false gl_gnulib_enabled_cloexec=false gl_gnulib_enabled_dirfd=false - gl_gnulib_enabled_dynarray=false gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c=false gl_gnulib_enabled_euidaccess=false gl_gnulib_enabled_getdtablesize=false gl_gnulib_enabled_getgroups=false gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=false + gl_gnulib_enabled_fd38c7e463b54744b77b98aeafb4fa7c=false + gl_gnulib_enabled_8444034ea779b88768865bb60b4fb8c9=false gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1=false gl_gnulib_enabled_lchmod=false gl_gnulib_enabled_e80bf6f757095d2e5fc94dafb8f8fc8b=false @@ -637,8 +646,6 @@ AC_DEFUN([gl_INIT], gl_gnulib_enabled_d3b2383720ee0e541357aa2aac598e2b=false gl_gnulib_enabled_61bcaca76b3e6f9ae55d57a1c3193bc4=false gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=false - gl_gnulib_enabled_scratch_buffer=false - gl_gnulib_enabled_stdckdint=false gl_gnulib_enabled_strtoll=false gl_gnulib_enabled_utimens=false gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec=false @@ -672,13 +679,6 @@ AC_DEFUN([gl_INIT], gl_gnulib_enabled_dirfd=true fi } - func_gl_gnulib_m4code_dynarray () - { - if ! $gl_gnulib_enabled_dynarray; then - AC_PROG_MKDIR_P - gl_gnulib_enabled_dynarray=true - fi - } func_gl_gnulib_m4code_925677f0343de64b89a9f0c790b4104c () { if ! $gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c; then @@ -735,6 +735,22 @@ AC_DEFUN([gl_INIT], gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36=true fi } + func_gl_gnulib_m4code_fd38c7e463b54744b77b98aeafb4fa7c () + { + if ! $gl_gnulib_enabled_fd38c7e463b54744b77b98aeafb4fa7c; then + AC_PROG_MKDIR_P + gl_gnulib_enabled_fd38c7e463b54744b77b98aeafb4fa7c=true + fi + } + func_gl_gnulib_m4code_8444034ea779b88768865bb60b4fb8c9 () + { + if ! $gl_gnulib_enabled_8444034ea779b88768865bb60b4fb8c9; then + AC_PROG_MKDIR_P + gl_gnulib_enabled_8444034ea779b88768865bb60b4fb8c9=true + func_gl_gnulib_m4code_ef455225c00f5049c808c2eda3e76866 + func_gl_gnulib_m4code_61bcaca76b3e6f9ae55d57a1c3193bc4 + fi + } func_gl_gnulib_m4code_a9786850e999ae65a836a6041e8e5ed1 () { if ! $gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1; then @@ -751,9 +767,6 @@ AC_DEFUN([gl_INIT], if test $HAVE_GROUP_MEMBER = 0; then func_gl_gnulib_m4code_d3b2383720ee0e541357aa2aac598e2b fi - if test $HAVE_GROUP_MEMBER = 0; then - func_gl_gnulib_m4code_stdckdint - fi fi } func_gl_gnulib_m4code_lchmod () @@ -882,29 +895,6 @@ AC_DEFUN([gl_INIT], gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c=true fi } - func_gl_gnulib_m4code_scratch_buffer () - { - if ! $gl_gnulib_enabled_scratch_buffer; then - AC_PROG_MKDIR_P - gl_gnulib_enabled_scratch_buffer=true - func_gl_gnulib_m4code_ef455225c00f5049c808c2eda3e76866 - func_gl_gnulib_m4code_61bcaca76b3e6f9ae55d57a1c3193bc4 - fi - } - func_gl_gnulib_m4code_stdckdint () - { - if ! $gl_gnulib_enabled_stdckdint; then - AC_CHECK_HEADERS_ONCE([stdckdint.h]) - if test $ac_cv_header_stdckdint_h = yes; then - GL_GENERATE_STDCKDINT_H=false - else - GL_GENERATE_STDCKDINT_H=true - fi - gl_CONDITIONAL_HEADER([stdckdint.h]) - AC_PROG_MKDIR_P - gl_gnulib_enabled_stdckdint=true - fi - } func_gl_gnulib_m4code_strtoll () { if ! $gl_gnulib_enabled_strtoll; then @@ -935,10 +925,10 @@ AC_DEFUN([gl_INIT], func_gl_gnulib_m4code_925677f0343de64b89a9f0c790b4104c fi if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then - func_gl_gnulib_m4code_rawmemchr + func_gl_gnulib_m4code_8444034ea779b88768865bb60b4fb8c9 fi if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then - func_gl_gnulib_m4code_scratch_buffer + func_gl_gnulib_m4code_rawmemchr fi if test $HAVE_FACCESSAT = 0 || test $REPLACE_FACCESSAT = 1; then func_gl_gnulib_m4code_260941c0e5dc67ec9e87d1fb321c300b @@ -992,7 +982,7 @@ AC_DEFUN([gl_INIT], func_gl_gnulib_m4code_03e0aaad4cb89ca757653bd367a6ccb7 fi if test $ac_use_included_regex = yes; then - func_gl_gnulib_m4code_dynarray + func_gl_gnulib_m4code_fd38c7e463b54744b77b98aeafb4fa7c fi if { test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; } && test $ac_cv_type_long_long_int = yes; then func_gl_gnulib_m4code_strtoll @@ -1013,12 +1003,13 @@ AC_DEFUN([gl_INIT], AM_CONDITIONAL([gl_GNULIB_ENABLED_260941c0e5dc67ec9e87d1fb321c300b], [$gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b]) AM_CONDITIONAL([gl_GNULIB_ENABLED_cloexec], [$gl_gnulib_enabled_cloexec]) AM_CONDITIONAL([gl_GNULIB_ENABLED_dirfd], [$gl_gnulib_enabled_dirfd]) - AM_CONDITIONAL([gl_GNULIB_ENABLED_dynarray], [$gl_gnulib_enabled_dynarray]) AM_CONDITIONAL([gl_GNULIB_ENABLED_925677f0343de64b89a9f0c790b4104c], [$gl_gnulib_enabled_925677f0343de64b89a9f0c790b4104c]) AM_CONDITIONAL([gl_GNULIB_ENABLED_euidaccess], [$gl_gnulib_enabled_euidaccess]) AM_CONDITIONAL([gl_GNULIB_ENABLED_getdtablesize], [$gl_gnulib_enabled_getdtablesize]) AM_CONDITIONAL([gl_GNULIB_ENABLED_getgroups], [$gl_gnulib_enabled_getgroups]) AM_CONDITIONAL([gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36], [$gl_gnulib_enabled_be453cec5eecf5731a274f2de7f2db36]) + AM_CONDITIONAL([gl_GNULIB_ENABLED_fd38c7e463b54744b77b98aeafb4fa7c], [$gl_gnulib_enabled_fd38c7e463b54744b77b98aeafb4fa7c]) + AM_CONDITIONAL([gl_GNULIB_ENABLED_8444034ea779b88768865bb60b4fb8c9], [$gl_gnulib_enabled_8444034ea779b88768865bb60b4fb8c9]) AM_CONDITIONAL([gl_GNULIB_ENABLED_a9786850e999ae65a836a6041e8e5ed1], [$gl_gnulib_enabled_a9786850e999ae65a836a6041e8e5ed1]) AM_CONDITIONAL([gl_GNULIB_ENABLED_lchmod], [$gl_gnulib_enabled_lchmod]) AM_CONDITIONAL([gl_GNULIB_ENABLED_e80bf6f757095d2e5fc94dafb8f8fc8b], [$gl_gnulib_enabled_e80bf6f757095d2e5fc94dafb8f8fc8b]) @@ -1030,8 +1021,6 @@ AC_DEFUN([gl_INIT], AM_CONDITIONAL([gl_GNULIB_ENABLED_d3b2383720ee0e541357aa2aac598e2b], [$gl_gnulib_enabled_d3b2383720ee0e541357aa2aac598e2b]) AM_CONDITIONAL([gl_GNULIB_ENABLED_61bcaca76b3e6f9ae55d57a1c3193bc4], [$gl_gnulib_enabled_61bcaca76b3e6f9ae55d57a1c3193bc4]) AM_CONDITIONAL([gl_GNULIB_ENABLED_6099e9737f757db36c47fa9d9f02e88c], [$gl_gnulib_enabled_6099e9737f757db36c47fa9d9f02e88c]) - AM_CONDITIONAL([gl_GNULIB_ENABLED_scratch_buffer], [$gl_gnulib_enabled_scratch_buffer]) - AM_CONDITIONAL([gl_GNULIB_ENABLED_stdckdint], [$gl_gnulib_enabled_stdckdint]) AM_CONDITIONAL([gl_GNULIB_ENABLED_strtoll], [$gl_gnulib_enabled_strtoll]) AM_CONDITIONAL([gl_GNULIB_ENABLED_utimens], [$gl_gnulib_enabled_utimens]) AM_CONDITIONAL([gl_GNULIB_ENABLED_682e609604ccaac6be382e4ee3a4eaec], [$gl_gnulib_enabled_682e609604ccaac6be382e4ee3a4eaec]) @@ -1320,7 +1309,6 @@ AC_DEFUN([gl_FILE_LIST], [ lib/malloc/dynarray_resize.c lib/malloc/dynarray_resize_clear.c lib/malloc/scratch_buffer.h - lib/malloc/scratch_buffer_dupfree.c lib/malloc/scratch_buffer_grow.c lib/malloc/scratch_buffer_grow_preserve.c lib/malloc/scratch_buffer_set_array_size.c diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4 index 0aa8c53f9ec..8282a371e4c 100644 --- a/m4/pthread_sigmask.m4 +++ b/m4/pthread_sigmask.m4 @@ -215,6 +215,7 @@ int main () LIBS="$LIBS $LIBMULTITHREAD"]) AC_RUN_IFELSE( [AC_LANG_SOURCE([[ +#include <limits.h> #include <pthread.h> #include <signal.h> #include <stdio.h> @@ -230,14 +231,16 @@ sigint_handler (int sig) int main () { sigset_t set; - int pid = getpid (); + pid_t pid = getpid (); char command[80]; + if (LONG_MAX < pid) + return 6; signal (SIGINT, sigint_handler); sigemptyset (&set); sigaddset (&set, SIGINT); if (!(pthread_sigmask (SIG_BLOCK, &set, NULL) == 0)) return 1; - sprintf (command, "sh -c 'sleep 1; kill -%d %d' &", SIGINT, pid); + sprintf (command, "sh -c 'sleep 1; kill -INT %ld' &", (long) pid); if (!(system (command) == 0)) return 2; sleep (2); |