diff options
| author | Paul Eggert | 2016-09-15 11:50:23 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-09-15 15:55:30 -0700 |
| commit | 8f4b6a20bfec96086845b2f7161e121b1e41b4ad (patch) | |
| tree | e8c4a85626437b0f77ed0a7b575e7627d45dce9e | |
| parent | 3c586e182c0694896dda670f5fc663b46c9bac63 (diff) | |
| download | emacs-8f4b6a20bfec96086845b2f7161e121b1e41b4ad.tar.gz emacs-8f4b6a20bfec96086845b2f7161e121b1e41b4ad.zip | |
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.
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | doc/misc/texinfo.tex | 203 | ||||
| -rw-r--r-- | lib/ftoastr.h | 2 | ||||
| -rw-r--r-- | lib/gnulib.mk | 29 | ||||
| -rw-r--r-- | lib/intprops.h | 15 | ||||
| -rw-r--r-- | lib/limits.in.h | 63 | ||||
| -rw-r--r-- | lib/stdint.in.h | 747 | ||||
| -rw-r--r-- | m4/extensions.m4 | 44 | ||||
| -rw-r--r-- | m4/gnulib-comp.m4 | 4 | ||||
| -rw-r--r-- | m4/limits-h.m4 | 29 | ||||
| -rw-r--r-- | m4/stdint.m4 | 48 | ||||
| -rw-r--r-- | m4/stdio_h.m4 | 6 | ||||
| -rw-r--r-- | m4/sys_types_h.m4 | 27 | ||||
| -rw-r--r-- | nt/gnulib.mk | 29 |
14 files changed, 756 insertions, 491 deletions
diff --git a/.gitignore b/.gitignore index a81a515c724..15f9c5699cd 100644 --- a/.gitignore +++ b/.gitignore | |||
| @@ -67,6 +67,7 @@ lib/fcntl.h | |||
| 67 | lib/getopt.h | 67 | lib/getopt.h |
| 68 | lib/inttypes.h | 68 | lib/inttypes.h |
| 69 | lib/libgnu.a | 69 | lib/libgnu.a |
| 70 | lib/limits.h | ||
| 70 | lib/signal.h | 71 | lib/signal.h |
| 71 | lib/std*.h | 72 | lib/std*.h |
| 72 | !lib/std*.in.h | 73 | !lib/std*.in.h |
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index 5e260ed8f9c..a7469b22f30 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | % Load plain if necessary, i.e., if running under initex. | 3 | % Load plain if necessary, i.e., if running under initex. |
| 4 | \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi | 4 | \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi |
| 5 | % | 5 | % |
| 6 | \def\texinfoversion{2016-08-16.20} | 6 | \def\texinfoversion{2016-09-12.20} |
| 7 | % | 7 | % |
| 8 | % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, | 8 | % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, |
| 9 | % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, | 9 | % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, |
| @@ -862,36 +862,6 @@ where each line of input produces a line of output.} | |||
| 862 | \temp | 862 | \temp |
| 863 | } | 863 | } |
| 864 | 864 | ||
| 865 | % @| inserts a changebar to the left of the current line. It should | ||
| 866 | % surround any changed text. This approach does *not* work if the | ||
| 867 | % change spans more than two lines of output. To handle that, we would | ||
| 868 | % have adopt a much more difficult approach (putting marks into the main | ||
| 869 | % vertical list for the beginning and end of each change). This command | ||
| 870 | % is not documented, not supported, and doesn't work. | ||
| 871 | % | ||
| 872 | \def\|{% | ||
| 873 | % \vadjust can only be used in horizontal mode. | ||
| 874 | \leavevmode | ||
| 875 | % | ||
| 876 | % Append this vertical mode material after the current line in the output. | ||
| 877 | \vadjust{% | ||
| 878 | % We want to insert a rule with the height and depth of the current | ||
| 879 | % leading; that is exactly what \strutbox is supposed to record. | ||
| 880 | \vskip-\baselineskip | ||
| 881 | % | ||
| 882 | % \vadjust-items are inserted at the left edge of the type. So | ||
| 883 | % the \llap here moves out into the left-hand margin. | ||
| 884 | \llap{% | ||
| 885 | % | ||
| 886 | % For a thicker or thinner bar, change the `1pt'. | ||
| 887 | \vrule height\baselineskip width1pt | ||
| 888 | % | ||
| 889 | % This is the space between the bar and the text. | ||
| 890 | \hskip 12pt | ||
| 891 | }% | ||
| 892 | }% | ||
| 893 | } | ||
| 894 | |||
| 895 | % @include FILE -- \input text of FILE. | 865 | % @include FILE -- \input text of FILE. |
| 896 | % | 866 | % |
| 897 | \def\include{\parseargusing\filenamecatcodes\includezzz} | 867 | \def\include{\parseargusing\filenamecatcodes\includezzz} |
| @@ -1885,40 +1855,9 @@ output) for that.)} | |||
| 1885 | } | 1855 | } |
| 1886 | \fi | 1856 | \fi |
| 1887 | 1857 | ||
| 1888 | \message{fonts,} | ||
| 1889 | 1858 | ||
| 1890 | % Change the current font style to #1, remembering it in \curfontstyle. | ||
| 1891 | % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in | ||
| 1892 | % italics, not bold italics. | ||
| 1893 | % | ||
| 1894 | \def\setfontstyle#1{% | ||
| 1895 | \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. | ||
| 1896 | \csname ten#1\endcsname % change the current font | ||
| 1897 | } | ||
| 1898 | |||
| 1899 | % Select #1 fonts with the current style. | ||
| 1900 | % | 1859 | % |
| 1901 | \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} | 1860 | \message{fonts,} |
| 1902 | |||
| 1903 | \def\rm{\fam=0 \setfontstyle{rm}} | ||
| 1904 | \def\it{\fam=\itfam \setfontstyle{it}} | ||
| 1905 | \def\sl{\fam=\slfam \setfontstyle{sl}} | ||
| 1906 | \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} | ||
| 1907 | \def\tt{\fam=\ttfam \setfontstyle{tt}} | ||
| 1908 | |||
| 1909 | % Unfortunately, we have to override this for titles and the like, since | ||
| 1910 | % in those cases "rm" is bold. Sigh. | ||
| 1911 | \def\rmisbold{\rm\def\curfontstyle{bf}} | ||
| 1912 | |||
| 1913 | % Texinfo sort of supports the sans serif font style, which plain TeX does not. | ||
| 1914 | % So we set up a \sf. | ||
| 1915 | \newfam\sffam | ||
| 1916 | \def\sf{\fam=\sffam \setfontstyle{sf}} | ||
| 1917 | \let\li = \sf % Sometimes we call it \li, not \sf. | ||
| 1918 | |||
| 1919 | % We don't need math for this font style. | ||
| 1920 | \def\ttsl{\setfontstyle{ttsl}} | ||
| 1921 | |||
| 1922 | 1861 | ||
| 1923 | % Set the baselineskip to #1, and the lineskip and strut size | 1862 | % Set the baselineskip to #1, and the lineskip and strut size |
| 1924 | % correspondingly. There is no deep meaning behind these magic numbers | 1863 | % correspondingly. There is no deep meaning behind these magic numbers |
| @@ -2269,8 +2208,8 @@ end | |||
| 2269 | \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} | 2208 | \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} |
| 2270 | \setfont\defsl\slshape{10}{\magstep1}{OT1TT} | 2209 | \setfont\defsl\slshape{10}{\magstep1}{OT1TT} |
| 2271 | \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} | 2210 | \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} |
| 2272 | \def\df{\let\tentt=\deftt \let\tenbf = \defbf | 2211 | \def\df{\let\ttfont=\deftt \let\bffont = \defbf |
| 2273 | \let\tenttsl=\defttsl \let\tensl=\defsl \bf} | 2212 | \let\ttfontsl=\defttsl \let\slfont=\defsl \bf} |
| 2274 | 2213 | ||
| 2275 | % Fonts for indices, footnotes, small examples (9pt). | 2214 | % Fonts for indices, footnotes, small examples (9pt). |
| 2276 | \def\smallnominalsize{9pt} | 2215 | \def\smallnominalsize{9pt} |
| @@ -2403,8 +2342,8 @@ end | |||
| 2403 | \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} | 2342 | \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} |
| 2404 | \setfont\defsl\slshape{10}{\magstephalf}{OT1TT} | 2343 | \setfont\defsl\slshape{10}{\magstephalf}{OT1TT} |
| 2405 | \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} | 2344 | \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} |
| 2406 | \def\df{\let\tentt=\deftt \let\tenbf = \defbf | 2345 | \def\df{\let\ttfont=\deftt \let\bffont = \defbf |
| 2407 | \let\tensl=\defsl \let\tenttsl=\defttsl \bf} | 2346 | \let\slfont=\defsl \let\ttfontsl=\defttsl \bf} |
| 2408 | 2347 | ||
| 2409 | % Fonts for indices, footnotes, small examples (9pt). | 2348 | % Fonts for indices, footnotes, small examples (9pt). |
| 2410 | \def\smallnominalsize{9pt} | 2349 | \def\smallnominalsize{9pt} |
| @@ -2510,6 +2449,12 @@ end | |||
| 2510 | \rm | 2449 | \rm |
| 2511 | } % end of 10pt text font size definitions, \definetextfontsizex | 2450 | } % end of 10pt text font size definitions, \definetextfontsizex |
| 2512 | 2451 | ||
| 2452 | % Fonts for short table of contents. | ||
| 2453 | \setfont\shortcontrm\rmshape{12}{1000}{OT1} | ||
| 2454 | \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 | ||
| 2455 | \setfont\shortcontsl\slshape{12}{1000}{OT1} | ||
| 2456 | \setfont\shortconttt\ttshape{12}{1000}{OT1TT} | ||
| 2457 | |||
| 2513 | 2458 | ||
| 2514 | % We provide the user-level command | 2459 | % We provide the user-level command |
| 2515 | % @fonttextsize 10 | 2460 | % @fonttextsize 10 |
| @@ -2536,20 +2481,55 @@ end | |||
| 2536 | \endgroup | 2481 | \endgroup |
| 2537 | } | 2482 | } |
| 2538 | 2483 | ||
| 2484 | % | ||
| 2485 | % Change the current font style to #1, remembering it in \curfontstyle. | ||
| 2486 | % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in | ||
| 2487 | % italics, not bold italics. | ||
| 2488 | % | ||
| 2489 | \def\setfontstyle#1{% | ||
| 2490 | \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. | ||
| 2491 | \csname #1font\endcsname % change the current font | ||
| 2492 | } | ||
| 2493 | |||
| 2494 | \def\rm{\fam=0 \setfontstyle{rm}} | ||
| 2495 | \def\it{\fam=\itfam \setfontstyle{it}} | ||
| 2496 | \def\sl{\fam=\slfam \setfontstyle{sl}} | ||
| 2497 | \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} | ||
| 2498 | \def\tt{\fam=\ttfam \setfontstyle{tt}} | ||
| 2499 | |||
| 2500 | % Unfortunately, we have to override this for titles and the like, since | ||
| 2501 | % in those cases "rm" is bold. Sigh. | ||
| 2502 | \def\rmisbold{\rm\def\curfontstyle{bf}} | ||
| 2503 | |||
| 2504 | % Texinfo sort of supports the sans serif font style, which plain TeX does not. | ||
| 2505 | % So we set up a \sf. | ||
| 2506 | \newfam\sffam | ||
| 2507 | \def\sf{\fam=\sffam \setfontstyle{sf}} | ||
| 2508 | |||
| 2509 | % We don't need math for this font style. | ||
| 2510 | \def\ttsl{\setfontstyle{ttsl}} | ||
| 2511 | |||
| 2512 | |||
| 2539 | % In order for the font changes to affect most math symbols and letters, | 2513 | % In order for the font changes to affect most math symbols and letters, |
| 2540 | % we have to define the \textfont of the standard families. We don't | 2514 | % we have to define the \textfont of the standard families. We don't |
| 2541 | % bother to reset \scriptfont and \scriptscriptfont; awaiting user need. | 2515 | % bother to reset \scriptfont and \scriptscriptfont; awaiting user need. |
| 2542 | % | 2516 | % |
| 2543 | \def\resetmathfonts{% | 2517 | \def\resetmathfonts{% |
| 2544 | \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy | 2518 | \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont |
| 2545 | \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf | 2519 | \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont |
| 2546 | \textfont\ttfam=\tentt \textfont\sffam=\tensf | 2520 | \textfont\ttfam=\ttfont \textfont\sffam=\sffont |
| 2547 | } | 2521 | } |
| 2548 | 2522 | ||
| 2549 | % The font-changing commands redefine the meanings of \tenSTYLE, instead | 2523 | % Select #1 fonts with the current style. Used to change font size |
| 2524 | % in, e.g., the LaTeX logo and acronyms. | ||
| 2525 | % | ||
| 2526 | \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} | ||
| 2527 | |||
| 2528 | % The font-changing commands (all called \...fonts) redefine the meanings of | ||
| 2529 | % \STYLEfont, instead | ||
| 2550 | % of just \STYLE. We do this because \STYLE needs to also set the | 2530 | % of just \STYLE. We do this because \STYLE needs to also set the |
| 2551 | % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire | 2531 | % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire |
| 2552 | % \tenSTYLE to set the current font. | 2532 | % \STYLEfont to set the current font. |
| 2553 | % | 2533 | % |
| 2554 | % Each font-changing command also sets the names \lsize (one size lower) | 2534 | % Each font-changing command also sets the names \lsize (one size lower) |
| 2555 | % and \lllsize (three sizes lower). These relative commands are used | 2535 | % and \lllsize (three sizes lower). These relative commands are used |
| @@ -2558,78 +2538,72 @@ end | |||
| 2558 | % This all needs generalizing, badly. | 2538 | % This all needs generalizing, badly. |
| 2559 | % | 2539 | % |
| 2560 | \def\textfonts{% | 2540 | \def\textfonts{% |
| 2561 | \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl | 2541 | \let\rmfont=\textrm \let\itfont=\textit \let\slfont=\textsl |
| 2562 | \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc | 2542 | \let\bffont=\textbf \let\ttfont=\texttt \let\smallcaps=\textsc |
| 2563 | \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy | 2543 | \let\sffont=\textsf \let\ifont=\texti \let\syfont=\textsy |
| 2564 | \let\tenttsl=\textttsl | 2544 | \let\ttfontsl=\textttsl |
| 2565 | \def\curfontsize{text}% | 2545 | \def\curfontsize{text}% |
| 2566 | \def\lsize{reduced}\def\lllsize{smaller}% | 2546 | \def\lsize{reduced}\def\lllsize{smaller}% |
| 2567 | \resetmathfonts \setleading{\textleading}} | 2547 | \resetmathfonts \setleading{\textleading}} |
| 2568 | \def\titlefonts{% | 2548 | \def\titlefonts{% |
| 2569 | \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl | 2549 | \let\rmfont=\titlerm \let\itfont=\titleit \let\slfont=\titlesl |
| 2570 | \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc | 2550 | \let\bffont=\titlebf \let\ttfont=\titlett \let\smallcaps=\titlesc |
| 2571 | \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy | 2551 | \let\sffont=\titlesf \let\ifont=\titlei \let\syfont=\titlesy |
| 2572 | \let\tenttsl=\titlettsl | 2552 | \let\ttfontsl=\titlettsl |
| 2573 | \def\curfontsize{title}% | 2553 | \def\curfontsize{title}% |
| 2574 | \def\lsize{chap}\def\lllsize{subsec}% | 2554 | \def\lsize{chap}\def\lllsize{subsec}% |
| 2575 | \resetmathfonts \setleading{27pt}} | 2555 | \resetmathfonts \setleading{27pt}} |
| 2576 | \def\titlefont#1{{\titlefonts\rmisbold #1}} | 2556 | \def\titlefont#1{{\titlefonts\rmisbold #1}} |
| 2577 | \def\chapfonts{% | 2557 | \def\chapfonts{% |
| 2578 | \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl | 2558 | \let\rmfont=\chaprm \let\itfont=\chapit \let\slfont=\chapsl |
| 2579 | \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc | 2559 | \let\bffont=\chapbf \let\ttfont=\chaptt \let\smallcaps=\chapsc |
| 2580 | \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy | 2560 | \let\sffont=\chapsf \let\ifont=\chapi \let\syfont=\chapsy |
| 2581 | \let\tenttsl=\chapttsl | 2561 | \let\ttfontsl=\chapttsl |
| 2582 | \def\curfontsize{chap}% | 2562 | \def\curfontsize{chap}% |
| 2583 | \def\lsize{sec}\def\lllsize{text}% | 2563 | \def\lsize{sec}\def\lllsize{text}% |
| 2584 | \resetmathfonts \setleading{19pt}} | 2564 | \resetmathfonts \setleading{19pt}} |
| 2585 | \def\secfonts{% | 2565 | \def\secfonts{% |
| 2586 | \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl | 2566 | \let\rmfont=\secrm \let\itfont=\secit \let\slfont=\secsl |
| 2587 | \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc | 2567 | \let\bffont=\secbf \let\ttfont=\sectt \let\smallcaps=\secsc |
| 2588 | \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy | 2568 | \let\sffont=\secsf \let\ifont=\seci \let\syfont=\secsy |
| 2589 | \let\tenttsl=\secttsl | 2569 | \let\ttfontsl=\secttsl |
| 2590 | \def\curfontsize{sec}% | 2570 | \def\curfontsize{sec}% |
| 2591 | \def\lsize{subsec}\def\lllsize{reduced}% | 2571 | \def\lsize{subsec}\def\lllsize{reduced}% |
| 2592 | \resetmathfonts \setleading{17pt}} | 2572 | \resetmathfonts \setleading{17pt}} |
| 2593 | \def\subsecfonts{% | 2573 | \def\subsecfonts{% |
| 2594 | \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl | 2574 | \let\rmfont=\ssecrm \let\itfont=\ssecit \let\slfont=\ssecsl |
| 2595 | \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc | 2575 | \let\bffont=\ssecbf \let\ttfont=\ssectt \let\smallcaps=\ssecsc |
| 2596 | \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy | 2576 | \let\sffont=\ssecsf \let\ifont=\sseci \let\syfont=\ssecsy |
| 2597 | \let\tenttsl=\ssecttsl | 2577 | \let\ttfontsl=\ssecttsl |
| 2598 | \def\curfontsize{ssec}% | 2578 | \def\curfontsize{ssec}% |
| 2599 | \def\lsize{text}\def\lllsize{small}% | 2579 | \def\lsize{text}\def\lllsize{small}% |
| 2600 | \resetmathfonts \setleading{15pt}} | 2580 | \resetmathfonts \setleading{15pt}} |
| 2601 | \let\subsubsecfonts = \subsecfonts | 2581 | \let\subsubsecfonts = \subsecfonts |
| 2602 | \def\reducedfonts{% | 2582 | \def\reducedfonts{% |
| 2603 | \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl | 2583 | \let\rmfont=\reducedrm \let\itfont=\reducedit \let\slfont=\reducedsl |
| 2604 | \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc | 2584 | \let\bffont=\reducedbf \let\ttfont=\reducedtt \let\reducedcaps=\reducedsc |
| 2605 | \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy | 2585 | \let\sffont=\reducedsf \let\ifont=\reducedi \let\syfont=\reducedsy |
| 2606 | \let\tenttsl=\reducedttsl | 2586 | \let\ttfontsl=\reducedttsl |
| 2607 | \def\curfontsize{reduced}% | 2587 | \def\curfontsize{reduced}% |
| 2608 | \def\lsize{small}\def\lllsize{smaller}% | 2588 | \def\lsize{small}\def\lllsize{smaller}% |
| 2609 | \resetmathfonts \setleading{10.5pt}} | 2589 | \resetmathfonts \setleading{10.5pt}} |
| 2610 | \def\smallfonts{% | 2590 | \def\smallfonts{% |
| 2611 | \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl | 2591 | \let\rmfont=\smallrm \let\itfont=\smallit \let\slfont=\smallsl |
| 2612 | \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc | 2592 | \let\bffont=\smallbf \let\ttfont=\smalltt \let\smallcaps=\smallsc |
| 2613 | \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy | 2593 | \let\sffont=\smallsf \let\ifont=\smalli \let\syfont=\smallsy |
| 2614 | \let\tenttsl=\smallttsl | 2594 | \let\ttfontsl=\smallttsl |
| 2615 | \def\curfontsize{small}% | 2595 | \def\curfontsize{small}% |
| 2616 | \def\lsize{smaller}\def\lllsize{smaller}% | 2596 | \def\lsize{smaller}\def\lllsize{smaller}% |
| 2617 | \resetmathfonts \setleading{10.5pt}} | 2597 | \resetmathfonts \setleading{10.5pt}} |
| 2618 | \def\smallerfonts{% | 2598 | \def\smallerfonts{% |
| 2619 | \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl | 2599 | \let\rmfont=\smallerrm \let\itfont=\smallerit \let\slfont=\smallersl |
| 2620 | \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc | 2600 | \let\bffont=\smallerbf \let\ttfont=\smallertt \let\smallcaps=\smallersc |
| 2621 | \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy | 2601 | \let\sffont=\smallersf \let\ifont=\smalleri \let\syfont=\smallersy |
| 2622 | \let\tenttsl=\smallerttsl | 2602 | \let\ttfontsl=\smallerttsl |
| 2623 | \def\curfontsize{smaller}% | 2603 | \def\curfontsize{smaller}% |
| 2624 | \def\lsize{smaller}\def\lllsize{smaller}% | 2604 | \def\lsize{smaller}\def\lllsize{smaller}% |
| 2625 | \resetmathfonts \setleading{9.5pt}} | 2605 | \resetmathfonts \setleading{9.5pt}} |
| 2626 | 2606 | ||
| 2627 | % Fonts for short table of contents. | ||
| 2628 | \setfont\shortcontrm\rmshape{12}{1000}{OT1} | ||
| 2629 | \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 | ||
| 2630 | \setfont\shortcontsl\slshape{12}{1000}{OT1} | ||
| 2631 | \setfont\shortconttt\ttshape{12}{1000}{OT1TT} | ||
| 2632 | |||
| 2633 | % Define these just so they can be easily changed for other fonts. | 2607 | % Define these just so they can be easily changed for other fonts. |
| 2634 | \def\angleleft{$\langle$} | 2608 | \def\angleleft{$\langle$} |
| 2635 | \def\angleright{$\rangle$} | 2609 | \def\angleright{$\rangle$} |
| @@ -3535,7 +3509,7 @@ end | |||
| 3535 | % | 3509 | % |
| 3536 | \newbox\errorbox | 3510 | \newbox\errorbox |
| 3537 | % | 3511 | % |
| 3538 | {\tentt \global\dimen0 = 3em}% Width of the box. | 3512 | {\ttfont \global\dimen0 = 3em}% Width of the box. |
| 3539 | \dimen2 = .55pt % Thickness of rules | 3513 | \dimen2 = .55pt % Thickness of rules |
| 3540 | % The text. (`r' is open on the right, `e' somewhat less so on the left.) | 3514 | % The text. (`r' is open on the right, `e' somewhat less so on the left.) |
| 3541 | \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} | 3515 | \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} |
| @@ -3794,7 +3768,7 @@ end | |||
| 3794 | 3768 | ||
| 3795 | % Macros to be used within @titlepage: | 3769 | % Macros to be used within @titlepage: |
| 3796 | 3770 | ||
| 3797 | \let\subtitlerm=\tenrm | 3771 | \let\subtitlerm=\rmfont |
| 3798 | \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} | 3772 | \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} |
| 3799 | 3773 | ||
| 3800 | \parseargdef\title{% | 3774 | \parseargdef\title{% |
| @@ -7946,7 +7920,7 @@ end | |||
| 7946 | \fi % no return type | 7920 | \fi % no return type |
| 7947 | #3% output function name | 7921 | #3% output function name |
| 7948 | }% | 7922 | }% |
| 7949 | {\rm\enskip}% hskip 0.5 em of \tenrm | 7923 | {\rm\enskip}% hskip 0.5 em of \rmfont |
| 7950 | % | 7924 | % |
| 7951 | \boldbrax | 7925 | \boldbrax |
| 7952 | % arguments will be output next, if any. | 7926 | % arguments will be output next, if any. |
| @@ -11717,7 +11691,4 @@ directory should work if nowhere else does.} | |||
| 11717 | 11691 | ||
| 11718 | @c vim:sw=2: | 11692 | @c vim:sw=2: |
| 11719 | 11693 | ||
| 11720 | @ignore | ||
| 11721 | arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 | ||
| 11722 | @end ignore | ||
| 11723 | @enablebackslashhack | 11694 | @enablebackslashhack |
diff --git a/lib/ftoastr.h b/lib/ftoastr.h index 9207809e9fb..94816d1a56b 100644 --- a/lib/ftoastr.h +++ b/lib/ftoastr.h | |||
| @@ -88,7 +88,7 @@ enum | |||
| 88 | # elif FLT_RADIX <= 16 /* IBM hex floating point has FLT_RADIX == 16. */ | 88 | # elif FLT_RADIX <= 16 /* IBM hex floating point has FLT_RADIX == 16. */ |
| 89 | # define _GL_FLOAT_DIG_BITS_BOUND 4 | 89 | # define _GL_FLOAT_DIG_BITS_BOUND 4 |
| 90 | # else /* no machine is this bad, but let's be complete */ | 90 | # else /* no machine is this bad, but let's be complete */ |
| 91 | # define _GL_FLOAT_DIG_BITS_BOUND (CHAR_BIT * (int) sizeof (int) - 1) | 91 | # define _GL_FLOAT_DIG_BITS_BOUND ((int) TYPE_WIDTH (int) - 1) |
| 92 | # endif | 92 | # endif |
| 93 | 93 | ||
| 94 | /* An upper bound on the number of decimal digits needed to represent | 94 | /* An upper bound on the number of decimal digits needed to represent |
diff --git a/lib/gnulib.mk b/lib/gnulib.mk index c431de6811c..e11e0cafdae 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk | |||
| @@ -643,6 +643,34 @@ EXTRA_DIST += inttypes.in.h | |||
| 643 | 643 | ||
| 644 | ## end gnulib module inttypes-incomplete | 644 | ## end gnulib module inttypes-incomplete |
| 645 | 645 | ||
| 646 | ## begin gnulib module limits-h | ||
| 647 | |||
| 648 | BUILT_SOURCES += $(LIMITS_H) | ||
| 649 | |||
| 650 | # We need the following in order to create <limits.h> when the system | ||
| 651 | # doesn't have one that is compatible with GNU. | ||
| 652 | if GL_GENERATE_LIMITS_H | ||
| 653 | limits.h: limits.in.h $(top_builddir)/config.status | ||
| 654 | $(AM_V_GEN)rm -f $@-t $@ && \ | ||
| 655 | { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ | ||
| 656 | sed -e 's|@''GUARD_PREFIX''@|GL|g' \ | ||
| 657 | -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ | ||
| 658 | -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ | ||
| 659 | -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ | ||
| 660 | -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \ | ||
| 661 | < $(srcdir)/limits.in.h; \ | ||
| 662 | } > $@-t && \ | ||
| 663 | mv $@-t $@ | ||
| 664 | else | ||
| 665 | limits.h: $(top_builddir)/config.status | ||
| 666 | rm -f $@ | ||
| 667 | endif | ||
| 668 | MOSTLYCLEANFILES += limits.h limits.h-t | ||
| 669 | |||
| 670 | EXTRA_DIST += limits.in.h | ||
| 671 | |||
| 672 | ## end gnulib module limits-h | ||
| 673 | |||
| 646 | ## begin gnulib module lstat | 674 | ## begin gnulib module lstat |
| 647 | 675 | ||
| 648 | 676 | ||
| @@ -1006,6 +1034,7 @@ stdint.h: stdint.in.h $(top_builddir)/config.status | |||
| 1006 | -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ | 1034 | -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ |
| 1007 | -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ | 1035 | -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ |
| 1008 | -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ | 1036 | -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ |
| 1037 | -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \ | ||
| 1009 | -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ | 1038 | -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ |
| 1010 | -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ | 1039 | -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ |
| 1011 | -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ | 1040 | -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ |
diff --git a/lib/intprops.h b/lib/intprops.h index 7e832bcdf1b..f0571056a9c 100644 --- a/lib/intprops.h +++ b/lib/intprops.h | |||
| @@ -51,12 +51,16 @@ | |||
| 51 | 51 | ||
| 52 | /* Minimum and maximum values for integer types and expressions. */ | 52 | /* Minimum and maximum values for integer types and expressions. */ |
| 53 | 53 | ||
| 54 | /* The width in bits of the integer type or expression T. | ||
| 55 | Padding bits are not supported; this is checked at compile-time below. */ | ||
| 56 | #define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) | ||
| 57 | |||
| 54 | /* The maximum and minimum values for the integer type T. */ | 58 | /* The maximum and minimum values for the integer type T. */ |
| 55 | #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t)) | 59 | #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t)) |
| 56 | #define TYPE_MAXIMUM(t) \ | 60 | #define TYPE_MAXIMUM(t) \ |
| 57 | ((t) (! TYPE_SIGNED (t) \ | 61 | ((t) (! TYPE_SIGNED (t) \ |
| 58 | ? (t) -1 \ | 62 | ? (t) -1 \ |
| 59 | : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) | 63 | : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1))) |
| 60 | 64 | ||
| 61 | /* The maximum and minimum values for the type of the expression E, | 65 | /* The maximum and minimum values for the type of the expression E, |
| 62 | after integer promotion. E should not have side effects. */ | 66 | after integer promotion. E should not have side effects. */ |
| @@ -69,7 +73,7 @@ | |||
| 69 | ? _GL_SIGNED_INT_MAXIMUM (e) \ | 73 | ? _GL_SIGNED_INT_MAXIMUM (e) \ |
| 70 | : _GL_INT_NEGATE_CONVERT (e, 1)) | 74 | : _GL_INT_NEGATE_CONVERT (e, 1)) |
| 71 | #define _GL_SIGNED_INT_MAXIMUM(e) \ | 75 | #define _GL_SIGNED_INT_MAXIMUM(e) \ |
| 72 | (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1) | 76 | (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1) |
| 73 | 77 | ||
| 74 | /* Work around OpenVMS incompatibility with C99. */ | 78 | /* Work around OpenVMS incompatibility with C99. */ |
| 75 | #if !defined LLONG_MAX && defined __INT64_MAX | 79 | #if !defined LLONG_MAX && defined __INT64_MAX |
| @@ -94,6 +98,10 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX); | |||
| 94 | verify (TYPE_MINIMUM (long long int) == LLONG_MIN); | 98 | verify (TYPE_MINIMUM (long long int) == LLONG_MIN); |
| 95 | verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | 99 | verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); |
| 96 | #endif | 100 | #endif |
| 101 | /* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined. */ | ||
| 102 | #ifdef UINT_WIDTH | ||
| 103 | verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH); | ||
| 104 | #endif | ||
| 97 | 105 | ||
| 98 | /* Does the __typeof__ keyword work? This could be done by | 106 | /* Does the __typeof__ keyword work? This could be done by |
| 99 | 'configure', but for now it's easier to do it by hand. */ | 107 | '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 | signed, this macro may overestimate the true bound by one byte when | 134 | signed, this macro may overestimate the true bound by one byte when |
| 127 | applied to unsigned types of size 2, 4, 16, ... bytes. */ | 135 | applied to unsigned types of size 2, 4, 16, ... bytes. */ |
| 128 | #define INT_STRLEN_BOUND(t) \ | 136 | #define INT_STRLEN_BOUND(t) \ |
| 129 | (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT \ | 137 | (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \ |
| 130 | - _GL_SIGNED_TYPE_OR_EXPR (t)) \ | ||
| 131 | + _GL_SIGNED_TYPE_OR_EXPR (t)) | 138 | + _GL_SIGNED_TYPE_OR_EXPR (t)) |
| 132 | 139 | ||
| 133 | /* Bound on buffer size needed to represent an integer type or expression T, | 140 | /* Bound on buffer size needed to represent an integer type or expression T, |
diff --git a/lib/limits.in.h b/lib/limits.in.h new file mode 100644 index 00000000000..a1eae02ada8 --- /dev/null +++ b/lib/limits.in.h | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | /* A GNU-like <limits.h>. | ||
| 2 | |||
| 3 | Copyright 2016 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | This program is free software; you can redistribute it and/or | ||
| 6 | modify it under the terms of the GNU General Public License | ||
| 7 | as published by the Free Software Foundation; either version 3, or | ||
| 8 | (at your option) any later version. | ||
| 9 | |||
| 10 | This program is distributed in the hope that it will be useful, | ||
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | GNU General Public License for more details. | ||
| 14 | |||
| 15 | You should have received a copy of the GNU General Public License | ||
| 16 | along with this program; if not, see <http://www.gnu.org/licenses/>. */ | ||
| 17 | |||
| 18 | #ifndef _@GUARD_PREFIX@_LIMITS_H | ||
| 19 | |||
| 20 | #if __GNUC__ >= 3 | ||
| 21 | @PRAGMA_SYSTEM_HEADER@ | ||
| 22 | #endif | ||
| 23 | @PRAGMA_COLUMNS@ | ||
| 24 | |||
| 25 | /* The include_next requires a split double-inclusion guard. */ | ||
| 26 | #@INCLUDE_NEXT@ @NEXT_LIMITS_H@ | ||
| 27 | |||
| 28 | #ifndef _@GUARD_PREFIX@_LIMITS_H | ||
| 29 | #define _@GUARD_PREFIX@_LIMITS_H | ||
| 30 | |||
| 31 | /* The number of usable bits in an unsigned or signed integer type | ||
| 32 | with minimum value MIN and maximum value MAX, as an int expression | ||
| 33 | suitable in #if. Cover all known practical hosts. This | ||
| 34 | implementation exploits the fact that MAX is 1 less than a power of | ||
| 35 | 2, and merely counts the number of 1 bits in MAX; "COBn" means | ||
| 36 | "count the number of 1 bits in the low-order n bits"). */ | ||
| 37 | #define _GL_INTEGER_WIDTH(min, max) (((min) < 0) + _GL_COB128 (max)) | ||
| 38 | #define _GL_COB128(n) (_GL_COB64 ((n) >> 31 >> 31 >> 2) + _GL_COB64 (n)) | ||
| 39 | #define _GL_COB64(n) (_GL_COB32 ((n) >> 31 >> 1) + _GL_COB32 (n)) | ||
| 40 | #define _GL_COB32(n) (_GL_COB16 ((n) >> 16) + _GL_COB16 (n)) | ||
| 41 | #define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n)) | ||
| 42 | #define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n)) | ||
| 43 | #define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1)) | ||
| 44 | |||
| 45 | /* Macros specified by ISO/IEC TS 18661-1:2014. */ | ||
| 46 | |||
| 47 | #if (! defined ULLONG_WIDTH \ | ||
| 48 | && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__)) | ||
| 49 | # define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX) | ||
| 50 | # define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX) | ||
| 51 | # define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX) | ||
| 52 | # define SHRT_WIDTH _GL_INTEGER_WIDTH (SHRT_MIN, SHRT_MAX) | ||
| 53 | # define USHRT_WIDTH _GL_INTEGER_WIDTH (0, USHRT_MAX) | ||
| 54 | # define INT_WIDTH _GL_INTEGER_WIDTH (INT_MIN, INT_MAX) | ||
| 55 | # define UINT_WIDTH _GL_INTEGER_WIDTH (0, UINT_MAX) | ||
| 56 | # define LONG_WIDTH _GL_INTEGER_WIDTH (LONG_MIN, LONG_MAX) | ||
| 57 | # define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX) | ||
| 58 | # define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX) | ||
| 59 | # define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX) | ||
| 60 | #endif /* !ULLONG_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */ | ||
| 61 | |||
| 62 | #endif /* _@GUARD_PREFIX@_LIMITS_H */ | ||
| 63 | #endif /* _@GUARD_PREFIX@_LIMITS_H */ | ||
diff --git a/lib/stdint.in.h b/lib/stdint.in.h index cf65ec62e97..c86ab096289 100644 --- a/lib/stdint.in.h +++ b/lib/stdint.in.h | |||
| @@ -79,49 +79,51 @@ | |||
| 79 | #if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H | 79 | #if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H |
| 80 | #define _@GUARD_PREFIX@_STDINT_H | 80 | #define _@GUARD_PREFIX@_STDINT_H |
| 81 | 81 | ||
| 82 | /* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX, | ||
| 83 | LONG_MIN, LONG_MAX, ULONG_MAX, _GL_INTEGER_WIDTH. */ | ||
| 84 | #include <limits.h> | ||
| 85 | |||
| 86 | #if ! @HAVE_C99_STDINT_H@ | ||
| 87 | |||
| 82 | /* <sys/types.h> defines some of the stdint.h types as well, on glibc, | 88 | /* <sys/types.h> defines some of the stdint.h types as well, on glibc, |
| 83 | IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>). | 89 | IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>). |
| 84 | AIX 5.2 <sys/types.h> isn't needed and causes troubles. | 90 | AIX 5.2 <sys/types.h> isn't needed and causes troubles. |
| 85 | Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but | 91 | Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but |
| 86 | relies on the system <stdint.h> definitions, so include | 92 | relies on the system <stdint.h> definitions, so include |
| 87 | <sys/types.h> after @NEXT_STDINT_H@. */ | 93 | <sys/types.h> after @NEXT_STDINT_H@. */ |
| 88 | #if @HAVE_SYS_TYPES_H@ && ! defined _AIX | 94 | # if @HAVE_SYS_TYPES_H@ && ! defined _AIX |
| 89 | # include <sys/types.h> | 95 | # include <sys/types.h> |
| 90 | #endif | 96 | # endif |
| 91 | |||
| 92 | /* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX, | ||
| 93 | LONG_MIN, LONG_MAX, ULONG_MAX. */ | ||
| 94 | #include <limits.h> | ||
| 95 | 97 | ||
| 96 | #if @HAVE_INTTYPES_H@ | 98 | # if @HAVE_INTTYPES_H@ |
| 97 | /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines | 99 | /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines |
| 98 | int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. | 100 | int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. |
| 99 | <inttypes.h> also defines intptr_t and uintptr_t. */ | 101 | <inttypes.h> also defines intptr_t and uintptr_t. */ |
| 100 | # include <inttypes.h> | 102 | # include <inttypes.h> |
| 101 | #elif @HAVE_SYS_INTTYPES_H@ | 103 | # elif @HAVE_SYS_INTTYPES_H@ |
| 102 | /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and | 104 | /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and |
| 103 | the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ | 105 | the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ |
| 104 | # include <sys/inttypes.h> | 106 | # include <sys/inttypes.h> |
| 105 | #endif | 107 | # endif |
| 106 | 108 | ||
| 107 | #if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ | 109 | # if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ |
| 108 | /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines | 110 | /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines |
| 109 | int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is | 111 | int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is |
| 110 | included by <sys/types.h>. */ | 112 | included by <sys/types.h>. */ |
| 111 | # include <sys/bitypes.h> | 113 | # include <sys/bitypes.h> |
| 112 | #endif | 114 | # endif |
| 113 | 115 | ||
| 114 | #undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H | 116 | # undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H |
| 115 | 117 | ||
| 116 | /* Minimum and maximum values for an integer type under the usual assumption. | 118 | /* Minimum and maximum values for an integer type under the usual assumption. |
| 117 | Return an unspecified value if BITS == 0, adding a check to pacify | 119 | Return an unspecified value if BITS == 0, adding a check to pacify |
| 118 | picky compilers. */ | 120 | picky compilers. */ |
| 119 | 121 | ||
| 120 | #define _STDINT_MIN(signed, bits, zero) \ | 122 | # define _STDINT_MIN(signed, bits, zero) \ |
| 121 | ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero)) | 123 | ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero)) |
| 122 | 124 | ||
| 123 | #define _STDINT_MAX(signed, bits, zero) \ | 125 | # define _STDINT_MAX(signed, bits, zero) \ |
| 124 | (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) | 126 | (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) |
| 125 | 127 | ||
| 126 | #if !GNULIB_defined_stdint_types | 128 | #if !GNULIB_defined_stdint_types |
| 127 | 129 | ||
| @@ -130,26 +132,26 @@ | |||
| 130 | /* Here we assume a standard architecture where the hardware integer | 132 | /* Here we assume a standard architecture where the hardware integer |
| 131 | types have 8, 16, 32, optionally 64 bits. */ | 133 | types have 8, 16, 32, optionally 64 bits. */ |
| 132 | 134 | ||
| 133 | #undef int8_t | 135 | # undef int8_t |
| 134 | #undef uint8_t | 136 | # undef uint8_t |
| 135 | typedef signed char gl_int8_t; | 137 | typedef signed char gl_int8_t; |
| 136 | typedef unsigned char gl_uint8_t; | 138 | typedef unsigned char gl_uint8_t; |
| 137 | #define int8_t gl_int8_t | 139 | # define int8_t gl_int8_t |
| 138 | #define uint8_t gl_uint8_t | 140 | # define uint8_t gl_uint8_t |
| 139 | 141 | ||
| 140 | #undef int16_t | 142 | # undef int16_t |
| 141 | #undef uint16_t | 143 | # undef uint16_t |
| 142 | typedef short int gl_int16_t; | 144 | typedef short int gl_int16_t; |
| 143 | typedef unsigned short int gl_uint16_t; | 145 | typedef unsigned short int gl_uint16_t; |
| 144 | #define int16_t gl_int16_t | 146 | # define int16_t gl_int16_t |
| 145 | #define uint16_t gl_uint16_t | 147 | # define uint16_t gl_uint16_t |
| 146 | 148 | ||
| 147 | #undef int32_t | 149 | # undef int32_t |
| 148 | #undef uint32_t | 150 | # undef uint32_t |
| 149 | typedef int gl_int32_t; | 151 | typedef int gl_int32_t; |
| 150 | typedef unsigned int gl_uint32_t; | 152 | typedef unsigned int gl_uint32_t; |
| 151 | #define int32_t gl_int32_t | 153 | # define int32_t gl_int32_t |
| 152 | #define uint32_t gl_uint32_t | 154 | # define uint32_t gl_uint32_t |
| 153 | 155 | ||
| 154 | /* If the system defines INT64_MAX, assume int64_t works. That way, | 156 | /* If the system defines INT64_MAX, assume int64_t works. That way, |
| 155 | if the underlying platform defines int64_t to be a 64-bit long long | 157 | if the underlying platform defines int64_t to be a 64-bit long long |
| @@ -157,54 +159,54 @@ typedef unsigned int gl_uint32_t; | |||
| 157 | int, which would mess up C++ name mangling. We must use #ifdef | 159 | int, which would mess up C++ name mangling. We must use #ifdef |
| 158 | rather than #if, to avoid an error with HP-UX 10.20 cc. */ | 160 | rather than #if, to avoid an error with HP-UX 10.20 cc. */ |
| 159 | 161 | ||
| 160 | #ifdef INT64_MAX | 162 | # ifdef INT64_MAX |
| 161 | # define GL_INT64_T | 163 | # define GL_INT64_T |
| 162 | #else | 164 | # else |
| 163 | /* Do not undefine int64_t if gnulib is not being used with 64-bit | 165 | /* Do not undefine int64_t if gnulib is not being used with 64-bit |
| 164 | types, since otherwise it breaks platforms like Tandem/NSK. */ | 166 | types, since otherwise it breaks platforms like Tandem/NSK. */ |
| 165 | # if LONG_MAX >> 31 >> 31 == 1 | 167 | # if LONG_MAX >> 31 >> 31 == 1 |
| 166 | # undef int64_t | 168 | # undef int64_t |
| 167 | typedef long int gl_int64_t; | 169 | typedef long int gl_int64_t; |
| 168 | # define int64_t gl_int64_t | 170 | # define int64_t gl_int64_t |
| 169 | # define GL_INT64_T | 171 | # define GL_INT64_T |
| 170 | # elif defined _MSC_VER | 172 | # elif defined _MSC_VER |
| 171 | # undef int64_t | 173 | # undef int64_t |
| 172 | typedef __int64 gl_int64_t; | 174 | typedef __int64 gl_int64_t; |
| 173 | # define int64_t gl_int64_t | 175 | # define int64_t gl_int64_t |
| 174 | # define GL_INT64_T | 176 | # define GL_INT64_T |
| 175 | # elif @HAVE_LONG_LONG_INT@ | 177 | # elif @HAVE_LONG_LONG_INT@ |
| 176 | # undef int64_t | 178 | # undef int64_t |
| 177 | typedef long long int gl_int64_t; | 179 | typedef long long int gl_int64_t; |
| 178 | # define int64_t gl_int64_t | 180 | # define int64_t gl_int64_t |
| 179 | # define GL_INT64_T | 181 | # define GL_INT64_T |
| 182 | # endif | ||
| 180 | # endif | 183 | # endif |
| 181 | #endif | ||
| 182 | 184 | ||
| 183 | #ifdef UINT64_MAX | 185 | # ifdef UINT64_MAX |
| 184 | # define GL_UINT64_T | ||
| 185 | #else | ||
| 186 | # if ULONG_MAX >> 31 >> 31 >> 1 == 1 | ||
| 187 | # undef uint64_t | ||
| 188 | typedef unsigned long int gl_uint64_t; | ||
| 189 | # define uint64_t gl_uint64_t | ||
| 190 | # define GL_UINT64_T | 186 | # define GL_UINT64_T |
| 191 | # elif defined _MSC_VER | 187 | # else |
| 192 | # undef uint64_t | 188 | # if ULONG_MAX >> 31 >> 31 >> 1 == 1 |
| 189 | # undef uint64_t | ||
| 190 | typedef unsigned long int gl_uint64_t; | ||
| 191 | # define uint64_t gl_uint64_t | ||
| 192 | # define GL_UINT64_T | ||
| 193 | # elif defined _MSC_VER | ||
| 194 | # undef uint64_t | ||
| 193 | typedef unsigned __int64 gl_uint64_t; | 195 | typedef unsigned __int64 gl_uint64_t; |
| 194 | # define uint64_t gl_uint64_t | 196 | # define uint64_t gl_uint64_t |
| 195 | # define GL_UINT64_T | 197 | # define GL_UINT64_T |
| 196 | # elif @HAVE_UNSIGNED_LONG_LONG_INT@ | 198 | # elif @HAVE_UNSIGNED_LONG_LONG_INT@ |
| 197 | # undef uint64_t | 199 | # undef uint64_t |
| 198 | typedef unsigned long long int gl_uint64_t; | 200 | typedef unsigned long long int gl_uint64_t; |
| 199 | # define uint64_t gl_uint64_t | 201 | # define uint64_t gl_uint64_t |
| 200 | # define GL_UINT64_T | 202 | # define GL_UINT64_T |
| 203 | # endif | ||
| 201 | # endif | 204 | # endif |
| 202 | #endif | ||
| 203 | 205 | ||
| 204 | /* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */ | 206 | /* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */ |
| 205 | #define _UINT8_T | 207 | # define _UINT8_T |
| 206 | #define _UINT32_T | 208 | # define _UINT32_T |
| 207 | #define _UINT64_T | 209 | # define _UINT64_T |
| 208 | 210 | ||
| 209 | 211 | ||
| 210 | /* 7.18.1.2. Minimum-width integer types */ | 212 | /* 7.18.1.2. Minimum-width integer types */ |
| @@ -213,26 +215,26 @@ typedef unsigned long long int gl_uint64_t; | |||
| 213 | types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types | 215 | types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types |
| 214 | are the same as the corresponding N_t types. */ | 216 | are the same as the corresponding N_t types. */ |
| 215 | 217 | ||
| 216 | #undef int_least8_t | 218 | # undef int_least8_t |
| 217 | #undef uint_least8_t | 219 | # undef uint_least8_t |
| 218 | #undef int_least16_t | 220 | # undef int_least16_t |
| 219 | #undef uint_least16_t | 221 | # undef uint_least16_t |
| 220 | #undef int_least32_t | 222 | # undef int_least32_t |
| 221 | #undef uint_least32_t | 223 | # undef uint_least32_t |
| 222 | #undef int_least64_t | 224 | # undef int_least64_t |
| 223 | #undef uint_least64_t | 225 | # undef uint_least64_t |
| 224 | #define int_least8_t int8_t | 226 | # define int_least8_t int8_t |
| 225 | #define uint_least8_t uint8_t | 227 | # define uint_least8_t uint8_t |
| 226 | #define int_least16_t int16_t | 228 | # define int_least16_t int16_t |
| 227 | #define uint_least16_t uint16_t | 229 | # define uint_least16_t uint16_t |
| 228 | #define int_least32_t int32_t | 230 | # define int_least32_t int32_t |
| 229 | #define uint_least32_t uint32_t | 231 | # define uint_least32_t uint32_t |
| 230 | #ifdef GL_INT64_T | 232 | # ifdef GL_INT64_T |
| 231 | # define int_least64_t int64_t | 233 | # define int_least64_t int64_t |
| 232 | #endif | 234 | # endif |
| 233 | #ifdef GL_UINT64_T | 235 | # ifdef GL_UINT64_T |
| 234 | # define uint_least64_t uint64_t | 236 | # define uint_least64_t uint64_t |
| 235 | #endif | 237 | # endif |
| 236 | 238 | ||
| 237 | /* 7.18.1.3. Fastest minimum-width integer types */ | 239 | /* 7.18.1.3. Fastest minimum-width integer types */ |
| 238 | 240 | ||
| @@ -245,55 +247,55 @@ typedef unsigned long long int gl_uint64_t; | |||
| 245 | uses types consistent with glibc, as that lessens the chance of | 247 | uses types consistent with glibc, as that lessens the chance of |
| 246 | incompatibility with older GNU hosts. */ | 248 | incompatibility with older GNU hosts. */ |
| 247 | 249 | ||
| 248 | #undef int_fast8_t | 250 | # undef int_fast8_t |
| 249 | #undef uint_fast8_t | 251 | # undef uint_fast8_t |
| 250 | #undef int_fast16_t | 252 | # undef int_fast16_t |
| 251 | #undef uint_fast16_t | 253 | # undef uint_fast16_t |
| 252 | #undef int_fast32_t | 254 | # undef int_fast32_t |
| 253 | #undef uint_fast32_t | 255 | # undef uint_fast32_t |
| 254 | #undef int_fast64_t | 256 | # undef int_fast64_t |
| 255 | #undef uint_fast64_t | 257 | # undef uint_fast64_t |
| 256 | typedef signed char gl_int_fast8_t; | 258 | typedef signed char gl_int_fast8_t; |
| 257 | typedef unsigned char gl_uint_fast8_t; | 259 | typedef unsigned char gl_uint_fast8_t; |
| 258 | 260 | ||
| 259 | #ifdef __sun | 261 | # ifdef __sun |
| 260 | /* Define types compatible with SunOS 5.10, so that code compiled under | 262 | /* Define types compatible with SunOS 5.10, so that code compiled under |
| 261 | earlier SunOS versions works with code compiled under SunOS 5.10. */ | 263 | earlier SunOS versions works with code compiled under SunOS 5.10. */ |
| 262 | typedef int gl_int_fast32_t; | 264 | typedef int gl_int_fast32_t; |
| 263 | typedef unsigned int gl_uint_fast32_t; | 265 | typedef unsigned int gl_uint_fast32_t; |
| 264 | #else | 266 | # else |
| 265 | typedef long int gl_int_fast32_t; | 267 | typedef long int gl_int_fast32_t; |
| 266 | typedef unsigned long int gl_uint_fast32_t; | 268 | typedef unsigned long int gl_uint_fast32_t; |
| 267 | #endif | 269 | # endif |
| 268 | typedef gl_int_fast32_t gl_int_fast16_t; | 270 | typedef gl_int_fast32_t gl_int_fast16_t; |
| 269 | typedef gl_uint_fast32_t gl_uint_fast16_t; | 271 | typedef gl_uint_fast32_t gl_uint_fast16_t; |
| 270 | 272 | ||
| 271 | #define int_fast8_t gl_int_fast8_t | 273 | # define int_fast8_t gl_int_fast8_t |
| 272 | #define uint_fast8_t gl_uint_fast8_t | 274 | # define uint_fast8_t gl_uint_fast8_t |
| 273 | #define int_fast16_t gl_int_fast16_t | 275 | # define int_fast16_t gl_int_fast16_t |
| 274 | #define uint_fast16_t gl_uint_fast16_t | 276 | # define uint_fast16_t gl_uint_fast16_t |
| 275 | #define int_fast32_t gl_int_fast32_t | 277 | # define int_fast32_t gl_int_fast32_t |
| 276 | #define uint_fast32_t gl_uint_fast32_t | 278 | # define uint_fast32_t gl_uint_fast32_t |
| 277 | #ifdef GL_INT64_T | 279 | # ifdef GL_INT64_T |
| 278 | # define int_fast64_t int64_t | 280 | # define int_fast64_t int64_t |
| 279 | #endif | 281 | # endif |
| 280 | #ifdef GL_UINT64_T | 282 | # ifdef GL_UINT64_T |
| 281 | # define uint_fast64_t uint64_t | 283 | # define uint_fast64_t uint64_t |
| 282 | #endif | 284 | # endif |
| 283 | 285 | ||
| 284 | /* 7.18.1.4. Integer types capable of holding object pointers */ | 286 | /* 7.18.1.4. Integer types capable of holding object pointers */ |
| 285 | 287 | ||
| 286 | /* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own | 288 | /* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own |
| 287 | definitions of intptr_t and uintptr_t (which use int and unsigned) | 289 | definitions of intptr_t and uintptr_t (which use int and unsigned) |
| 288 | to avoid clashes with declarations of system functions like sbrk. */ | 290 | to avoid clashes with declarations of system functions like sbrk. */ |
| 289 | #ifndef _INTPTR_T_DECLARED | 291 | # ifndef _INTPTR_T_DECLARED |
| 290 | #undef intptr_t | 292 | # undef intptr_t |
| 291 | #undef uintptr_t | 293 | # undef uintptr_t |
| 292 | typedef long int gl_intptr_t; | 294 | typedef long int gl_intptr_t; |
| 293 | typedef unsigned long int gl_uintptr_t; | 295 | typedef unsigned long int gl_uintptr_t; |
| 294 | #define intptr_t gl_intptr_t | 296 | # define intptr_t gl_intptr_t |
| 295 | #define uintptr_t gl_uintptr_t | 297 | # define uintptr_t gl_uintptr_t |
| 296 | #endif | 298 | # endif |
| 297 | 299 | ||
| 298 | /* 7.18.1.5. Greatest-width integer types */ | 300 | /* 7.18.1.5. Greatest-width integer types */ |
| 299 | 301 | ||
| @@ -304,33 +306,33 @@ typedef unsigned long int gl_uintptr_t; | |||
| 304 | similarly for UINTMAX_MAX and uintmax_t. This avoids problems with | 306 | similarly for UINTMAX_MAX and uintmax_t. This avoids problems with |
| 305 | assuming one type where another is used by the system. */ | 307 | assuming one type where another is used by the system. */ |
| 306 | 308 | ||
| 307 | #ifndef INTMAX_MAX | 309 | # ifndef INTMAX_MAX |
| 308 | # undef INTMAX_C | 310 | # undef INTMAX_C |
| 309 | # undef intmax_t | 311 | # undef intmax_t |
| 310 | # if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 | 312 | # if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 |
| 311 | typedef long long int gl_intmax_t; | 313 | typedef long long int gl_intmax_t; |
| 312 | # define intmax_t gl_intmax_t | 314 | # define intmax_t gl_intmax_t |
| 313 | # elif defined GL_INT64_T | 315 | # elif defined GL_INT64_T |
| 314 | # define intmax_t int64_t | 316 | # define intmax_t int64_t |
| 315 | # else | 317 | # else |
| 316 | typedef long int gl_intmax_t; | 318 | typedef long int gl_intmax_t; |
| 317 | # define intmax_t gl_intmax_t | 319 | # define intmax_t gl_intmax_t |
| 320 | # endif | ||
| 318 | # endif | 321 | # endif |
| 319 | #endif | ||
| 320 | 322 | ||
| 321 | #ifndef UINTMAX_MAX | 323 | # ifndef UINTMAX_MAX |
| 322 | # undef UINTMAX_C | 324 | # undef UINTMAX_C |
| 323 | # undef uintmax_t | 325 | # undef uintmax_t |
| 324 | # if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 | 326 | # if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 |
| 325 | typedef unsigned long long int gl_uintmax_t; | 327 | typedef unsigned long long int gl_uintmax_t; |
| 326 | # define uintmax_t gl_uintmax_t | 328 | # define uintmax_t gl_uintmax_t |
| 327 | # elif defined GL_UINT64_T | 329 | # elif defined GL_UINT64_T |
| 328 | # define uintmax_t uint64_t | 330 | # define uintmax_t uint64_t |
| 329 | # else | 331 | # else |
| 330 | typedef unsigned long int gl_uintmax_t; | 332 | typedef unsigned long int gl_uintmax_t; |
| 331 | # define uintmax_t gl_uintmax_t | 333 | # define uintmax_t gl_uintmax_t |
| 334 | # endif | ||
| 332 | # endif | 335 | # endif |
| 333 | #endif | ||
| 334 | 336 | ||
| 335 | /* Verify that intmax_t and uintmax_t have the same size. Too much code | 337 | /* Verify that intmax_t and uintmax_t have the same size. Too much code |
| 336 | breaks if this is not the case. If this check fails, the reason is likely | 338 | breaks if this is not the case. If this check fails, the reason is likely |
| @@ -338,8 +340,8 @@ typedef unsigned long int gl_uintmax_t; | |||
| 338 | typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) | 340 | typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) |
| 339 | ? 1 : -1]; | 341 | ? 1 : -1]; |
| 340 | 342 | ||
| 341 | #define GNULIB_defined_stdint_types 1 | 343 | # define GNULIB_defined_stdint_types 1 |
| 342 | #endif /* !GNULIB_defined_stdint_types */ | 344 | # endif /* !GNULIB_defined_stdint_types */ |
| 343 | 345 | ||
| 344 | /* 7.18.2. Limits of specified-width integer types */ | 346 | /* 7.18.2. Limits of specified-width integer types */ |
| 345 | 347 | ||
| @@ -348,37 +350,37 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) | |||
| 348 | /* Here we assume a standard architecture where the hardware integer | 350 | /* Here we assume a standard architecture where the hardware integer |
| 349 | types have 8, 16, 32, optionally 64 bits. */ | 351 | types have 8, 16, 32, optionally 64 bits. */ |
| 350 | 352 | ||
| 351 | #undef INT8_MIN | 353 | # undef INT8_MIN |
| 352 | #undef INT8_MAX | 354 | # undef INT8_MAX |
| 353 | #undef UINT8_MAX | 355 | # undef UINT8_MAX |
| 354 | #define INT8_MIN (~ INT8_MAX) | 356 | # define INT8_MIN (~ INT8_MAX) |
| 355 | #define INT8_MAX 127 | 357 | # define INT8_MAX 127 |
| 356 | #define UINT8_MAX 255 | 358 | # define UINT8_MAX 255 |
| 357 | 359 | ||
| 358 | #undef INT16_MIN | 360 | # undef INT16_MIN |
| 359 | #undef INT16_MAX | 361 | # undef INT16_MAX |
| 360 | #undef UINT16_MAX | 362 | # undef UINT16_MAX |
| 361 | #define INT16_MIN (~ INT16_MAX) | 363 | # define INT16_MIN (~ INT16_MAX) |
| 362 | #define INT16_MAX 32767 | 364 | # define INT16_MAX 32767 |
| 363 | #define UINT16_MAX 65535 | 365 | # define UINT16_MAX 65535 |
| 364 | 366 | ||
| 365 | #undef INT32_MIN | 367 | # undef INT32_MIN |
| 366 | #undef INT32_MAX | 368 | # undef INT32_MAX |
| 367 | #undef UINT32_MAX | 369 | # undef UINT32_MAX |
| 368 | #define INT32_MIN (~ INT32_MAX) | 370 | # define INT32_MIN (~ INT32_MAX) |
| 369 | #define INT32_MAX 2147483647 | 371 | # define INT32_MAX 2147483647 |
| 370 | #define UINT32_MAX 4294967295U | 372 | # define UINT32_MAX 4294967295U |
| 371 | 373 | ||
| 372 | #if defined GL_INT64_T && ! defined INT64_MAX | 374 | # if defined GL_INT64_T && ! defined INT64_MAX |
| 373 | /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0 | 375 | /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0 |
| 374 | evaluates the latter incorrectly in preprocessor expressions. */ | 376 | evaluates the latter incorrectly in preprocessor expressions. */ |
| 375 | # define INT64_MIN (- INTMAX_C (1) << 63) | 377 | # define INT64_MIN (- INTMAX_C (1) << 63) |
| 376 | # define INT64_MAX INTMAX_C (9223372036854775807) | 378 | # define INT64_MAX INTMAX_C (9223372036854775807) |
| 377 | #endif | 379 | # endif |
| 378 | 380 | ||
| 379 | #if defined GL_UINT64_T && ! defined UINT64_MAX | 381 | # if defined GL_UINT64_T && ! defined UINT64_MAX |
| 380 | # define UINT64_MAX UINTMAX_C (18446744073709551615) | 382 | # define UINT64_MAX UINTMAX_C (18446744073709551615) |
| 381 | #endif | 383 | # endif |
| 382 | 384 | ||
| 383 | /* 7.18.2.2. Limits of minimum-width integer types */ | 385 | /* 7.18.2.2. Limits of minimum-width integer types */ |
| 384 | 386 | ||
| @@ -386,38 +388,38 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) | |||
| 386 | types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types | 388 | types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types |
| 387 | are the same as the corresponding N_t types. */ | 389 | are the same as the corresponding N_t types. */ |
| 388 | 390 | ||
| 389 | #undef INT_LEAST8_MIN | 391 | # undef INT_LEAST8_MIN |
| 390 | #undef INT_LEAST8_MAX | 392 | # undef INT_LEAST8_MAX |
| 391 | #undef UINT_LEAST8_MAX | 393 | # undef UINT_LEAST8_MAX |
| 392 | #define INT_LEAST8_MIN INT8_MIN | 394 | # define INT_LEAST8_MIN INT8_MIN |
| 393 | #define INT_LEAST8_MAX INT8_MAX | 395 | # define INT_LEAST8_MAX INT8_MAX |
| 394 | #define UINT_LEAST8_MAX UINT8_MAX | 396 | # define UINT_LEAST8_MAX UINT8_MAX |
| 395 | 397 | ||
| 396 | #undef INT_LEAST16_MIN | 398 | # undef INT_LEAST16_MIN |
| 397 | #undef INT_LEAST16_MAX | 399 | # undef INT_LEAST16_MAX |
| 398 | #undef UINT_LEAST16_MAX | 400 | # undef UINT_LEAST16_MAX |
| 399 | #define INT_LEAST16_MIN INT16_MIN | 401 | # define INT_LEAST16_MIN INT16_MIN |
| 400 | #define INT_LEAST16_MAX INT16_MAX | 402 | # define INT_LEAST16_MAX INT16_MAX |
| 401 | #define UINT_LEAST16_MAX UINT16_MAX | 403 | # define UINT_LEAST16_MAX UINT16_MAX |
| 402 | 404 | ||
| 403 | #undef INT_LEAST32_MIN | 405 | # undef INT_LEAST32_MIN |
| 404 | #undef INT_LEAST32_MAX | 406 | # undef INT_LEAST32_MAX |
| 405 | #undef UINT_LEAST32_MAX | 407 | # undef UINT_LEAST32_MAX |
| 406 | #define INT_LEAST32_MIN INT32_MIN | 408 | # define INT_LEAST32_MIN INT32_MIN |
| 407 | #define INT_LEAST32_MAX INT32_MAX | 409 | # define INT_LEAST32_MAX INT32_MAX |
| 408 | #define UINT_LEAST32_MAX UINT32_MAX | 410 | # define UINT_LEAST32_MAX UINT32_MAX |
| 409 | 411 | ||
| 410 | #undef INT_LEAST64_MIN | 412 | # undef INT_LEAST64_MIN |
| 411 | #undef INT_LEAST64_MAX | 413 | # undef INT_LEAST64_MAX |
| 412 | #ifdef GL_INT64_T | 414 | # ifdef GL_INT64_T |
| 413 | # define INT_LEAST64_MIN INT64_MIN | 415 | # define INT_LEAST64_MIN INT64_MIN |
| 414 | # define INT_LEAST64_MAX INT64_MAX | 416 | # define INT_LEAST64_MAX INT64_MAX |
| 415 | #endif | 417 | # endif |
| 416 | 418 | ||
| 417 | #undef UINT_LEAST64_MAX | 419 | # undef UINT_LEAST64_MAX |
| 418 | #ifdef GL_UINT64_T | 420 | # ifdef GL_UINT64_T |
| 419 | # define UINT_LEAST64_MAX UINT64_MAX | 421 | # define UINT_LEAST64_MAX UINT64_MAX |
| 420 | #endif | 422 | # endif |
| 421 | 423 | ||
| 422 | /* 7.18.2.3. Limits of fastest minimum-width integer types */ | 424 | /* 7.18.2.3. Limits of fastest minimum-width integer types */ |
| 423 | 425 | ||
| @@ -425,117 +427,117 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) | |||
| 425 | types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types | 427 | types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types |
| 426 | are taken from the same list of types. */ | 428 | are taken from the same list of types. */ |
| 427 | 429 | ||
| 428 | #undef INT_FAST8_MIN | 430 | # undef INT_FAST8_MIN |
| 429 | #undef INT_FAST8_MAX | 431 | # undef INT_FAST8_MAX |
| 430 | #undef UINT_FAST8_MAX | 432 | # undef UINT_FAST8_MAX |
| 431 | #define INT_FAST8_MIN SCHAR_MIN | 433 | # define INT_FAST8_MIN SCHAR_MIN |
| 432 | #define INT_FAST8_MAX SCHAR_MAX | 434 | # define INT_FAST8_MAX SCHAR_MAX |
| 433 | #define UINT_FAST8_MAX UCHAR_MAX | 435 | # define UINT_FAST8_MAX UCHAR_MAX |
| 434 | 436 | ||
| 435 | #undef INT_FAST16_MIN | 437 | # undef INT_FAST16_MIN |
| 436 | #undef INT_FAST16_MAX | 438 | # undef INT_FAST16_MAX |
| 437 | #undef UINT_FAST16_MAX | 439 | # undef UINT_FAST16_MAX |
| 438 | #define INT_FAST16_MIN INT_FAST32_MIN | 440 | # define INT_FAST16_MIN INT_FAST32_MIN |
| 439 | #define INT_FAST16_MAX INT_FAST32_MAX | 441 | # define INT_FAST16_MAX INT_FAST32_MAX |
| 440 | #define UINT_FAST16_MAX UINT_FAST32_MAX | 442 | # define UINT_FAST16_MAX UINT_FAST32_MAX |
| 441 | 443 | ||
| 442 | #undef INT_FAST32_MIN | 444 | # undef INT_FAST32_MIN |
| 443 | #undef INT_FAST32_MAX | 445 | # undef INT_FAST32_MAX |
| 444 | #undef UINT_FAST32_MAX | 446 | # undef UINT_FAST32_MAX |
| 445 | #ifdef __sun | 447 | # ifdef __sun |
| 446 | # define INT_FAST32_MIN INT_MIN | 448 | # define INT_FAST32_MIN INT_MIN |
| 447 | # define INT_FAST32_MAX INT_MAX | 449 | # define INT_FAST32_MAX INT_MAX |
| 448 | # define UINT_FAST32_MAX UINT_MAX | 450 | # define UINT_FAST32_MAX UINT_MAX |
| 449 | #else | 451 | # else |
| 450 | # define INT_FAST32_MIN LONG_MIN | 452 | # define INT_FAST32_MIN LONG_MIN |
| 451 | # define INT_FAST32_MAX LONG_MAX | 453 | # define INT_FAST32_MAX LONG_MAX |
| 452 | # define UINT_FAST32_MAX ULONG_MAX | 454 | # define UINT_FAST32_MAX ULONG_MAX |
| 453 | #endif | 455 | # endif |
| 454 | 456 | ||
| 455 | #undef INT_FAST64_MIN | 457 | # undef INT_FAST64_MIN |
| 456 | #undef INT_FAST64_MAX | 458 | # undef INT_FAST64_MAX |
| 457 | #ifdef GL_INT64_T | 459 | # ifdef GL_INT64_T |
| 458 | # define INT_FAST64_MIN INT64_MIN | 460 | # define INT_FAST64_MIN INT64_MIN |
| 459 | # define INT_FAST64_MAX INT64_MAX | 461 | # define INT_FAST64_MAX INT64_MAX |
| 460 | #endif | 462 | # endif |
| 461 | 463 | ||
| 462 | #undef UINT_FAST64_MAX | 464 | # undef UINT_FAST64_MAX |
| 463 | #ifdef GL_UINT64_T | 465 | # ifdef GL_UINT64_T |
| 464 | # define UINT_FAST64_MAX UINT64_MAX | 466 | # define UINT_FAST64_MAX UINT64_MAX |
| 465 | #endif | 467 | # endif |
| 466 | 468 | ||
| 467 | /* 7.18.2.4. Limits of integer types capable of holding object pointers */ | 469 | /* 7.18.2.4. Limits of integer types capable of holding object pointers */ |
| 468 | 470 | ||
| 469 | #undef INTPTR_MIN | 471 | # undef INTPTR_MIN |
| 470 | #undef INTPTR_MAX | 472 | # undef INTPTR_MAX |
| 471 | #undef UINTPTR_MAX | 473 | # undef UINTPTR_MAX |
| 472 | #define INTPTR_MIN LONG_MIN | 474 | # define INTPTR_MIN LONG_MIN |
| 473 | #define INTPTR_MAX LONG_MAX | 475 | # define INTPTR_MAX LONG_MAX |
| 474 | #define UINTPTR_MAX ULONG_MAX | 476 | # define UINTPTR_MAX ULONG_MAX |
| 475 | 477 | ||
| 476 | /* 7.18.2.5. Limits of greatest-width integer types */ | 478 | /* 7.18.2.5. Limits of greatest-width integer types */ |
| 477 | 479 | ||
| 478 | #ifndef INTMAX_MAX | 480 | # ifndef INTMAX_MAX |
| 479 | # undef INTMAX_MIN | 481 | # undef INTMAX_MIN |
| 480 | # ifdef INT64_MAX | 482 | # ifdef INT64_MAX |
| 481 | # define INTMAX_MIN INT64_MIN | 483 | # define INTMAX_MIN INT64_MIN |
| 482 | # define INTMAX_MAX INT64_MAX | 484 | # define INTMAX_MAX INT64_MAX |
| 483 | # else | 485 | # else |
| 484 | # define INTMAX_MIN INT32_MIN | 486 | # define INTMAX_MIN INT32_MIN |
| 485 | # define INTMAX_MAX INT32_MAX | 487 | # define INTMAX_MAX INT32_MAX |
| 488 | # endif | ||
| 486 | # endif | 489 | # endif |
| 487 | #endif | ||
| 488 | 490 | ||
| 489 | #ifndef UINTMAX_MAX | 491 | # ifndef UINTMAX_MAX |
| 490 | # ifdef UINT64_MAX | 492 | # ifdef UINT64_MAX |
| 491 | # define UINTMAX_MAX UINT64_MAX | 493 | # define UINTMAX_MAX UINT64_MAX |
| 492 | # else | 494 | # else |
| 493 | # define UINTMAX_MAX UINT32_MAX | 495 | # define UINTMAX_MAX UINT32_MAX |
| 496 | # endif | ||
| 494 | # endif | 497 | # endif |
| 495 | #endif | ||
| 496 | 498 | ||
| 497 | /* 7.18.3. Limits of other integer types */ | 499 | /* 7.18.3. Limits of other integer types */ |
| 498 | 500 | ||
| 499 | /* ptrdiff_t limits */ | 501 | /* ptrdiff_t limits */ |
| 500 | #undef PTRDIFF_MIN | 502 | # undef PTRDIFF_MIN |
| 501 | #undef PTRDIFF_MAX | 503 | # undef PTRDIFF_MAX |
| 502 | #if @APPLE_UNIVERSAL_BUILD@ | 504 | # if @APPLE_UNIVERSAL_BUILD@ |
| 503 | # ifdef _LP64 | 505 | # ifdef _LP64 |
| 504 | # define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l) | 506 | # define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l) |
| 505 | # define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) | 507 | # define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) |
| 508 | # else | ||
| 509 | # define PTRDIFF_MIN _STDINT_MIN (1, 32, 0) | ||
| 510 | # define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) | ||
| 511 | # endif | ||
| 506 | # else | 512 | # else |
| 507 | # define PTRDIFF_MIN _STDINT_MIN (1, 32, 0) | 513 | # define PTRDIFF_MIN \ |
| 508 | # define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) | ||
| 509 | # endif | ||
| 510 | #else | ||
| 511 | # define PTRDIFF_MIN \ | ||
| 512 | _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) | 514 | _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) |
| 513 | # define PTRDIFF_MAX \ | 515 | # define PTRDIFF_MAX \ |
| 514 | _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) | 516 | _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) |
| 515 | #endif | 517 | # endif |
| 516 | 518 | ||
| 517 | /* sig_atomic_t limits */ | 519 | /* sig_atomic_t limits */ |
| 518 | #undef SIG_ATOMIC_MIN | 520 | # undef SIG_ATOMIC_MIN |
| 519 | #undef SIG_ATOMIC_MAX | 521 | # undef SIG_ATOMIC_MAX |
| 520 | #define SIG_ATOMIC_MIN \ | 522 | # define SIG_ATOMIC_MIN \ |
| 521 | _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ | 523 | _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ |
| 522 | 0@SIG_ATOMIC_T_SUFFIX@) | 524 | 0@SIG_ATOMIC_T_SUFFIX@) |
| 523 | #define SIG_ATOMIC_MAX \ | 525 | # define SIG_ATOMIC_MAX \ |
| 524 | _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ | 526 | _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ |
| 525 | 0@SIG_ATOMIC_T_SUFFIX@) | 527 | 0@SIG_ATOMIC_T_SUFFIX@) |
| 526 | 528 | ||
| 527 | 529 | ||
| 528 | /* size_t limit */ | 530 | /* size_t limit */ |
| 529 | #undef SIZE_MAX | 531 | # undef SIZE_MAX |
| 530 | #if @APPLE_UNIVERSAL_BUILD@ | 532 | # if @APPLE_UNIVERSAL_BUILD@ |
| 531 | # ifdef _LP64 | 533 | # ifdef _LP64 |
| 532 | # define SIZE_MAX _STDINT_MAX (0, 64, 0ul) | 534 | # define SIZE_MAX _STDINT_MAX (0, 64, 0ul) |
| 535 | # else | ||
| 536 | # define SIZE_MAX _STDINT_MAX (0, 32, 0ul) | ||
| 537 | # endif | ||
| 533 | # else | 538 | # else |
| 534 | # define SIZE_MAX _STDINT_MAX (0, 32, 0ul) | 539 | # define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) |
| 535 | # endif | 540 | # endif |
| 536 | #else | ||
| 537 | # define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) | ||
| 538 | #endif | ||
| 539 | 541 | ||
| 540 | /* wchar_t limits */ | 542 | /* wchar_t limits */ |
| 541 | /* Get WCHAR_MIN, WCHAR_MAX. | 543 | /* Get WCHAR_MIN, WCHAR_MAX. |
| @@ -543,29 +545,29 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) | |||
| 543 | sequence of nested includes | 545 | sequence of nested includes |
| 544 | <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes | 546 | <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes |
| 545 | <stdint.h> and assumes its types are already defined. */ | 547 | <stdint.h> and assumes its types are already defined. */ |
| 546 | #if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) | 548 | # if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) |
| 547 | /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be | 549 | /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be |
| 548 | included before <wchar.h>. */ | 550 | included before <wchar.h>. */ |
| 549 | # include <stddef.h> | 551 | # include <stddef.h> |
| 550 | # include <stdio.h> | 552 | # include <stdio.h> |
| 551 | # include <time.h> | 553 | # include <time.h> |
| 552 | # define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H | 554 | # define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H |
| 553 | # include <wchar.h> | 555 | # include <wchar.h> |
| 554 | # undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H | 556 | # undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H |
| 555 | #endif | 557 | # endif |
| 556 | #undef WCHAR_MIN | 558 | # undef WCHAR_MIN |
| 557 | #undef WCHAR_MAX | 559 | # undef WCHAR_MAX |
| 558 | #define WCHAR_MIN \ | 560 | # define WCHAR_MIN \ |
| 559 | _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) | 561 | _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) |
| 560 | #define WCHAR_MAX \ | 562 | # define WCHAR_MAX \ |
| 561 | _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) | 563 | _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) |
| 562 | 564 | ||
| 563 | /* wint_t limits */ | 565 | /* wint_t limits */ |
| 564 | #undef WINT_MIN | 566 | # undef WINT_MIN |
| 565 | #undef WINT_MAX | 567 | # undef WINT_MAX |
| 566 | #define WINT_MIN \ | 568 | # define WINT_MIN \ |
| 567 | _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) | 569 | _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) |
| 568 | #define WINT_MAX \ | 570 | # define WINT_MAX \ |
| 569 | _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) | 571 | _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) |
| 570 | 572 | ||
| 571 | /* 7.18.4. Macros for integer constants */ | 573 | /* 7.18.4. Macros for integer constants */ |
| @@ -576,59 +578,120 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) | |||
| 576 | /* Here we assume a standard architecture where the hardware integer | 578 | /* Here we assume a standard architecture where the hardware integer |
| 577 | types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */ | 579 | types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */ |
| 578 | 580 | ||
| 579 | #undef INT8_C | 581 | # undef INT8_C |
| 580 | #undef UINT8_C | 582 | # undef UINT8_C |
| 581 | #define INT8_C(x) x | 583 | # define INT8_C(x) x |
| 582 | #define UINT8_C(x) x | 584 | # define UINT8_C(x) x |
| 583 | 585 | ||
| 584 | #undef INT16_C | 586 | # undef INT16_C |
| 585 | #undef UINT16_C | 587 | # undef UINT16_C |
| 586 | #define INT16_C(x) x | 588 | # define INT16_C(x) x |
| 587 | #define UINT16_C(x) x | 589 | # define UINT16_C(x) x |
| 588 | 590 | ||
| 589 | #undef INT32_C | 591 | # undef INT32_C |
| 590 | #undef UINT32_C | 592 | # undef UINT32_C |
| 591 | #define INT32_C(x) x | 593 | # define INT32_C(x) x |
| 592 | #define UINT32_C(x) x ## U | 594 | # define UINT32_C(x) x ## U |
| 593 | 595 | ||
| 594 | #undef INT64_C | 596 | # undef INT64_C |
| 595 | #undef UINT64_C | 597 | # undef UINT64_C |
| 596 | #if LONG_MAX >> 31 >> 31 == 1 | 598 | # if LONG_MAX >> 31 >> 31 == 1 |
| 597 | # define INT64_C(x) x##L | 599 | # define INT64_C(x) x##L |
| 598 | #elif defined _MSC_VER | 600 | # elif defined _MSC_VER |
| 599 | # define INT64_C(x) x##i64 | 601 | # define INT64_C(x) x##i64 |
| 600 | #elif @HAVE_LONG_LONG_INT@ | 602 | # elif @HAVE_LONG_LONG_INT@ |
| 601 | # define INT64_C(x) x##LL | 603 | # define INT64_C(x) x##LL |
| 602 | #endif | 604 | # endif |
| 603 | #if ULONG_MAX >> 31 >> 31 >> 1 == 1 | 605 | # if ULONG_MAX >> 31 >> 31 >> 1 == 1 |
| 604 | # define UINT64_C(x) x##UL | 606 | # define UINT64_C(x) x##UL |
| 605 | #elif defined _MSC_VER | 607 | # elif defined _MSC_VER |
| 606 | # define UINT64_C(x) x##ui64 | 608 | # define UINT64_C(x) x##ui64 |
| 607 | #elif @HAVE_UNSIGNED_LONG_LONG_INT@ | 609 | # elif @HAVE_UNSIGNED_LONG_LONG_INT@ |
| 608 | # define UINT64_C(x) x##ULL | 610 | # define UINT64_C(x) x##ULL |
| 609 | #endif | 611 | # endif |
| 610 | 612 | ||
| 611 | /* 7.18.4.2. Macros for greatest-width integer constants */ | 613 | /* 7.18.4.2. Macros for greatest-width integer constants */ |
| 612 | 614 | ||
| 613 | #ifndef INTMAX_C | 615 | # ifndef INTMAX_C |
| 614 | # if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 | 616 | # if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 |
| 615 | # define INTMAX_C(x) x##LL | 617 | # define INTMAX_C(x) x##LL |
| 616 | # elif defined GL_INT64_T | 618 | # elif defined GL_INT64_T |
| 617 | # define INTMAX_C(x) INT64_C(x) | 619 | # define INTMAX_C(x) INT64_C(x) |
| 618 | # else | 620 | # else |
| 619 | # define INTMAX_C(x) x##L | 621 | # define INTMAX_C(x) x##L |
| 622 | # endif | ||
| 620 | # endif | 623 | # endif |
| 621 | #endif | ||
| 622 | 624 | ||
| 623 | #ifndef UINTMAX_C | 625 | # ifndef UINTMAX_C |
| 624 | # if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 | 626 | # if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 |
| 625 | # define UINTMAX_C(x) x##ULL | 627 | # define UINTMAX_C(x) x##ULL |
| 626 | # elif defined GL_UINT64_T | 628 | # elif defined GL_UINT64_T |
| 627 | # define UINTMAX_C(x) UINT64_C(x) | 629 | # define UINTMAX_C(x) UINT64_C(x) |
| 628 | # else | 630 | # else |
| 629 | # define UINTMAX_C(x) x##UL | 631 | # define UINTMAX_C(x) x##UL |
| 632 | # endif | ||
| 630 | # endif | 633 | # endif |
| 631 | #endif | 634 | |
| 635 | #endif /* !@HAVE_C99_STDINT_H@ */ | ||
| 636 | |||
| 637 | /* Macros specified by ISO/IEC TS 18661-1:2014. */ | ||
| 638 | |||
| 639 | #if (!defined UINTMAX_WIDTH \ | ||
| 640 | && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__)) | ||
| 641 | # ifdef INT8_MAX | ||
| 642 | # define INT8_WIDTH _GL_INTEGER_WIDTH (INT8_MIN, INT8_MAX) | ||
| 643 | # endif | ||
| 644 | # ifdef UINT8_MAX | ||
| 645 | # define UINT8_WIDTH _GL_INTEGER_WIDTH (0, UINT8_MAX) | ||
| 646 | # endif | ||
| 647 | # ifdef INT16_MAX | ||
| 648 | # define INT16_WIDTH _GL_INTEGER_WIDTH (INT16_MIN, INT16_MAX) | ||
| 649 | # endif | ||
| 650 | # ifdef UINT16_MAX | ||
| 651 | # define UINT16_WIDTH _GL_INTEGER_WIDTH (0, UINT16_MAX) | ||
| 652 | # endif | ||
| 653 | # ifdef INT32_MAX | ||
| 654 | # define INT32_WIDTH _GL_INTEGER_WIDTH (INT32_MIN, INT32_MAX) | ||
| 655 | # endif | ||
| 656 | # ifdef UINT32_MAX | ||
| 657 | # define UINT32_WIDTH _GL_INTEGER_WIDTH (0, UINT32_MAX) | ||
| 658 | # endif | ||
| 659 | # ifdef INT64_MAX | ||
| 660 | # define INT64_WIDTH _GL_INTEGER_WIDTH (INT64_MIN, INT64_MAX) | ||
| 661 | # endif | ||
| 662 | # ifdef UINT64_MAX | ||
| 663 | # define UINT64_WIDTH _GL_INTEGER_WIDTH (0, UINT64_MAX) | ||
| 664 | # endif | ||
| 665 | # define INT_LEAST8_WIDTH _GL_INTEGER_WIDTH (INT_LEAST8_MIN, INT_LEAST8_MAX) | ||
| 666 | # define UINT_LEAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST8_MAX) | ||
| 667 | # define INT_LEAST16_WIDTH _GL_INTEGER_WIDTH (INT_LEAST16_MIN, INT_LEAST16_MAX) | ||
| 668 | # define UINT_LEAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST16_MAX) | ||
| 669 | # define INT_LEAST32_WIDTH _GL_INTEGER_WIDTH (INT_LEAST32_MIN, INT_LEAST32_MAX) | ||
| 670 | # define UINT_LEAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST32_MAX) | ||
| 671 | # define INT_LEAST64_WIDTH _GL_INTEGER_WIDTH (INT_LEAST64_MIN, INT_LEAST64_MAX) | ||
| 672 | # define UINT_LEAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST64_MAX) | ||
| 673 | # define INT_FAST8_WIDTH _GL_INTEGER_WIDTH (INT_FAST8_MIN, INT_FAST8_MAX) | ||
| 674 | # define UINT_FAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST8_MAX) | ||
| 675 | # define INT_FAST16_WIDTH _GL_INTEGER_WIDTH (INT_FAST16_MIN, INT_FAST16_MAX) | ||
| 676 | # define UINT_FAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST16_MAX) | ||
| 677 | # define INT_FAST32_WIDTH _GL_INTEGER_WIDTH (INT_FAST32_MIN, INT_FAST32_MAX) | ||
| 678 | # define UINT_FAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST32_MAX) | ||
| 679 | # define INT_FAST64_WIDTH _GL_INTEGER_WIDTH (INT_FAST64_MIN, INT_FAST64_MAX) | ||
| 680 | # define UINT_FAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST64_MAX) | ||
| 681 | # define INTPTR_WIDTH _GL_INTEGER_WIDTH (INTPTR_MIN, INTPTR_MAX) | ||
| 682 | # define UINTPTR_WIDTH _GL_INTEGER_WIDTH (0, UINTPTR_MAX) | ||
| 683 | # define INTMAX_WIDTH _GL_INTEGER_WIDTH (INTMAX_MIN, INTMAX_MAX) | ||
| 684 | # define UINTMAX_WIDTH _GL_INTEGER_WIDTH (0, UINTMAX_MAX) | ||
| 685 | # define PTRDIFF_WIDTH _GL_INTEGER_WIDTH (PTRDIFF_MIN, PTRDIFF_MAX) | ||
| 686 | # define SIZE_WIDTH _GL_INTEGER_WIDTH (0, SIZE_MAX) | ||
| 687 | # define WCHAR_WIDTH _GL_INTEGER_WIDTH (WCHAR_MIN, WCHAR_MAX) | ||
| 688 | # ifdef WINT_MAX | ||
| 689 | # define WINT_WIDTH _GL_INTEGER_WIDTH (WINT_MIN, WINT_MAX) | ||
| 690 | # endif | ||
| 691 | # ifdef SIG_ATOMIC_MAX | ||
| 692 | # define SIG_ATOMIC_WIDTH _GL_INTEGER_WIDTH (SIG_ATOMIC_MIN, SIG_ATOMIC_MAX) | ||
| 693 | # endif | ||
| 694 | #endif /* !WINT_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */ | ||
| 632 | 695 | ||
| 633 | #endif /* _@GUARD_PREFIX@_STDINT_H */ | 696 | #endif /* _@GUARD_PREFIX@_STDINT_H */ |
| 634 | #endif /* !(defined __ANDROID__ && ...) */ | 697 | #endif /* !(defined __ANDROID__ && ...) */ |
diff --git a/m4/extensions.m4 b/m4/extensions.m4 index 6d378ec41c1..3a556b1e1f7 100644 --- a/m4/extensions.m4 +++ b/m4/extensions.m4 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # serial 13 -*- Autoconf -*- | 1 | # serial 14 -*- Autoconf -*- |
| 2 | # Enable extensions on systems that normally disable them. | 2 | # Enable extensions on systems that normally disable them. |
| 3 | 3 | ||
| 4 | # Copyright (C) 2003, 2006-2016 Free Software Foundation, Inc. | 4 | # Copyright (C) 2003, 2006-2016 Free Software Foundation, Inc. |
| @@ -60,7 +60,7 @@ dnl configure.ac when using autoheader 2.62. | |||
| 60 | #ifndef _ALL_SOURCE | 60 | #ifndef _ALL_SOURCE |
| 61 | # undef _ALL_SOURCE | 61 | # undef _ALL_SOURCE |
| 62 | #endif | 62 | #endif |
| 63 | /* Enable general extensions on OS X. */ | 63 | /* Enable general extensions on macOS. */ |
| 64 | #ifndef _DARWIN_C_SOURCE | 64 | #ifndef _DARWIN_C_SOURCE |
| 65 | # undef _DARWIN_C_SOURCE | 65 | # undef _DARWIN_C_SOURCE |
| 66 | #endif | 66 | #endif |
| @@ -68,14 +68,38 @@ dnl configure.ac when using autoheader 2.62. | |||
| 68 | #ifndef _GNU_SOURCE | 68 | #ifndef _GNU_SOURCE |
| 69 | # undef _GNU_SOURCE | 69 | # undef _GNU_SOURCE |
| 70 | #endif | 70 | #endif |
| 71 | /* Use GNU style printf and scanf. */ | ||
| 72 | #ifndef __USE_MINGW_ANSI_STDIO | ||
| 73 | # undef __USE_MINGW_ANSI_STDIO | ||
| 74 | #endif | ||
| 75 | /* Enable threading extensions on Solaris. */ | 71 | /* Enable threading extensions on Solaris. */ |
| 76 | #ifndef _POSIX_PTHREAD_SEMANTICS | 72 | #ifndef _POSIX_PTHREAD_SEMANTICS |
| 77 | # undef _POSIX_PTHREAD_SEMANTICS | 73 | # undef _POSIX_PTHREAD_SEMANTICS |
| 78 | #endif | 74 | #endif |
| 75 | /* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ | ||
| 76 | #ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ | ||
| 77 | # undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ | ||
| 78 | #endif | ||
| 79 | /* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ | ||
| 80 | #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ | ||
| 81 | # undef __STDC_WANT_IEC_60559_BFP_EXT__ | ||
| 82 | #endif | ||
| 83 | /* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ | ||
| 84 | #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ | ||
| 85 | # undef __STDC_WANT_IEC_60559_DFP_EXT__ | ||
| 86 | #endif | ||
| 87 | /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ | ||
| 88 | #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ | ||
| 89 | # undef __STDC_WANT_IEC_60559_FUNCS_EXT__ | ||
| 90 | #endif | ||
| 91 | /* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ | ||
| 92 | #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ | ||
| 93 | # undef __STDC_WANT_IEC_60559_TYPES_EXT__ | ||
| 94 | #endif | ||
| 95 | /* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ | ||
| 96 | #ifndef __STDC_WANT_LIB_EXT2__ | ||
| 97 | # undef __STDC_WANT_LIB_EXT2__ | ||
| 98 | #endif | ||
| 99 | /* Enable extensions specified by ISO/IEC 24747:2009. */ | ||
| 100 | #ifndef __STDC_WANT_MATH_SPEC_FUNCS__ | ||
| 101 | # undef __STDC_WANT_MATH_SPEC_FUNCS__ | ||
| 102 | #endif | ||
| 79 | /* Enable extensions on HP NonStop. */ | 103 | /* Enable extensions on HP NonStop. */ |
| 80 | #ifndef _TANDEM_SOURCE | 104 | #ifndef _TANDEM_SOURCE |
| 81 | # undef _TANDEM_SOURCE | 105 | # undef _TANDEM_SOURCE |
| @@ -104,8 +128,14 @@ dnl configure.ac when using autoheader 2.62. | |||
| 104 | AC_DEFINE([_ALL_SOURCE]) | 128 | AC_DEFINE([_ALL_SOURCE]) |
| 105 | AC_DEFINE([_DARWIN_C_SOURCE]) | 129 | AC_DEFINE([_DARWIN_C_SOURCE]) |
| 106 | AC_DEFINE([_GNU_SOURCE]) | 130 | AC_DEFINE([_GNU_SOURCE]) |
| 107 | AC_DEFINE([__USE_MINGW_ANSI_STDIO]) | ||
| 108 | AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) | 131 | AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) |
| 132 | AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__]) | ||
| 133 | AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__]) | ||
| 134 | AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__]) | ||
| 135 | AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__]) | ||
| 136 | AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__]) | ||
| 137 | AC_DEFINE([__STDC_WANT_LIB_EXT2__]) | ||
| 138 | AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__]) | ||
| 109 | AC_DEFINE([_TANDEM_SOURCE]) | 139 | AC_DEFINE([_TANDEM_SOURCE]) |
| 110 | AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined], | 140 | AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined], |
| 111 | [ac_cv_should_define__xopen_source], | 141 | [ac_cv_should_define__xopen_source], |
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 5fc667c3520..5a660c53751 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 | |||
| @@ -99,6 +99,7 @@ AC_DEFUN([gl_EARLY], | |||
| 99 | # Code from module inttypes-incomplete: | 99 | # Code from module inttypes-incomplete: |
| 100 | # Code from module largefile: | 100 | # Code from module largefile: |
| 101 | AC_REQUIRE([AC_SYS_LARGEFILE]) | 101 | AC_REQUIRE([AC_SYS_LARGEFILE]) |
| 102 | # Code from module limits-h: | ||
| 102 | # Code from module lstat: | 103 | # Code from module lstat: |
| 103 | # Code from module manywarnings: | 104 | # Code from module manywarnings: |
| 104 | # Code from module memrchr: | 105 | # Code from module memrchr: |
| @@ -283,6 +284,7 @@ AC_DEFUN([gl_INIT], | |||
| 283 | gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) | 284 | gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) |
| 284 | gl_INTTYPES_INCOMPLETE | 285 | gl_INTTYPES_INCOMPLETE |
| 285 | AC_REQUIRE([gl_LARGEFILE]) | 286 | AC_REQUIRE([gl_LARGEFILE]) |
| 287 | gl_LIMITS_H | ||
| 286 | gl_FUNC_LSTAT | 288 | gl_FUNC_LSTAT |
| 287 | if test $REPLACE_LSTAT = 1; then | 289 | if test $REPLACE_LSTAT = 1; then |
| 288 | AC_LIBOBJ([lstat]) | 290 | AC_LIBOBJ([lstat]) |
| @@ -928,6 +930,7 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 928 | lib/ignore-value.h | 930 | lib/ignore-value.h |
| 929 | lib/intprops.h | 931 | lib/intprops.h |
| 930 | lib/inttypes.in.h | 932 | lib/inttypes.in.h |
| 933 | lib/limits.in.h | ||
| 931 | lib/lstat.c | 934 | lib/lstat.c |
| 932 | lib/md5.c | 935 | lib/md5.c |
| 933 | lib/md5.h | 936 | lib/md5.h |
| @@ -1043,6 +1046,7 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 1043 | m4/include_next.m4 | 1046 | m4/include_next.m4 |
| 1044 | m4/inttypes.m4 | 1047 | m4/inttypes.m4 |
| 1045 | m4/largefile.m4 | 1048 | m4/largefile.m4 |
| 1049 | m4/limits-h.m4 | ||
| 1046 | m4/longlong.m4 | 1050 | m4/longlong.m4 |
| 1047 | m4/lstat.m4 | 1051 | m4/lstat.m4 |
| 1048 | m4/manywarnings.m4 | 1052 | m4/manywarnings.m4 |
diff --git a/m4/limits-h.m4 b/m4/limits-h.m4 new file mode 100644 index 00000000000..913078689ba --- /dev/null +++ b/m4/limits-h.m4 | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | dnl Check whether limits.h has needed features. | ||
| 2 | |||
| 3 | dnl Copyright 2016 Free Software Foundation, Inc. | ||
| 4 | dnl This file is free software; the Free Software Foundation | ||
| 5 | dnl gives unlimited permission to copy and/or distribute it, | ||
| 6 | dnl with or without modifications, as long as this notice is preserved. | ||
| 7 | |||
| 8 | dnl From Paul Eggert. | ||
| 9 | |||
| 10 | AC_DEFUN_ONCE([gl_LIMITS_H], | ||
| 11 | [ | ||
| 12 | gl_CHECK_NEXT_HEADERS([limits.h]) | ||
| 13 | |||
| 14 | AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.], | ||
| 15 | [gl_cv_header_limits_width], | ||
| 16 | [AC_COMPILE_IFELSE( | ||
| 17 | [AC_LANG_PROGRAM([[#define __STDC_WANT_IEC_60559_BFP_EXT__ 1 | ||
| 18 | #include <limits.h> | ||
| 19 | int ullw = ULLONG_WIDTH;]])], | ||
| 20 | [gl_cv_header_limits_width=yes], | ||
| 21 | [gl_cv_header_limits_width=no])]) | ||
| 22 | if test "$gl_cv_header_limits_width" = yes; then | ||
| 23 | LIMITS_H= | ||
| 24 | else | ||
| 25 | LIMITS_H=limits.h | ||
| 26 | fi | ||
| 27 | AC_SUBST([LIMITS_H]) | ||
| 28 | AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) | ||
| 29 | ]) | ||
diff --git a/m4/stdint.m4 b/m4/stdint.m4 index 0b4b9060dbb..52f7814ef84 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # stdint.m4 serial 44 | 1 | # stdint.m4 serial 45 |
| 2 | dnl Copyright (C) 2001-2016 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2001-2016 Free Software Foundation, Inc. |
| 3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
| 4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
| @@ -11,6 +11,8 @@ AC_DEFUN_ONCE([gl_STDINT_H], | |||
| 11 | [ | 11 | [ |
| 12 | AC_PREREQ([2.59])dnl | 12 | AC_PREREQ([2.59])dnl |
| 13 | 13 | ||
| 14 | AC_REQUIRE([gl_LIMITS_H]) | ||
| 15 | |||
| 14 | dnl Check for long long int and unsigned long long int. | 16 | dnl Check for long long int and unsigned long long int. |
| 15 | AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) | 17 | AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) |
| 16 | if test $ac_cv_type_long_long_int = yes; then | 18 | if test $ac_cv_type_long_long_int = yes; then |
| @@ -282,14 +284,20 @@ static const char *macro_values[] = | |||
| 282 | ]) | 284 | ]) |
| 283 | ]) | 285 | ]) |
| 284 | fi | 286 | fi |
| 287 | |||
| 288 | HAVE_C99_STDINT_H=0 | ||
| 289 | HAVE_SYS_BITYPES_H=0 | ||
| 290 | HAVE_SYS_INTTYPES_H=0 | ||
| 291 | STDINT_H=stdint.h | ||
| 285 | if test "$gl_cv_header_working_stdint_h" = yes; then | 292 | if test "$gl_cv_header_working_stdint_h" = yes; then |
| 293 | HAVE_C99_STDINT_H=1 | ||
| 286 | dnl Now see whether the system <stdint.h> works without | 294 | dnl Now see whether the system <stdint.h> works without |
| 287 | dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined. | 295 | dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined. |
| 288 | AC_CACHE_CHECK([whether stdint.h predates C++11], | 296 | AC_CACHE_CHECK([whether stdint.h predates C++11], |
| 289 | [gl_cv_header_stdint_predates_cxx11_h], | 297 | [gl_cv_header_stdint_predates_cxx11_h], |
| 290 | [gl_cv_header_stdint_predates_cxx11_h=yes | 298 | [gl_cv_header_stdint_predates_cxx11_h=yes |
| 291 | AC_COMPILE_IFELSE([ | 299 | AC_COMPILE_IFELSE([ |
| 292 | AC_LANG_PROGRAM([[ | 300 | AC_LANG_PROGRAM([[ |
| 293 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ | 301 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ |
| 294 | #include <stdint.h> | 302 | #include <stdint.h> |
| 295 | ] | 303 | ] |
| @@ -306,27 +314,40 @@ int32_t i32 = INT32_C (0x7fffffff); | |||
| 306 | AC_DEFINE([__STDC_LIMIT_MACROS], [1], | 314 | AC_DEFINE([__STDC_LIMIT_MACROS], [1], |
| 307 | [Define to 1 if the system <stdint.h> predates C++11.]) | 315 | [Define to 1 if the system <stdint.h> predates C++11.]) |
| 308 | fi | 316 | fi |
| 309 | STDINT_H= | 317 | AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.], |
| 318 | [gl_cv_header_stdint_width], | ||
| 319 | [gl_cv_header_stdint_width=no | ||
| 320 | AC_COMPILE_IFELSE( | ||
| 321 | [AC_LANG_PROGRAM([[ | ||
| 322 | /* Work if build is not clean. */ | ||
| 323 | #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 | ||
| 324 | #include <stdint.h> | ||
| 325 | ]gl_STDINT_INCLUDES[ | ||
| 326 | int iw = UINTMAX_WIDTH; | ||
| 327 | ]])], | ||
| 328 | [gl_cv_header_stdint_width=yes])]) | ||
| 329 | if test "$gl_cv_header_stdint_width" = yes; then | ||
| 330 | STDINT_H= | ||
| 331 | fi | ||
| 310 | else | 332 | else |
| 311 | dnl Check for <sys/inttypes.h>, and for | 333 | dnl Check for <sys/inttypes.h>, and for |
| 312 | dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5). | 334 | dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5). |
| 313 | AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) | 335 | AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) |
| 314 | if test $ac_cv_header_sys_inttypes_h = yes; then | 336 | if test $ac_cv_header_sys_inttypes_h = yes; then |
| 315 | HAVE_SYS_INTTYPES_H=1 | 337 | HAVE_SYS_INTTYPES_H=1 |
| 316 | else | ||
| 317 | HAVE_SYS_INTTYPES_H=0 | ||
| 318 | fi | 338 | fi |
| 319 | AC_SUBST([HAVE_SYS_INTTYPES_H]) | ||
| 320 | if test $ac_cv_header_sys_bitypes_h = yes; then | 339 | if test $ac_cv_header_sys_bitypes_h = yes; then |
| 321 | HAVE_SYS_BITYPES_H=1 | 340 | HAVE_SYS_BITYPES_H=1 |
| 322 | else | ||
| 323 | HAVE_SYS_BITYPES_H=0 | ||
| 324 | fi | 341 | fi |
| 325 | AC_SUBST([HAVE_SYS_BITYPES_H]) | ||
| 326 | |||
| 327 | gl_STDINT_TYPE_PROPERTIES | 342 | gl_STDINT_TYPE_PROPERTIES |
| 328 | STDINT_H=stdint.h | ||
| 329 | fi | 343 | fi |
| 344 | |||
| 345 | # The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH. | ||
| 346 | test -z "$STDINT_H" || LIMITS_H=limits.h | ||
| 347 | |||
| 348 | AC_SUBST([HAVE_C99_STDINT_H]) | ||
| 349 | AC_SUBST([HAVE_SYS_BITYPES_H]) | ||
| 350 | AC_SUBST([HAVE_SYS_INTTYPES_H]) | ||
| 330 | AC_SUBST([STDINT_H]) | 351 | AC_SUBST([STDINT_H]) |
| 331 | AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) | 352 | AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) |
| 332 | ]) | 353 | ]) |
| @@ -504,8 +525,3 @@ dnl Remove this when we can assume autoconf >= 2.61. | |||
| 504 | m4_ifdef([AC_COMPUTE_INT], [], [ | 525 | m4_ifdef([AC_COMPUTE_INT], [], [ |
| 505 | AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) | 526 | AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) |
| 506 | ]) | 527 | ]) |
| 507 | |||
| 508 | # Hey Emacs! | ||
| 509 | # Local Variables: | ||
| 510 | # indent-tabs-mode: nil | ||
| 511 | # End: | ||
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4 index 0e387585d27..5149981a804 100644 --- a/m4/stdio_h.m4 +++ b/m4/stdio_h.m4 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # stdio_h.m4 serial 46 | 1 | # stdio_h.m4 serial 47 |
| 2 | dnl Copyright (C) 2007-2016 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2007-2016 Free Software Foundation, Inc. |
| 3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
| 4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
| @@ -6,9 +6,7 @@ dnl with or without modifications, as long as this notice is preserved. | |||
| 6 | 6 | ||
| 7 | AC_DEFUN([gl_STDIO_H], | 7 | AC_DEFUN([gl_STDIO_H], |
| 8 | [ | 8 | [ |
| 9 | dnl For __USE_MINGW_ANSI_STDIO | 9 | AC_DEFINE([__USE_MINGW_ANSI_STDIO], 1, [Use GNU style printf and scanf.]) |
| 10 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | ||
| 11 | |||
| 12 | AC_REQUIRE([gl_STDIO_H_DEFAULTS]) | 10 | AC_REQUIRE([gl_STDIO_H_DEFAULTS]) |
| 13 | gl_NEXT_HEADERS([stdio.h]) | 11 | gl_NEXT_HEADERS([stdio.h]) |
| 14 | 12 | ||
diff --git a/m4/sys_types_h.m4 b/m4/sys_types_h.m4 index b0aabb47862..159b005b3d4 100644 --- a/m4/sys_types_h.m4 +++ b/m4/sys_types_h.m4 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # sys_types_h.m4 serial 5 | 1 | # sys_types_h.m4 serial 6 |
| 2 | dnl Copyright (C) 2011-2016 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2011-2016 Free Software Foundation, Inc. |
| 3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
| 4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
| @@ -22,3 +22,28 @@ AC_DEFUN_ONCE([gl_SYS_TYPES_H], | |||
| 22 | AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS], | 22 | AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS], |
| 23 | [ | 23 | [ |
| 24 | ]) | 24 | ]) |
| 25 | |||
| 26 | # This works around a buggy version in autoconf <= 2.69. | ||
| 27 | # See <https://lists.gnu.org/archive/html/autoconf/2016-08/msg00014.html> | ||
| 28 | |||
| 29 | m4_version_prereq([2.70], [], [ | ||
| 30 | |||
| 31 | # This is taken from the following Autoconf patch: | ||
| 32 | # http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=e17a30e98 | ||
| 33 | |||
| 34 | m4_undefine([AC_HEADER_MAJOR]) | ||
| 35 | AC_DEFUN([AC_HEADER_MAJOR], | ||
| 36 | [AC_CHECK_HEADERS_ONCE([sys/types.h]) | ||
| 37 | AC_CHECK_HEADER([sys/mkdev.h], | ||
| 38 | [AC_DEFINE([MAJOR_IN_MKDEV], [1], | ||
| 39 | [Define to 1 if `major', `minor', and `makedev' are declared in | ||
| 40 | <mkdev.h>.])]) | ||
| 41 | if test $ac_cv_header_sys_mkdev_h = no; then | ||
| 42 | AC_CHECK_HEADER([sys/sysmacros.h], | ||
| 43 | [AC_DEFINE([MAJOR_IN_SYSMACROS], [1], | ||
| 44 | [Define to 1 if `major', `minor', and `makedev' are declared in | ||
| 45 | <sysmacros.h>.])]) | ||
| 46 | fi | ||
| 47 | ]) | ||
| 48 | |||
| 49 | ]) | ||
diff --git a/nt/gnulib.mk b/nt/gnulib.mk index fdbad17184e..65b206e2fac 100644 --- a/nt/gnulib.mk +++ b/nt/gnulib.mk | |||
| @@ -475,6 +475,34 @@ EXTRA_DIST += intprops.h | |||
| 475 | 475 | ||
| 476 | ## end gnulib module intprops | 476 | ## end gnulib module intprops |
| 477 | 477 | ||
| 478 | ## begin gnulib module limits-h | ||
| 479 | |||
| 480 | BUILT_SOURCES += $(LIMITS_H) | ||
| 481 | |||
| 482 | # We need the following in order to create <limits.h> when the system | ||
| 483 | # doesn't have one that is compatible with GNU. | ||
| 484 | if GL_GENERATE_LIMITS_H | ||
| 485 | limits.h: limits.in.h $(top_builddir)/config.status | ||
| 486 | $(AM_V_GEN)rm -f $@-t $@ && \ | ||
| 487 | { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ | ||
| 488 | sed -e 's|@''GUARD_PREFIX''@|GL|g' \ | ||
| 489 | -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ | ||
| 490 | -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ | ||
| 491 | -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ | ||
| 492 | -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \ | ||
| 493 | < $(srcdir)/limits.in.h; \ | ||
| 494 | } > $@-t && \ | ||
| 495 | mv $@-t $@ | ||
| 496 | else | ||
| 497 | limits.h: $(top_builddir)/config.status | ||
| 498 | rm -f $@ | ||
| 499 | endif | ||
| 500 | MOSTLYCLEANFILES += limits.h limits.h-t | ||
| 501 | |||
| 502 | EXTRA_DIST += limits.in.h | ||
| 503 | |||
| 504 | ## end gnulib module limits-h | ||
| 505 | |||
| 478 | ## begin gnulib module lstat | 506 | ## begin gnulib module lstat |
| 479 | 507 | ||
| 480 | 508 | ||
| @@ -770,6 +798,7 @@ stdint.h: stdint.in.h $(top_builddir)/config.status | |||
| 770 | -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ | 798 | -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ |
| 771 | -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ | 799 | -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ |
| 772 | -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ | 800 | -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ |
| 801 | -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \ | ||
| 773 | -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ | 802 | -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ |
| 774 | -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ | 803 | -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ |
| 775 | -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ | 804 | -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ |