1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Update from Gnulib by running admin/merge-gnulib

This commit is contained in:
Paul Eggert 2024-12-23 13:55:59 -08:00
parent 85ca91ff91
commit cf5e58a14d
14 changed files with 136 additions and 88 deletions

View file

@ -3,7 +3,7 @@
% Load plain if necessary, i.e., if running under initex. % Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
% %
\def\texinfoversion{2024-02-10.22} \def\texinfoversion{2024-11-04.20}
% %
% Copyright 1985, 1986, 1988, 1990-2024 Free Software Foundation, Inc. % Copyright 1985, 1986, 1988, 1990-2024 Free Software Foundation, Inc.
% %
@ -951,7 +951,11 @@ where each line of input produces a line of output.}
\let\setfilename=\comment \let\setfilename=\comment
% @bye. % @bye.
\outer\def\bye{\chappager\pagelabels\tracingstats=1\ptexend} \outer\def\bye{%
\chappager\pagelabels
% possibly set in \printindex
\ifx\byeerror\relax\else\errmessage{\byeerror}\fi
\tracingstats=1\ptexend}
\message{pdf,} \message{pdf,}
@ -3126,11 +3130,12 @@ end
% at the end of the line, or no break at all here. % at the end of the line, or no break at all here.
% Changing the value of the penalty and/or the amount of stretch affects how % Changing the value of the penalty and/or the amount of stretch affects how
% preferable one choice is over the other. % preferable one choice is over the other.
% Check test cases in doc/texinfo-tex-test.texi before making any changes.
\def\urefallowbreak{% \def\urefallowbreak{%
\penalty0\relax \penalty0\relax
\hskip 0pt plus 2 em\relax \hskip 0pt plus 3 em\relax
\penalty1000\relax \penalty1000\relax
\hskip 0pt plus -2 em\relax \hskip 0pt plus -3 em\relax
} }
\urefbreakstyle after \urefbreakstyle after
@ -5438,6 +5443,9 @@ $$%
\closein 1 \closein 1
\endgroup} \endgroup}
% Checked in @bye
\let\byeerror\relax
% If the index file starts with a backslash, forgo reading the index % If the index file starts with a backslash, forgo reading the index
% file altogether. If somebody upgrades texinfo.tex they may still have % file altogether. If somebody upgrades texinfo.tex they may still have
% old index files using \ as the escape character. Reading this would % old index files using \ as the escape character. Reading this would
@ -5446,7 +5454,9 @@ $$%
\ifflagclear{txiindexescapeisbackslash}{% \ifflagclear{txiindexescapeisbackslash}{%
\uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1 \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1
\ifflagclear{txiskipindexfileswithbackslash}{% \ifflagclear{txiskipindexfileswithbackslash}{%
\errmessage{% % Delay the error message until the very end to give a chance
% for the whole index to be output as input for texindex.
\global\def\byeerror{%
ERROR: A sorted index file in an obsolete format was skipped. ERROR: A sorted index file in an obsolete format was skipped.
To fix this problem, please upgrade your version of 'texi2dvi' To fix this problem, please upgrade your version of 'texi2dvi'
or 'texi2pdf' to that at <https://ftp.gnu.org/gnu/texinfo>. or 'texi2pdf' to that at <https://ftp.gnu.org/gnu/texinfo>.
@ -5567,7 +5577,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% \entry typesets a paragraph consisting of the text (#1), dot leaders, and % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
% then page number (#2) flushed to the right margin. It is used for index % then page number (#2) flushed to the right margin. It is used for index
% and table of contents entries. The paragraph is indented by \leftskip. % and table of contents entries. The paragraph is indented by \leftskip.
% % If \tocnodetarget is set, link text to the referenced node.
\def\entry{% \def\entry{%
\begingroup \begingroup
% %
@ -5608,7 +5618,13 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\global\setbox\boxA=\hbox\bgroup \global\setbox\boxA=\hbox\bgroup
\ifpdforxetex \ifpdforxetex
\iflinkentrytext \iflinkentrytext
\pdflinkpage{#1}{\unhbox\boxA}% \ifx\tocnodetarget\empty
\unhbox\boxA
\else
\startxreflink{\tocnodetarget}{}%
\unhbox\boxA
\endlink
\fi
\else \else
\unhbox\boxA \unhbox\boxA
\fi \fi
@ -5625,11 +5641,18 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% %
\null\nobreak\indexdotfill % Have leaders before the page number. \null\nobreak\indexdotfill % Have leaders before the page number.
% %
\hskip\skip\thinshrinkable
\ifpdforxetex \ifpdforxetex
\ifx\tocnodetarget\empty
\pdfgettoks#1.% \pdfgettoks#1.%
\hskip\skip\thinshrinkable\the\toksA \the\toksA
\else \else
\hskip\skip\thinshrinkable #1% % Should just be a single page number in toc
\startxreflink{\tocnodetarget}{}%
#1\endlink
\fi
\else
#1%
\fi \fi
\fi \fi
\egroup % end \boxA \egroup % end \boxA
@ -6892,7 +6915,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\vskip 0pt plus 5\baselineskip \vskip 0pt plus 5\baselineskip
\penalty-300 \penalty-300
\vskip 0pt plus -5\baselineskip \vskip 0pt plus -5\baselineskip
\dochapentry{#1}{\numeralbox}{}% \dochapentry{#1}{\numeralbox}{#3}{}%
} }
% %
% Parts, in the short toc. % Parts, in the short toc.
@ -6905,12 +6928,12 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% Chapters, in the main contents. % Chapters, in the main contents.
\def\numchapentry#1#2#3#4{% \def\numchapentry#1#2#3#4{%
\retrievesecnowidth\secnowidthchap{#2}% \retrievesecnowidth\secnowidthchap{#2}%
\dochapentry{#1}{#2}{#4}% \dochapentry{#1}{#2}{#3}{#4}%
} }
% Chapters, in the short toc. % Chapters, in the short toc.
\def\shortchapentry#1#2#3#4{% \def\shortchapentry#1#2#3#4{%
\tocentry{#1}{\shortchaplabel{#2}}{#4}% \tocentry{#1}{\shortchaplabel{#2}}{#3}{#4}%
} }
% Appendices, in the main contents. % Appendices, in the main contents.
@ -6923,79 +6946,77 @@ might help (with 'rm \jobname.?? \jobname.??s')%
% %
\def\appentry#1#2#3#4{% \def\appentry#1#2#3#4{%
\retrievesecnowidth\secnowidthchap{#2}% \retrievesecnowidth\secnowidthchap{#2}%
\dochapentry{\appendixbox{#2}\hskip.7em#1}{}{#4}% \dochapentry{\appendixbox{#2}\hskip.7em#1}{}{#3}{#4}%
} }
% Unnumbered chapters. % Unnumbered chapters.
\def\unnchapentry#1#2#3#4{\dochapentry{#1}{}{#4}} \def\unnchapentry#1#2#3#4{\dochapentry{#1}{}{#3}{#4}}
\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{}{#4}} \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{}{#3}{#4}}
% Sections. % Sections.
\def\numsecentry#1#2#3#4{\dosecentry{#1}{#2}{#4}}
\def\numsecentry#1#2#3#4{% \def\numsecentry#1#2#3#4{%
\retrievesecnowidth\secnowidthsec{#2}% \retrievesecnowidth\secnowidthsec{#2}%
\dosecentry{#1}{#2}{#4}% \dosecentry{#1}{#2}{#3}{#4}%
} }
\let\appsecentry=\numsecentry \let\appsecentry=\numsecentry
\def\unnsecentry#1#2#3#4{% \def\unnsecentry#1#2#3#4{%
\retrievesecnowidth\secnowidthsec{#2}% \retrievesecnowidth\secnowidthsec{#2}%
\dosecentry{#1}{}{#4}% \dosecentry{#1}{}{#3}{#4}%
} }
% Subsections. % Subsections.
\def\numsubsecentry#1#2#3#4{% \def\numsubsecentry#1#2#3#4{%
\retrievesecnowidth\secnowidthssec{#2}% \retrievesecnowidth\secnowidthssec{#2}%
\dosubsecentry{#1}{#2}{#4}% \dosubsecentry{#1}{#2}{#3}{#4}%
} }
\let\appsubsecentry=\numsubsecentry \let\appsubsecentry=\numsubsecentry
\def\unnsubsecentry#1#2#3#4{% \def\unnsubsecentry#1#2#3#4{%
\retrievesecnowidth\secnowidthssec{#2}% \retrievesecnowidth\secnowidthssec{#2}%
\dosubsecentry{#1}{}{#4}% \dosubsecentry{#1}{}{#3}{#4}%
} }
% And subsubsections. % And subsubsections.
\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#2}{#4}} \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#2}{#3}{#4}}
\let\appsubsubsecentry=\numsubsubsecentry \let\appsubsubsecentry=\numsubsubsecentry
\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{}{#4}} \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{}{#3}{#4}}
% This parameter controls the indentation of the various levels. % This parameter controls the indentation of the various levels.
% Same as \defaultparindent. % Same as \defaultparindent.
\newdimen\tocindent \tocindent = 15pt \newdimen\tocindent \tocindent = 15pt
% Now for the actual typesetting. In all these, #1 is the text, #2 is % Now for the actual typesetting. In all these, #1 is the text, #2 is
% a section number if present, and #3 is the page number. % a section number if present, #3 is the node, and #4 is the page number.
% %
% If the toc has to be broken over pages, we want it to be at chapters % If the toc has to be broken over pages, we want it to be at chapters
% if at all possible; hence the \penalty. % if at all possible; hence the \penalty.
\def\dochapentry#1#2#3{% \def\dochapentry#1#2#3#4{%
\penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
\begingroup \begingroup
% Move the page numbers slightly to the right % Move the page numbers slightly to the right
\advance\entryrightmargin by -0.05em \advance\entryrightmargin by -0.05em
\chapentryfonts \chapentryfonts
\extrasecnoskip=0.4em % separate chapter number more \extrasecnoskip=0.4em % separate chapter number more
\tocentry{#1}{#2}{#3}% \tocentry{#1}{#2}{#3}{#4}%
\endgroup \endgroup
\nobreak\vskip .25\baselineskip plus.1\baselineskip \nobreak\vskip .25\baselineskip plus.1\baselineskip
} }
\def\dosecentry#1#2#3{\begingroup \def\dosecentry#1#2#3#4{\begingroup
\secnowidth=\secnowidthchap \secnowidth=\secnowidthchap
\secentryfonts \leftskip=\tocindent \secentryfonts \leftskip=\tocindent
\tocentry{#1}{#2}{#3}% \tocentry{#1}{#2}{#3}{#4}%
\endgroup} \endgroup}
\def\dosubsecentry#1#2#3{\begingroup \def\dosubsecentry#1#2#3#4{\begingroup
\secnowidth=\secnowidthsec \secnowidth=\secnowidthsec
\subsecentryfonts \leftskip=2\tocindent \subsecentryfonts \leftskip=2\tocindent
\tocentry{#1}{#2}{#3}% \tocentry{#1}{#2}{#3}{#4}%
\endgroup} \endgroup}
\def\dosubsubsecentry#1#2#3{\begingroup \def\dosubsubsecentry#1#2#3#4{\begingroup
\secnowidth=\secnowidthssec \secnowidth=\secnowidthssec
\subsubsecentryfonts \leftskip=3\tocindent \subsubsecentryfonts \leftskip=3\tocindent
\tocentry{#1}{#2}{#3}% \tocentry{#1}{#2}{#3}{#4}%
\endgroup} \endgroup}
% Used for the maximum width of a section number so we can align % Used for the maximum width of a section number so we can align
@ -7005,12 +7026,15 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\newdimen\extrasecnoskip \newdimen\extrasecnoskip
\extrasecnoskip=0pt \extrasecnoskip=0pt
% \tocentry{TITLE}{SEC NO}{PAGE} \let\tocnodetarget\empty
% \tocentry{TITLE}{SEC NO}{NODE}{PAGE}
% %
\def\tocentry#1#2#3{% \def\tocentry#1#2#3#4{%
\def\tocnodetarget{#3}%
\def\secno{#2}% \def\secno{#2}%
\ifx\empty\secno \ifx\empty\secno
\entry{#1}{#3}% \entry{#1}{#4}%
\else \else
\ifdim 0pt=\secnowidth \ifdim 0pt=\secnowidth
\setbox0=\hbox{#2\hskip\labelspace\hskip\extrasecnoskip}% \setbox0=\hbox{#2\hskip\labelspace\hskip\extrasecnoskip}%
@ -7021,7 +7045,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
#2\hskip\labelspace\hskip\extrasecnoskip\hfill}% #2\hskip\labelspace\hskip\extrasecnoskip\hfill}%
\fi \fi
\entrycontskip=\wd0 \entrycontskip=\wd0
\entry{\box0 #1}{#3}% \entry{\box0 #1}{#4}%
\fi \fi
} }
\newdimen\labelspace \newdimen\labelspace
@ -10515,6 +10539,16 @@ directory should work if nowhere else does.}
\catcode"#1=\other \catcode"#1=\other
} }
% Suppress ligature creation from adjacent characters.
\ifx\luatexversion\thisisundefined
\def\nolig{{}}
\else
% Braces do not suppress ligature creation in LuaTeX, e.g. in of{}fice
% to suppress the "ff" ligature. Using a kern appears to be the only
% workaround.
\def\nolig{\kern0pt{}}
\fi
% https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M % https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M
% U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block) % U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)
% U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block) % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)
@ -11132,8 +11166,8 @@ directory should work if nowhere else does.}
% Punctuation % Punctuation
\DeclareUnicodeCharacter{2013}{--}% \DeclareUnicodeCharacter{2013}{--}%
\DeclareUnicodeCharacter{2014}{---}% \DeclareUnicodeCharacter{2014}{---}%
\DeclareUnicodeCharacter{2018}{\quoteleft{}}% \DeclareUnicodeCharacter{2018}{\quoteleft\nolig}%
\DeclareUnicodeCharacter{2019}{\quoteright{}}% \DeclareUnicodeCharacter{2019}{\quoteright\nolig}%
\DeclareUnicodeCharacter{201A}{\quotesinglbase{}}% \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}%
\DeclareUnicodeCharacter{201C}{\quotedblleft{}}% \DeclareUnicodeCharacter{201C}{\quotedblleft{}}%
\DeclareUnicodeCharacter{201D}{\quotedblright{}}% \DeclareUnicodeCharacter{201D}{\quotedblright{}}%
@ -11168,7 +11202,7 @@ directory should work if nowhere else does.}
\DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}% \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}%
% %
\DeclareUnicodeCharacter{2016}{\ensuremath\Vert}% \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}%
\DeclareUnicodeCharacter{2032}{\ensuremath\prime}% \DeclareUnicodeCharacter{2032}{\ensuremath{^\prime}}%
\DeclareUnicodeCharacter{210F}{\ensuremath\hbar}% \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}%
\DeclareUnicodeCharacter{2111}{\ensuremath\Im}% \DeclareUnicodeCharacter{2111}{\ensuremath\Im}%
\DeclareUnicodeCharacter{2113}{\ensuremath\ell}% \DeclareUnicodeCharacter{2113}{\ensuremath\ell}%

