Commit 8f4b6a20 authored by Paul Eggert's avatar Paul Eggert
Browse files

Update from gnulib

This incorporates:
2016-09-15 stdint: support new _WIDTH macros
2016-09-15 limits-h: new module
2016-09-15 sys_types: avoid glibc 2.25 warnings about major()
2016-09-15 extensions: port to more ISO C TSes
2016-09-13 intprops: new macro TYPE_WIDTH
2016-09-13 extensions: port to recent ISO C TRs
* .gitignore: Add lib/limits.h.
* doc/misc/texinfo.tex, lib/ftoastr.h, lib/intprops.h:
* lib/stdint.in.h, m4/extensions.m4, m4/stdint.m4, m4/stdio_h.m4:
* m4/sys_types_h.m4: Copy from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/limits.in.h, m4/limits-h.m4: New files, copie from gnulib.
* nt/gnulib.mk: Merge changes from lib/gnulib.mk.
parent 3c586e18
...@@ -67,6 +67,7 @@ lib/fcntl.h ...@@ -67,6 +67,7 @@ lib/fcntl.h
lib/getopt.h lib/getopt.h
lib/inttypes.h lib/inttypes.h
lib/libgnu.a lib/libgnu.a
lib/limits.h
lib/signal.h lib/signal.h
lib/std*.h lib/std*.h
!lib/std*.in.h !lib/std*.in.h
......
...@@ -3,7 +3,7 @@ ...@@ -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{2016-08-16.20} \def\texinfoversion{2016-09-12.20}
% %
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
...@@ -862,36 +862,6 @@ ...@@ -862,36 +862,6 @@
\temp \temp
} }
% @| inserts a changebar to the left of the current line. It should
% surround any changed text. This approach does *not* work if the
% change spans more than two lines of output. To handle that, we would
% have adopt a much more difficult approach (putting marks into the main
% vertical list for the beginning and end of each change). This command
% is not documented, not supported, and doesn't work.
%
\def\|{%
% \vadjust can only be used in horizontal mode.
\leavevmode
%
% Append this vertical mode material after the current line in the output.
\vadjust{%
% We want to insert a rule with the height and depth of the current
% leading; that is exactly what \strutbox is supposed to record.
\vskip-\baselineskip
%
% \vadjust-items are inserted at the left edge of the type. So
% the \llap here moves out into the left-hand margin.
\llap{%
%
% For a thicker or thinner bar, change the `1pt'.
\vrule height\baselineskip width1pt
%
% This is the space between the bar and the text.
\hskip 12pt
}%
}%
}
% @include FILE -- \input text of FILE. % @include FILE -- \input text of FILE.
% %
\def\include{\parseargusing\filenamecatcodes\includezzz} \def\include{\parseargusing\filenamecatcodes\includezzz}
...@@ -1885,40 +1855,9 @@ ...@@ -1885,40 +1855,9 @@
} }
\fi \fi
\message{fonts,}
% Change the current font style to #1, remembering it in \curfontstyle.
% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
% italics, not bold italics.
%
\def\setfontstyle#1{%
\def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
\csname ten#1\endcsname % change the current font
}
% Select #1 fonts with the current style.
% %
\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} \message{fonts,}
\def\rm{\fam=0 \setfontstyle{rm}}
\def\it{\fam=\itfam \setfontstyle{it}}
\def\sl{\fam=\slfam \setfontstyle{sl}}
\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
\def\tt{\fam=\ttfam \setfontstyle{tt}}
% Unfortunately, we have to override this for titles and the like, since
% in those cases "rm" is bold. Sigh.
\def\rmisbold{\rm\def\curfontstyle{bf}}
% Texinfo sort of supports the sans serif font style, which plain TeX does not.
% So we set up a \sf.
\newfam\sffam
\def\sf{\fam=\sffam \setfontstyle{sf}}
\let\li = \sf % Sometimes we call it \li, not \sf.
% We don't need math for this font style.
\def\ttsl{\setfontstyle{ttsl}}
% Set the baselineskip to #1, and the lineskip and strut size % Set the baselineskip to #1, and the lineskip and strut size
% correspondingly. There is no deep meaning behind these magic numbers % correspondingly. There is no deep meaning behind these magic numbers
...@@ -2269,8 +2208,8 @@ ...@@ -2269,8 +2208,8 @@
\setfont\deftt\ttshape{10}{\magstep1}{OT1TT} \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
\setfont\defsl\slshape{10}{\magstep1}{OT1TT} \setfont\defsl\slshape{10}{\magstep1}{OT1TT}
\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \def\df{\let\ttfont=\deftt \let\bffont = \defbf
\let\tenttsl=\defttsl \let\tensl=\defsl \bf} \let\ttfontsl=\defttsl \let\slfont=\defsl \bf}
% Fonts for indices, footnotes, small examples (9pt). % Fonts for indices, footnotes, small examples (9pt).
\def\smallnominalsize{9pt} \def\smallnominalsize{9pt}
...@@ -2403,8 +2342,8 @@ ...@@ -2403,8 +2342,8 @@
\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
\setfont\defsl\slshape{10}{\magstephalf}{OT1TT} \setfont\defsl\slshape{10}{\magstephalf}{OT1TT}
\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \def\df{\let\ttfont=\deftt \let\bffont = \defbf
\let\tensl=\defsl \let\tenttsl=\defttsl \bf} \let\slfont=\defsl \let\ttfontsl=\defttsl \bf}
% Fonts for indices, footnotes, small examples (9pt). % Fonts for indices, footnotes, small examples (9pt).
\def\smallnominalsize{9pt} \def\smallnominalsize{9pt}
...@@ -2510,6 +2449,12 @@ ...@@ -2510,6 +2449,12 @@
\rm \rm
} % end of 10pt text font size definitions, \definetextfontsizex } % end of 10pt text font size definitions, \definetextfontsizex
% Fonts for short table of contents.
\setfont\shortcontrm\rmshape{12}{1000}{OT1}
\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
\setfont\shortcontsl\slshape{12}{1000}{OT1}
\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
% We provide the user-level command % We provide the user-level command
% @fonttextsize 10 % @fonttextsize 10
...@@ -2536,20 +2481,55 @@ ...@@ -2536,20 +2481,55 @@
\endgroup \endgroup
} }
%
% Change the current font style to #1, remembering it in \curfontstyle.
% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
% italics, not bold italics.
%
\def\setfontstyle#1{%
\def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
\csname #1font\endcsname % change the current font
}
\def\rm{\fam=0 \setfontstyle{rm}}
\def\it{\fam=\itfam \setfontstyle{it}}
\def\sl{\fam=\slfam \setfontstyle{sl}}
\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
\def\tt{\fam=\ttfam \setfontstyle{tt}}
% Unfortunately, we have to override this for titles and the like, since
% in those cases "rm" is bold. Sigh.
\def\rmisbold{\rm\def\curfontstyle{bf}}
% Texinfo sort of supports the sans serif font style, which plain TeX does not.
% So we set up a \sf.
\newfam\sffam
\def\sf{\fam=\sffam \setfontstyle{sf}}
% We don't need math for this font style.
\def\ttsl{\setfontstyle{ttsl}}
% In order for the font changes to affect most math symbols and letters, % In order for the font changes to affect most math symbols and letters,
% we have to define the \textfont of the standard families. We don't % we have to define the \textfont of the standard families. We don't
% bother to reset \scriptfont and \scriptscriptfont; awaiting user need. % bother to reset \scriptfont and \scriptscriptfont; awaiting user need.
% %
\def\resetmathfonts{% \def\resetmathfonts{%
\textfont0=\tenrm \textfont1=\teni \textfont2=\tensy \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont
\textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont
\textfont\ttfam=\tentt \textfont\sffam=\tensf \textfont\ttfam=\ttfont \textfont\sffam=\sffont
} }
% The font-changing commands redefine the meanings of \tenSTYLE, instead % Select #1 fonts with the current style. Used to change font size
% in, e.g., the LaTeX logo and acronyms.
%
\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
% 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 % 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 % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
% \tenSTYLE to set the current font. % \STYLEfont to set the current font.
% %
% Each font-changing command also sets the names \lsize (one size lower) % Each font-changing command also sets the names \lsize (one size lower)
% and \lllsize (three sizes lower). These relative commands are used % and \lllsize (three sizes lower). These relative commands are used
...@@ -2558,78 +2538,72 @@ ...@@ -2558,78 +2538,72 @@
% This all needs generalizing, badly. % This all needs generalizing, badly.
% %
\def\textfonts{% \def\textfonts{%
\let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\rmfont=\textrm \let\itfont=\textit \let\slfont=\textsl
\let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\bffont=\textbf \let\ttfont=\texttt \let\smallcaps=\textsc
\let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\sffont=\textsf \let\ifont=\texti \let\syfont=\textsy
\let\tenttsl=\textttsl \let\ttfontsl=\textttsl
\def\curfontsize{text}% \def\curfontsize{text}%
\def\lsize{reduced}\def\lllsize{smaller}% \def\lsize{reduced}\def\lllsize{smaller}%
\resetmathfonts \setleading{\textleading}} \resetmathfonts \setleading{\textleading}}
\def\titlefonts{% \def\titlefonts{%
\let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\rmfont=\titlerm \let\itfont=\titleit \let\slfont=\titlesl
\let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\bffont=\titlebf \let\ttfont=\titlett \let\smallcaps=\titlesc
\let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\sffont=\titlesf \let\ifont=\titlei \let\syfont=\titlesy
\let\tenttsl=\titlettsl \let\ttfontsl=\titlettsl
\def\curfontsize{title}% \def\curfontsize{title}%
\def\lsize{chap}\def\lllsize{subsec}% \def\lsize{chap}\def\lllsize{subsec}%
\resetmathfonts \setleading{27pt}} \resetmathfonts \setleading{27pt}}
\def\titlefont#1{{\titlefonts\rmisbold #1}} \def\titlefont#1{{\titlefonts\rmisbold #1}}
\def\chapfonts{% \def\chapfonts{%
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\rmfont=\chaprm \let\itfont=\chapit \let\slfont=\chapsl
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\bffont=\chapbf \let\ttfont=\chaptt \let\smallcaps=\chapsc
\let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\sffont=\chapsf \let\ifont=\chapi \let\syfont=\chapsy
\let\tenttsl=\chapttsl \let\ttfontsl=\chapttsl
\def\curfontsize{chap}% \def\curfontsize{chap}%
\def\lsize{sec}\def\lllsize{text}% \def\lsize{sec}\def\lllsize{text}%
\resetmathfonts \setleading{19pt}} \resetmathfonts \setleading{19pt}}
\def\secfonts{% \def\secfonts{%
\let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\rmfont=\secrm \let\itfont=\secit \let\slfont=\secsl
\let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc \let\bffont=\secbf \let\ttfont=\sectt \let\smallcaps=\secsc
\let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\sffont=\secsf \let\ifont=\seci \let\syfont=\secsy
\let\tenttsl=\secttsl \let\ttfontsl=\secttsl
\def\curfontsize{sec}% \def\curfontsize{sec}%
\def\lsize{subsec}\def\lllsize{reduced}% \def\lsize{subsec}\def\lllsize{reduced}%
\resetmathfonts \setleading{17pt}} \resetmathfonts \setleading{17pt}}
\def\subsecfonts{% \def\subsecfonts{%
\let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\rmfont=\ssecrm \let\itfont=\ssecit \let\slfont=\ssecsl
\let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc \let\bffont=\ssecbf \let\ttfont=\ssectt \let\smallcaps=\ssecsc
\let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\sffont=\ssecsf \let\ifont=\sseci \let\syfont=\ssecsy
\let\tenttsl=\ssecttsl \let\ttfontsl=\ssecttsl
\def\curfontsize{ssec}% \def\curfontsize{ssec}%
\def\lsize{text}\def\lllsize{small}% \def\lsize{text}\def\lllsize{small}%
\resetmathfonts \setleading{15pt}} \resetmathfonts \setleading{15pt}}
\let\subsubsecfonts = \subsecfonts \let\subsubsecfonts = \subsecfonts
\def\reducedfonts{% \def\reducedfonts{%
\let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl \let\rmfont=\reducedrm \let\itfont=\reducedit \let\slfont=\reducedsl
\let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc \let\bffont=\reducedbf \let\ttfont=\reducedtt \let\reducedcaps=\reducedsc
\let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy \let\sffont=\reducedsf \let\ifont=\reducedi \let\syfont=\reducedsy
\let\tenttsl=\reducedttsl \let\ttfontsl=\reducedttsl
\def\curfontsize{reduced}% \def\curfontsize{reduced}%
\def\lsize{small}\def\lllsize{smaller}% \def\lsize{small}\def\lllsize{smaller}%
\resetmathfonts \setleading{10.5pt}} \resetmathfonts \setleading{10.5pt}}
\def\smallfonts{% \def\smallfonts{%
\let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl \let\rmfont=\smallrm \let\itfont=\smallit \let\slfont=\smallsl
\let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc \let\bffont=\smallbf \let\ttfont=\smalltt \let\smallcaps=\smallsc
\let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy \let\sffont=\smallsf \let\ifont=\smalli \let\syfont=\smallsy
\let\tenttsl=\smallttsl \let\ttfontsl=\smallttsl
\def\curfontsize{small}% \def\curfontsize{small}%
\def\lsize{smaller}\def\lllsize{smaller}% \def\lsize{smaller}\def\lllsize{smaller}%
\resetmathfonts \setleading{10.5pt}} \resetmathfonts \setleading{10.5pt}}
\def\smallerfonts{% \def\smallerfonts{%
\let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl \let\rmfont=\smallerrm \let\itfont=\smallerit \let\slfont=\smallersl
\let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc \let\bffont=\smallerbf \let\ttfont=\smallertt \let\smallcaps=\smallersc
\let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy \let\sffont=\smallersf \let\ifont=\smalleri \let\syfont=\smallersy
\let\tenttsl=\smallerttsl \let\ttfontsl=\smallerttsl
\def\curfontsize{smaller}% \def\curfontsize{smaller}%
\def\lsize{smaller}\def\lllsize{smaller}% \def\lsize{smaller}\def\lllsize{smaller}%
\resetmathfonts \setleading{9.5pt}} \resetmathfonts \setleading{9.5pt}}
% Fonts for short table of contents.
\setfont\shortcontrm\rmshape{12}{1000}{OT1}
\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
\setfont\shortcontsl\slshape{12}{1000}{OT1}
\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
% Define these just so they can be easily changed for other fonts. % Define these just so they can be easily changed for other fonts.
\def\angleleft{$\langle$} \def\angleleft{$\langle$}
\def\angleright{$\rangle$} \def\angleright{$\rangle$}
...@@ -3535,7 +3509,7 @@ ...@@ -3535,7 +3509,7 @@
% %
\newbox\errorbox \newbox\errorbox
% %
{\tentt \global\dimen0 = 3em}% Width of the box. {\ttfont \global\dimen0 = 3em}% Width of the box.
\dimen2 = .55pt % Thickness of rules \dimen2 = .55pt % Thickness of rules
% The text. (`r' is open on the right, `e' somewhat less so on the left.) % The text. (`r' is open on the right, `e' somewhat less so on the left.)
\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
...@@ -3794,7 +3768,7 @@ ...@@ -3794,7 +3768,7 @@
% Macros to be used within @titlepage: % Macros to be used within @titlepage:
\let\subtitlerm=\tenrm \let\subtitlerm=\rmfont
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
\parseargdef\title{% \parseargdef\title{%
...@@ -7946,7 +7920,7 @@ ...@@ -7946,7 +7920,7 @@
\fi % no return type \fi % no return type
#3% output function name #3% output function name
}% }%
{\rm\enskip}% hskip 0.5 em of \tenrm {\rm\enskip}% hskip 0.5 em of \rmfont
% %
\boldbrax \boldbrax
% arguments will be output next, if any. % arguments will be output next, if any.
...@@ -11717,7 +11691,4 @@ ...@@ -11717,7 +11691,4 @@
@c vim:sw=2: @c vim:sw=2:
@ignore
arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
@end ignore
@enablebackslashhack @enablebackslashhack
...@@ -88,7 +88,7 @@ enum ...@@ -88,7 +88,7 @@ enum
# elif FLT_RADIX <= 16 /* IBM hex floating point has FLT_RADIX == 16. */ # elif FLT_RADIX <= 16 /* IBM hex floating point has FLT_RADIX == 16. */
# define _GL_FLOAT_DIG_BITS_BOUND 4 # define _GL_FLOAT_DIG_BITS_BOUND 4
# else /* no machine is this bad, but let's be complete */ # else /* no machine is this bad, but let's be complete */
# define _GL_FLOAT_DIG_BITS_BOUND (CHAR_BIT * (int) sizeof (int) - 1) # define _GL_FLOAT_DIG_BITS_BOUND ((int) TYPE_WIDTH (int) - 1)
# endif # endif
/* An upper bound on the number of decimal digits needed to represent /* An upper bound on the number of decimal digits needed to represent
......
...@@ -643,6 +643,34 @@ EXTRA_DIST += inttypes.in.h ...@@ -643,6 +643,34 @@ EXTRA_DIST += inttypes.in.h
## end gnulib module inttypes-incomplete ## end gnulib module inttypes-incomplete
## begin gnulib module limits-h
BUILT_SOURCES += $(LIMITS_H)
# We need the following in order to create <limits.h> when the system
# doesn't have one that is compatible with GNU.
if GL_GENERATE_LIMITS_H
limits.h: limits.in.h $(top_builddir)/config.status
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \
< $(srcdir)/limits.in.h; \
} > $@-t && \
mv $@-t $@
else
limits.h: $(top_builddir)/config.status
rm -f $@
endif
MOSTLYCLEANFILES += limits.h limits.h-t
EXTRA_DIST += limits.in.h
## end gnulib module limits-h
## begin gnulib module lstat ## begin gnulib module lstat
...@@ -1006,6 +1034,7 @@ stdint.h: stdint.in.h $(top_builddir)/config.status ...@@ -1006,6 +1034,7 @@ stdint.h: stdint.in.h $(top_builddir)/config.status
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
-e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \
-e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
-e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
-e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
......
...@@ -51,12 +51,16 @@ ...@@ -51,12 +51,16 @@
/* Minimum and maximum values for integer types and expressions. */ /* Minimum and maximum values for integer types and expressions. */
/* The width in bits of the integer type or expression T.
Padding bits are not supported; this is checked at compile-time below. */
#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
/* The maximum and minimum values for the integer type T. */ /* The maximum and minimum values for the integer type T. */
#define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t)) #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
#define TYPE_MAXIMUM(t) \ #define TYPE_MAXIMUM(t) \
((t) (! TYPE_SIGNED (t) \ ((t) (! TYPE_SIGNED (t) \
? (t) -1 \ ? (t) -1 \
: ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
/* The maximum and minimum values for the type of the expression E, /* The maximum and minimum values for the type of the expression E,
after integer promotion. E should not have side effects. */ after integer promotion. E should not have side effects. */
...@@ -69,7 +73,7 @@ ...@@ -69,7 +73,7 @@
? _GL_SIGNED_INT_MAXIMUM (e) \ ? _GL_SIGNED_INT_MAXIMUM (e) \
: _GL_INT_NEGATE_CONVERT (e, 1)) : _GL_INT_NEGATE_CONVERT (e, 1))
#define _GL_SIGNED_INT_MAXIMUM(e) \ #define _GL_SIGNED_INT_MAXIMUM(e) \
(((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1) (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1)
/* Work around OpenVMS incompatibility with C99. */ /* Work around OpenVMS incompatibility with C99. */
#if !defined LLONG_MAX && defined __INT64_MAX #if !defined LLONG_MAX && defined __INT64_MAX
...@@ -94,6 +98,10 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX); ...@@ -94,6 +98,10 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX);
verify (TYPE_MINIMUM (long long int) == LLONG_MIN); verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
#endif #endif
/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined. */
#ifdef UINT_WIDTH
verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
#endif
/* 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. */
...@@ -126,8 +134,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); ...@@ -126,8 +134,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
signed, this macro may overestimate the true bound by one byte when signed, this macro may overestimate the true bound by one byte when
applied to unsigned types of size 2, 4, 16, ... bytes. */ applied to unsigned types of size 2, 4, 16, ... bytes. */
#define INT_STRLEN_BOUND(t) \ #define INT_STRLEN_BOUND(t) \
(INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT \ (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \
- _GL_SIGNED_TYPE_OR_EXPR (t)) \
+ _GL_SIGNED_TYPE_OR_EXPR (t)) + _GL_SIGNED_TYPE_OR_EXPR (t))
/* Bound on buffer size needed to represent an integer type or expression T, /* Bound on buffer size needed to represent an integer type or expression T,
......
/* A GNU-like <limits.h>.
Copyright 2016 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 3, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
#ifndef _@GUARD_PREFIX@_LIMITS_H
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
/* The include_next requires a split double-inclusion guard. */
#@INCLUDE_NEXT@ @NEXT_LIMITS_H@
#ifndef _@GUARD_PREFIX@_LIMITS_H
#define _@GUARD_PREFIX@_LIMITS_H
/* The number of usable bits in an unsigned or signed integer type
with minimum value MIN and maximum value MAX, as an int expression
suitable in #if. Cover all known practical hosts. This
implementation exploits the fact that MAX is 1 less than a power of
2, and merely counts the number of 1 bits in MAX; "COBn" means
"count the number of 1 bits in the low-order n bits"). */
#define _GL_INTEGER_WIDTH(min, max) (((min) < 0) + _GL_COB128 (max))
#define _GL_COB128(n) (_GL_COB64 ((n) >> 31 >> 31 >> 2) + _GL_COB64 (n))
#define _GL_COB64(n) (_GL_COB32 ((n) >> 31 >> 1) + _GL_COB32 (n))
#define _GL_COB32(n) (_GL_COB16 ((n) >> 16) + _GL_COB16 (n))
#define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n))
#define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n))
#define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1))
/* Macros specified by ISO/IEC TS 18661-1:2014. */
#if (! defined ULLONG_WIDTH \
&& (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__))
# define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX)
# define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX)
# define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX)
# define SHRT_WIDTH _GL_INTEGER_WIDTH (SHRT_MIN, SHRT_MAX)
# define USHRT_WIDTH _GL_INTEGER_WIDTH (0, USHRT_MAX)
# define INT_WIDTH _GL_INTEGER_WIDTH (INT_MIN, INT_MAX)
# define UINT_WIDTH _GL_INTEGER_WIDTH (0, UINT_MAX)
# define LONG_WIDTH _GL_INTEGER_WIDTH (LONG_MIN, LONG_MAX)
# define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX)
# define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX)
# define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX)
#endif /* !ULLONG_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */
#endif /* _@GUARD_PREFIX@_LIMITS_H */
#endif /* _@GUARD_PREFIX@_LIMITS_H */
This diff is collapsed.
# serial 13 -*- Autoconf -*- # serial 14 -*- Autoconf -*-
# Enable extensions on systems that normally disable them. # Enable extensions on systems that normally disable them.
# Copyright (C) 2003, 2006-2016 Free Software Foundation, Inc.