View file

@ -17,7 +17,7 @@
/* Written by Collin Funk. */ /* Written by Collin Funk. */
#define _GL_ENDIAN_INLINE _GL_EXTERN_INLINE
#include <config.h> #include <config.h>
#define _GL_ENDIAN_INLINE _GL_EXTERN_INLINE
#include <endian.h> #include <endian.h>

View file

@ -77,10 +77,11 @@
/* Does the __typeof__ keyword work? This could be done by /* Does the __typeof__ keyword work? This could be done by
'configure', but for now it's easier to do it by hand. */ 'configure', but for now it's easier to do it by hand. */
#if (2 <= __GNUC__ \ #if ((defined __GNUC__ && 2 <= __GNUC__) \
|| (4 <= __clang_major__) \ || (defined __clang_major__ && 4 <= __clang_major__) \
|| (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ || (defined __IBMC__ && 1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
|| (0x5110 <= __SUNPRO_C && !__STDC__)) || (defined __SUNPRO_C && 0x5110 <= __SUNPRO_C && !__STDC__) \
|| (defined _MSC_VER && 1939 <= _MSC_VER))
# define _GL_HAVE___TYPEOF__ 1 # define _GL_HAVE___TYPEOF__ 1
#else #else
# define _GL_HAVE___TYPEOF__ 0 # define _GL_HAVE___TYPEOF__ 0

View file

@ -20,7 +20,7 @@
#endif #endif
@PRAGMA_COLUMNS@ @PRAGMA_COLUMNS@
#if defined _GL_ALREADY_INCLUDING_LIMITS_H #if defined _@GUARD_PREFIX@_ALREADY_INCLUDING_LIMITS_H
/* Special invocation convention: /* Special invocation convention:
On Haiku/x86_64, we have a sequence of nested includes On Haiku/x86_64, we have a sequence of nested includes
<limits.h> -> <syslimits.h> -> <limits.h>. <limits.h> -> <syslimits.h> -> <limits.h>.
@ -34,12 +34,12 @@
#ifndef _@GUARD_PREFIX@_LIMITS_H #ifndef _@GUARD_PREFIX@_LIMITS_H
# define _GL_ALREADY_INCLUDING_LIMITS_H # define _@GUARD_PREFIX@_ALREADY_INCLUDING_LIMITS_H
/* The include_next requires a split double-inclusion guard. */ /* The include_next requires a split double-inclusion guard. */
# @INCLUDE_NEXT@ @NEXT_LIMITS_H@ # @INCLUDE_NEXT@ @NEXT_LIMITS_H@
# undef _GL_ALREADY_INCLUDING_LIMITS_H # undef _@GUARD_PREFIX@_ALREADY_INCLUDING_LIMITS_H
#ifndef _@GUARD_PREFIX@_LIMITS_H #ifndef _@GUARD_PREFIX@_LIMITS_H
#define _@GUARD_PREFIX@_LIMITS_H #define _@GUARD_PREFIX@_LIMITS_H

View file

@ -20,7 +20,7 @@
#endif #endif
@PRAGMA_COLUMNS@ @PRAGMA_COLUMNS@
#if defined __need_sig_atomic_t || defined __need_sigset_t || defined _GL_ALREADY_INCLUDING_SIGNAL_H || (defined _SIGNAL_H && !defined __SIZEOF_PTHREAD_MUTEX_T) #if defined __need_sig_atomic_t || defined __need_sigset_t || defined _@GUARD_PREFIX@_ALREADY_INCLUDING_SIGNAL_H || (defined _SIGNAL_H && !defined __SIZEOF_PTHREAD_MUTEX_T)
/* Special invocation convention: /* Special invocation convention:
- Inside glibc header files. - Inside glibc header files.
- On glibc systems we have a sequence of nested includes - On glibc systems we have a sequence of nested includes
@ -39,7 +39,7 @@
#ifndef _@GUARD_PREFIX@_SIGNAL_H #ifndef _@GUARD_PREFIX@_SIGNAL_H
#define _GL_ALREADY_INCLUDING_SIGNAL_H #define _@GUARD_PREFIX@_ALREADY_INCLUDING_SIGNAL_H
/* Define pid_t, uid_t. /* Define pid_t, uid_t.
Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>. Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.
@ -50,7 +50,7 @@
/* The include_next requires a split double-inclusion guard. */ /* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_SIGNAL_H@ #@INCLUDE_NEXT@ @NEXT_SIGNAL_H@
#undef _GL_ALREADY_INCLUDING_SIGNAL_H #undef _@GUARD_PREFIX@_ALREADY_INCLUDING_SIGNAL_H
#ifndef _@GUARD_PREFIX@_SIGNAL_H #ifndef _@GUARD_PREFIX@_SIGNAL_H
#define _@GUARD_PREFIX@_SIGNAL_H #define _@GUARD_PREFIX@_SIGNAL_H

View file

@ -17,7 +17,7 @@
/* Written by Paul Eggert. */ /* Written by Paul Eggert. */
#define _GL_STDBIT_INLINE _GL_EXTERN_INLINE
#include <config.h> #include <config.h>
#define _GL_STDBIT_INLINE _GL_EXTERN_INLINE
#include <stdbit.h> #include <stdbit.h>

View file

@ -77,7 +77,8 @@ _GL_INLINE_HEADER_BEGIN
#if ((defined __GNUC__ && 2 <= __GNUC__) \ #if ((defined __GNUC__ && 2 <= __GNUC__) \
|| (defined __clang_major__ && 4 <= __clang_major__) \ || (defined __clang_major__ && 4 <= __clang_major__) \
|| (defined __IBMC__ && 1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ || (defined __IBMC__ && 1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
|| (defined __SUNPRO_C && 0x5110 <= __SUNPRO_C && !__STDC__)) || (defined __SUNPRO_C && 0x5110 <= __SUNPRO_C && !__STDC__) \
|| (defined _MSC_VER && 1939 <= _MSC_VER))
# define _GL_STDBIT_TYPEOF_CAST(a, b) ((__typeof__ (a)) (b)) # define _GL_STDBIT_TYPEOF_CAST(a, b) ((__typeof__ (a)) (b))
#elif 202311 <= __STDC_VERSION__ #elif 202311 <= __STDC_VERSION__
# define _GL_STDBIT_TYPEOF_CAST(a, b) ((typeof (a)) (b)) # define _GL_STDBIT_TYPEOF_CAST(a, b) ((typeof (a)) (b))

View file

@ -20,7 +20,7 @@
#endif #endif
@PRAGMA_COLUMNS@ @PRAGMA_COLUMNS@
#if defined __need_FILE || defined __need___FILE || defined _GL_ALREADY_INCLUDING_STDIO_H #if defined __need_FILE || defined __need___FILE || defined _@GUARD_PREFIX@_ALREADY_INCLUDING_STDIO_H || defined _GL_SKIP_GNULIB_STDIO_H
/* Special invocation convention: /* Special invocation convention:
- Inside glibc header files. - Inside glibc header files.
- On OSF/1 5.1 we have a sequence of nested includes - On OSF/1 5.1 we have a sequence of nested includes
@ -48,12 +48,12 @@
# endif # endif
#endif #endif
#define _GL_ALREADY_INCLUDING_STDIO_H #define _@GUARD_PREFIX@_ALREADY_INCLUDING_STDIO_H
/* The include_next requires a split double-inclusion guard. */ /* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_STDIO_H@ #@INCLUDE_NEXT@ @NEXT_STDIO_H@
#undef _GL_ALREADY_INCLUDING_STDIO_H #undef _@GUARD_PREFIX@_ALREADY_INCLUDING_STDIO_H
#ifdef _GL_DEFINED__POSIX_C_SOURCE #ifdef _GL_DEFINED__POSIX_C_SOURCE
# undef _GL_DEFINED__POSIX_C_SOURCE # undef _GL_DEFINED__POSIX_C_SOURCE

View file

@ -15,7 +15,7 @@
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */ along with this program. If not, see <https://www.gnu.org/licenses/>. */
#define _GL_STDLIB_INLINE _GL_EXTERN_INLINE
#include <config.h> #include <config.h>
#define _GL_STDLIB_INLINE _GL_EXTERN_INLINE
#include <stdlib.h> #include <stdlib.h>

View file

@ -746,15 +746,20 @@ _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
# endif # endif
#endif #endif
/* Return maximum number of bytes of a multibyte character. */ /* Return maximum number of bytes in a multibyte character in the
current locale. */
#if @REPLACE_MB_CUR_MAX@ #if @REPLACE_MB_CUR_MAX@
# if !GNULIB_defined_MB_CUR_MAX # if !GNULIB_defined_MB_CUR_MAX
_GL_STDLIB_INLINE int _GL_STDLIB_INLINE size_t
gl_MB_CUR_MAX (void) gl_MB_CUR_MAX (void)
{ {
# if 0 < @REPLACE_MB_CUR_MAX@
return @REPLACE_MB_CUR_MAX@;
# else
/* Turn the value 3 to the value 4, as needed for the UTF-8 encoding. */ /* Turn the value 3 to the value 4, as needed for the UTF-8 encoding. */
int gl_mb_cur_max = MB_CUR_MAX; int gl_mb_cur_max = MB_CUR_MAX;
return gl_mb_cur_max == 3 ? 4 : gl_mb_cur_max; return gl_mb_cur_max == 3 ? 4 : gl_mb_cur_max;
# endif
} }
# undef MB_CUR_MAX # undef MB_CUR_MAX
# define MB_CUR_MAX gl_MB_CUR_MAX () # define MB_CUR_MAX gl_MB_CUR_MAX ()

View file

@ -20,7 +20,7 @@
#endif #endif
@PRAGMA_COLUMNS@ @PRAGMA_COLUMNS@
#if defined _GL_ALREADY_INCLUDING_STRING_H #if defined _@GUARD_PREFIX@_ALREADY_INCLUDING_STRING_H
/* Special invocation convention: /* Special invocation convention:
- On OS X/NetBSD we have a sequence of nested includes - On OS X/NetBSD we have a sequence of nested includes
<string.h> -> <strings.h> -> "string.h" <string.h> -> <strings.h> -> "string.h"
@ -34,12 +34,12 @@
#ifndef _@GUARD_PREFIX@_STRING_H #ifndef _@GUARD_PREFIX@_STRING_H
#define _GL_ALREADY_INCLUDING_STRING_H #define _@GUARD_PREFIX@_ALREADY_INCLUDING_STRING_H
/* The include_next requires a split double-inclusion guard. */ /* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_STRING_H@ #@INCLUDE_NEXT@ @NEXT_STRING_H@
#undef _GL_ALREADY_INCLUDING_STRING_H #undef _@GUARD_PREFIX@_ALREADY_INCLUDING_STRING_H
#ifndef _@GUARD_PREFIX@_STRING_H #ifndef _@GUARD_PREFIX@_STRING_H
#define _@GUARD_PREFIX@_STRING_H #define _@GUARD_PREFIX@_STRING_H

View file

@ -15,8 +15,8 @@
You should have received a copy of the GNU Lesser General Public License You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */ along with this program. If not, see <https://www.gnu.org/licenses/>. */
#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
#include <config.h> #include <config.h>
#define _GL_UNISTD_INLINE _GL_EXTERN_INLINE
#include <unistd.h> #include <unistd.h>
typedef int dummy; typedef int dummy;

View file

@ -1,5 +1,5 @@
# stdint.m4 # stdint.m4
# serial 63 # serial 64
dnl Copyright (C) 2001-2024 Free Software Foundation, Inc. dnl Copyright (C) 2001-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -158,7 +158,7 @@ uintmax_t j = UINTMAX_MAX;
|| defined __clang__) || defined __clang__)
int k = _Generic (SIZE_MAX, size_t: 0); int k = _Generic (SIZE_MAX, size_t: 0);
#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \ #elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \
|| (0x5110 <= __SUNPRO_C && !__STDC__)) || (0x5110 <= __SUNPRO_C && !__STDC__) || 1939 <= _MSC_VER)
extern size_t k; extern size_t k;
extern __typeof__ (SIZE_MAX) k; extern __typeof__ (SIZE_MAX) k;
#endif #endif

View file

@ -1,5 +1,5 @@
# stdlib_h.m4 # stdlib_h.m4
# serial 82 # serial 84
dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it, dnl gives unlimited permission to copy and/or distribute it,
@ -41,17 +41,18 @@ AC_DEFUN_ONCE([gl_STDLIB_H],
AC_REQUIRE([gt_LOCALE_EN_UTF8]) AC_REQUIRE([gt_LOCALE_EN_UTF8])
AC_CACHE_CHECK([whether MB_CUR_MAX is correct], AC_CACHE_CHECK([whether MB_CUR_MAX is correct],
[gl_cv_macro_MB_CUR_MAX_good], [gl_cv_macro_MB_CUR_MAX_good],
[ [AC_LINK_IFELSE(
dnl Initial guess, used when cross-compiling or when no suitable locale [AC_LANG_PROGRAM([[#include <stdlib.h>
]],
[[return !!MB_CUR_MAX;]])
],
[dnl Initial guess, used when cross-compiling or when no suitable locale
dnl is present. dnl is present.
changequote(,)dnl # Guess no on Solaris and Haiku, yes otherwise.
case "$host_os" in AS_CASE([$host_os],
# Guess no on Solaris and Haiku. [solaris* | haiku*],
solaris* | haiku*) gl_cv_macro_MB_CUR_MAX_good="guessing no" ;; [gl_cv_macro_MB_CUR_MAX_good="guessing no"],
# Guess yes otherwise. [gl_cv_macro_MB_CUR_MAX_good="guessing yes"])
*) gl_cv_macro_MB_CUR_MAX_good="guessing yes" ;;
esac
changequote([,])dnl
if test "$LOCALE_EN_UTF8" != none; then if test "$LOCALE_EN_UTF8" != none; then
AC_RUN_IFELSE( AC_RUN_IFELSE(
[AC_LANG_SOURCE([[ [AC_LANG_SOURCE([[
@ -71,11 +72,17 @@ int main ()
[gl_cv_macro_MB_CUR_MAX_good=no], [gl_cv_macro_MB_CUR_MAX_good=no],
[:]) [:])
fi fi
],
[gl_cv_macro_MB_CUR_MAX_good="link failed - so no"])
]) ])
case "$gl_cv_macro_MB_CUR_MAX_good" in AS_CASE([$gl_cv_macro_MB_CUR_MAX_good],
*yes) ;; [*yes],
*) REPLACE_MB_CUR_MAX=1 ;; [],
esac ["link failed - so no"],
[# 4 suffices as a workaround in Android NDK 16,
# the only known platform with the bug.
REPLACE_MB_CUR_MAX=4],
[REPLACE_MB_CUR_MAX="(-1)"])
AC_CHECK_DECLS_ONCE([ecvt]) AC_CHECK_DECLS_ONCE([ecvt])
if test $ac_cv_have_decl_ecvt = no; then if test $ac_cv_have_decl_ecvt = no; then