Skip to content

Commit 1dab1c5

Browse files
committed
[too many to list] Index macros directly from definitions
This commit uses the macro to index macro definitions directly from the header synopses where they are defined, thus removing the need for a separate indexing macro that can get out of sync. This commit does NOT address function-like macros, or macros that use placemarker syntax in their naming.
1 parent 399b939 commit 1dab1c5

File tree

9 files changed

+291
-555
lines changed

9 files changed

+291
-555
lines changed

source/diagnostics.tex

Lines changed: 76 additions & 151 deletions
Large diffs are not rendered by default.

source/future.tex

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -221,34 +221,28 @@
221221

222222
\pnum
223223
The header \libheaderref{stdalign.h} has the following macros:
224-
\indexlibraryglobal{__alignas_is_defined}%
225224
\begin{codeblock}
226-
#define @\xname{alignas_is_defined}@ 1
227-
#define @\xname{alignof_is_defined}@ 1
225+
#define @\libglobal{alignas_is_defined}@ 1
226+
#define @\libglobal{alignof_is_defined}@ 1
228227
\end{codeblock}
229228

230229
\pnum
231230
The header \libheaderref{stdbool.h} has the following macro:
232231
\indexhdr{stdbool.h}%
233-
\indexlibraryglobal{__bool_true_false_are_defined}%
234232
\begin{codeblock}
235-
#define @\xname{bool_true_false_are_defined}@ 1
233+
#define @\libglobal{bool_true_false_are_defined}@ 1
236234
\end{codeblock}
237235

238236
\rSec1[depr.cerrno]{Deprecated error numbers}
239237

240238
\pnum
241239
The header \libheaderref{cerrno} has the following additional macros:
242240

243-
\indexlibraryglobal{ENODATA}%
244-
\indexlibraryglobal{ENOSR}%
245-
\indexlibraryglobal{ENOSTR}%
246-
\indexlibraryglobal{ETIME}%
247241
\begin{codeblock}
248-
#define ENODATA @\seebelow@
249-
#define ENOSR @\seebelow@
250-
#define ENOSTR @\seebelow@
251-
#define ETIME @\seebelow@
242+
#define @\libglobal{ENODATA}@ @\seebelow@
243+
#define @\libglobal{ENOSR}@ @\seebelow@
244+
#define @\libglobal{ENOSTR}@ @\seebelow@
245+
#define @\libglobal{ETIME}@ @\seebelow@
252246
\end{codeblock}
253247

254248
\pnum

source/iostreams.tex

Lines changed: 38 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -18825,22 +18825,6 @@
1882518825
\indexlibraryglobal{size_t}%
1882618826
\indexlibraryglobal{FILE}%
1882718827
\indexlibraryglobal{fpos_t}%
18828-
\indexlibraryglobal{NULL}%
18829-
\indexlibraryglobal{_IOFBF}%
18830-
\indexlibraryglobal{_IOLBF}%
18831-
\indexlibraryglobal{_IONBF}%
18832-
\indexlibraryglobal{BUFSIZ}%
18833-
\indexlibraryglobal{EOF}%
18834-
\indexlibraryglobal{FOPEN_MAX}%
18835-
\indexlibraryglobal{FILENAME_MAX}%
18836-
\indexlibraryglobal{L_tmpnam}%
18837-
\indexlibraryglobal{SEEK_CUR}%
18838-
\indexlibraryglobal{SEEK_END}%
18839-
\indexlibraryglobal{SEEK_SET}%
18840-
\indexlibraryglobal{TMP_MAX}%
18841-
\indexlibraryglobal{stderr}%
18842-
\indexlibraryglobal{stdin}%
18843-
\indexlibraryglobal{stdout}%
1884418828
\indexlibraryglobal{remove}%
1884518829
\indexlibraryglobal{rename}%
1884618830
\indexlibraryglobal{tmpfile}%
@@ -18893,22 +18877,22 @@
1889318877
using fpos_t = @\seebelow@;
1889418878
}
1889518879

18896-
#define NULL @\textit{see \ref{support.types.nullptr}}@
18897-
#define _IOFBF @\seebelow@
18898-
#define _IOLBF @\seebelow@
18899-
#define _IONBF @\seebelow@
18900-
#define BUFSIZ @\seebelow@
18901-
#define EOF @\seebelow@
18902-
#define FOPEN_MAX @\seebelow@
18903-
#define FILENAME_MAX @\seebelow@
18904-
#define L_tmpnam @\seebelow@
18905-
#define SEEK_CUR @\seebelow@
18906-
#define SEEK_END @\seebelow@
18907-
#define SEEK_SET @\seebelow@
18908-
#define TMP_MAX @\seebelow@
18909-
#define stderr @\seebelow@
18910-
#define stdin @\seebelow@
18911-
#define stdout @\seebelow@
18880+
#define @\libglobal{NULL}@ @\textit{see \ref{support.types.nullptr}}@
18881+
#define @\libglobal{_IOFBF}@ @\seebelow@
18882+
#define @\libglobal{_IOLBF}@ @\seebelow@
18883+
#define @\libglobal{_IONBF}@ @\seebelow@
18884+
#define @\libglobal{BUFSIZ}@ @\seebelow@
18885+
#define @\libglobal{EOF}@ @\seebelow@
18886+
#define @\libglobal{FOPEN_MAX}@ @\seebelow@
18887+
#define @\libglobal{FILENAME_MAX}@ @\seebelow@
18888+
#define @\libglobal{L_tmpnam}@ @\seebelow@
18889+
#define @\libglobal{SEEK_CUR}@ @\seebelow@
18890+
#define @\libglobal{SEEK_END}@ @\seebelow@
18891+
#define @\libglobal{SEEK_SET}@ @\seebelow@
18892+
#define @\libglobal{TMP_MAX}@ @\seebelow@
18893+
#define @\libglobal{stderr}@ @\seebelow@
18894+
#define @\libglobal{stdin}@ @\seebelow@
18895+
#define @\libglobal{stdout}@ @\seebelow@
1891218896

1891318897
namespace std {
1891418898
int remove(const char* filename);
@@ -19015,28 +18999,6 @@
1901518999
\indexlibraryglobal{SCNoFASTN}%
1901619000
\indexlibraryglobal{SCNuFASTN}%
1901719001
\indexlibraryglobal{SCNxFASTN}%
19018-
\indexlibraryglobal{PRIdMAX}%
19019-
\indexlibraryglobal{PRIiMAX}%
19020-
\indexlibraryglobal{PRIoMAX}%
19021-
\indexlibraryglobal{PRIuMAX}%
19022-
\indexlibraryglobal{PRIxMAX}%
19023-
\indexlibraryglobal{PRIXMAX}%
19024-
\indexlibraryglobal{SCNdMAX}%
19025-
\indexlibraryglobal{SCNiMAX}%
19026-
\indexlibraryglobal{SCNoMAX}%
19027-
\indexlibraryglobal{SCNuMAX}%
19028-
\indexlibraryglobal{SCNxMAX}%
19029-
\indexlibraryglobal{PRIdPTR}%
19030-
\indexlibraryglobal{PRIiPTR}%
19031-
\indexlibraryglobal{PRIoPTR}%
19032-
\indexlibraryglobal{PRIuPTR}%
19033-
\indexlibraryglobal{PRIxPTR}%
19034-
\indexlibraryglobal{PRIXPTR}%
19035-
\indexlibraryglobal{SCNdPTR}%
19036-
\indexlibraryglobal{SCNiPTR}%
19037-
\indexlibraryglobal{SCNoPTR}%
19038-
\indexlibraryglobal{SCNuPTR}%
19039-
\indexlibraryglobal{SCNxPTR}%
1904019002
\begin{codeblock}
1904119003
#include <cstdint> // see \ref{cstdint.syn}
1904219004

@@ -19087,28 +19049,28 @@
1908719049
#define SCNoFAST@\placeholdernc{N}@ @\seebelow@
1908819050
#define SCNuFAST@\placeholdernc{N}@ @\seebelow@
1908919051
#define SCNxFAST@\placeholdernc{N}@ @\seebelow@
19090-
#define PRIdMAX @\seebelow@
19091-
#define PRIiMAX @\seebelow@
19092-
#define PRIoMAX @\seebelow@
19093-
#define PRIuMAX @\seebelow@
19094-
#define PRIxMAX @\seebelow@
19095-
#define PRIXMAX @\seebelow@
19096-
#define SCNdMAX @\seebelow@
19097-
#define SCNiMAX @\seebelow@
19098-
#define SCNoMAX @\seebelow@
19099-
#define SCNuMAX @\seebelow@
19100-
#define SCNxMAX @\seebelow@
19101-
#define PRIdPTR @\seebelow@
19102-
#define PRIiPTR @\seebelow@
19103-
#define PRIoPTR @\seebelow@
19104-
#define PRIuPTR @\seebelow@
19105-
#define PRIxPTR @\seebelow@
19106-
#define PRIXPTR @\seebelow@
19107-
#define SCNdPTR @\seebelow@
19108-
#define SCNiPTR @\seebelow@
19109-
#define SCNoPTR @\seebelow@
19110-
#define SCNuPTR @\seebelow@
19111-
#define SCNxPTR @\seebelow@
19052+
#define @\libglobal{PRIdMAX}@ @\seebelow@
19053+
#define @\libglobal{PRIiMAX}@ @\seebelow@
19054+
#define @\libglobal{PRIoMAX}@ @\seebelow@
19055+
#define @\libglobal{PRIuMAX}@ @\seebelow@
19056+
#define @\libglobal{PRIxMAX}@ @\seebelow@
19057+
#define @\libglobal{PRIXMAX}@ @\seebelow@
19058+
#define @\libglobal{SCNdMAX}@ @\seebelow@
19059+
#define @\libglobal{SCNiMAX}@ @\seebelow@
19060+
#define @\libglobal{SCNoMAX}@ @\seebelow@
19061+
#define @\libglobal{SCNuMAX}@ @\seebelow@
19062+
#define @\libglobal{SCNxMAX}@ @\seebelow@
19063+
#define @\libglobal{PRIdPTR}@ @\seebelow@
19064+
#define @\libglobal{PRIiPTR}@ @\seebelow@
19065+
#define @\libglobal{PRIoPTR}@ @\seebelow@
19066+
#define @\libglobal{PRIuPTR}@ @\seebelow@
19067+
#define @\libglobal{PRIxPTR}@ @\seebelow@
19068+
#define @\libglobal{PRIXPTR}@ @\seebelow@
19069+
#define @\libglobal{SCNdPTR}@ @\seebelow@
19070+
#define @\libglobal{SCNiPTR}@ @\seebelow@
19071+
#define @\libglobal{SCNoPTR}@ @\seebelow@
19072+
#define @\libglobal{SCNuPTR}@ @\seebelow@
19073+
#define @\libglobal{SCNxPTR}@ @\seebelow@
1911219074
\end{codeblock}
1911319075

1911419076
\pnum

source/numerics.tex

Lines changed: 30 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -98,31 +98,20 @@
9898
\indexlibraryglobal{feholdexcept}%
9999
\indexlibraryglobal{fesetenv}%
100100
\indexlibraryglobal{feupdateenv}%
101-
\indexlibraryglobal{FE_ALL_EXCEPT}%
102-
\indexlibraryglobal{FE_DIVBYZERO}%
103-
\indexlibraryglobal{FE_INEXACT}%
104-
\indexlibraryglobal{FE_INVALID}%
105-
\indexlibraryglobal{FE_OVERFLOW}%
106-
\indexlibraryglobal{FE_UNDERFLOW}%
107-
\indexlibraryglobal{FE_DOWNWARD}%
108-
\indexlibraryglobal{FE_TONEAREST}%
109-
\indexlibraryglobal{FE_TOWARDZERO}%
110-
\indexlibraryglobal{FE_UPWARD}%
111-
\indexlibraryglobal{FE_DFL_ENV}%
112101
\begin{codeblock}
113-
#define FE_ALL_EXCEPT @\seebelow@
114-
#define FE_DIVBYZERO @\seebelow@ // optional
115-
#define FE_INEXACT @\seebelow@ // optional
116-
#define FE_INVALID @\seebelow@ // optional
117-
#define FE_OVERFLOW @\seebelow@ // optional
118-
#define FE_UNDERFLOW @\seebelow@ // optional
102+
#define @\libglobal{FE_ALL_EXCEPT}@ @\seebelow@
103+
#define @\libglobal{FE_DIVBYZERO}@ @\seebelow@ // optional
104+
#define @\libglobal{FE_INEXACT}@ @\seebelow@ // optional
105+
#define @\libglobal{FE_INVALID}@ @\seebelow@ // optional
106+
#define @\libglobal{FE_OVERFLOW}@ @\seebelow@ // optional
107+
#define @\libglobal{FE_UNDERFLOW}@ @\seebelow@ // optional
119108

120-
#define FE_DOWNWARD @\seebelow@ // optional
121-
#define FE_TONEAREST @\seebelow@ // optional
122-
#define FE_TOWARDZERO @\seebelow@ // optional
123-
#define FE_UPWARD @\seebelow@ // optional
109+
#define @\libglobal{FE_DOWNWARD}@ @\seebelow@ // optional
110+
#define @\libglobal{FE_TONEAREST}@ @\seebelow@ // optional
111+
#define @\libglobal{FE_TOWARDZERO}@ @\seebelow@ // optional
112+
#define @\libglobal{FE_UPWARD}@ @\seebelow@ // optional
124113

125-
#define FE_DFL_ENV @\seebelow@
114+
#define @\libglobal{FE_DFL_ENV}@ @\seebelow@
126115

127116
namespace std {
128117
// types
@@ -9128,23 +9117,6 @@
91289117
\rSec2[cmath.syn]{Header \tcode{<cmath>} synopsis}
91299118

91309119
\indexheader{cmath}%
9131-
\indexlibraryglobal{FP_FAST_FMA}%
9132-
\indexlibraryglobal{FP_FAST_FMAF}%
9133-
\indexlibraryglobal{FP_FAST_FMAL}%
9134-
\indexlibraryglobal{FP_ILOGB0}%
9135-
\indexlibraryglobal{FP_ILOGBNAN}%
9136-
\indexlibraryglobal{FP_INFINITE}%
9137-
\indexlibraryglobal{FP_NAN}%
9138-
\indexlibraryglobal{FP_NORMAL}%
9139-
\indexlibraryglobal{FP_SUBNORMAL}%
9140-
\indexlibraryglobal{FP_ZERO}%
9141-
\indexlibraryglobal{HUGE_VAL}%
9142-
\indexlibraryglobal{HUGE_VALF}%
9143-
\indexlibraryglobal{HUGE_VALL}%
9144-
\indexlibraryglobal{INFINITY}%
9145-
\indexlibraryglobal{MATH_ERREXCEPT}%
9146-
\indexlibraryglobal{MATH_ERRNO}%
9147-
\indexlibraryglobal{NAN}%
91489120
\indexlibraryglobal{abs}%
91499121
\indexlibraryglobal{acos}%
91509122
\indexlibraryglobal{acosf}%
@@ -9273,7 +9245,6 @@
92739245
\indexlibraryglobal{lround}%
92749246
\indexlibraryglobal{lroundf}%
92759247
\indexlibraryglobal{lroundl}%
9276-
\indexlibraryglobal{math_errhandling}%
92779248
\indexlibraryglobal{modf}%
92789249
\indexlibraryglobal{modff}%
92799250
\indexlibraryglobal{modfl}%
@@ -9338,25 +9309,25 @@
93389309
using double_t = @\seebelow@;
93399310
}
93409311

9341-
#define HUGE_VAL @\seebelow@
9342-
#define HUGE_VALF @\seebelow@
9343-
#define HUGE_VALL @\seebelow@
9344-
#define INFINITY @\seebelow@
9345-
#define NAN @\seebelow@
9346-
#define FP_INFINITE @\seebelow@
9347-
#define FP_NAN @\seebelow@
9348-
#define FP_NORMAL @\seebelow@
9349-
#define FP_SUBNORMAL @\seebelow@
9350-
#define FP_ZERO @\seebelow@
9351-
#define FP_FAST_FMA @\seebelow@
9352-
#define FP_FAST_FMAF @\seebelow@
9353-
#define FP_FAST_FMAL @\seebelow@
9354-
#define FP_ILOGB0 @\seebelow@
9355-
#define FP_ILOGBNAN @\seebelow@
9356-
#define MATH_ERRNO @\seebelow@
9357-
#define MATH_ERREXCEPT @\seebelow@
9358-
9359-
#define math_errhandling @\seebelow@
9312+
#define @\libglobal{HUGE_VAL}@ @\seebelow@
9313+
#define @\libglobal{HUGE_VALF}@ @\seebelow@
9314+
#define @\libglobal{HUGE_VALL}@ @\seebelow@
9315+
#define @\libglobal{INFINITY}@ @\seebelow@
9316+
#define @\libglobal{NAN}@ @\seebelow@
9317+
#define @\libglobal{FP_INFINITE}@ @\seebelow@
9318+
#define @\libglobal{FP_NAN}@ @\seebelow@
9319+
#define @\libglobal{FP_NORMAL}@ @\seebelow@
9320+
#define @\libglobal{FP_SUBNORMAL}@ @\seebelow@
9321+
#define @\libglobal{FP_ZERO}@ @\seebelow@
9322+
#define @\libglobal{FP_FAST_FMA}@ @\seebelow@
9323+
#define @\libglobal{FP_FAST_FMAF}@ @\seebelow@
9324+
#define @\libglobal{FP_FAST_FMAL}@ @\seebelow@
9325+
#define @\libglobal{FP_ILOGB0}@ @\seebelow@
9326+
#define @\libglobal{FP_ILOGBNAN}@ @\seebelow@
9327+
#define @\libglobal{MATH_ERRNO}@ @\seebelow@
9328+
#define @\libglobal{MATH_ERREXCEPT}@ @\seebelow@
9329+
9330+
#define @\libglobal{math_errhandling}@ @\seebelow@
93609331

93619332
namespace std {
93629333
constexpr @\placeholdernc{floating-point-type}@ acos(@\placeholdernc{floating-point-type}@ x);

source/strings.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5500,7 +5500,7 @@
55005500
size_t strlen(const char* s); // freestanding
55015501
}
55025502

5503-
#define NULL @\textit{see \ref{support.types.nullptr}}@ // freestanding
5503+
#define @\libglobal{NULL}@ @\textit{see \ref{support.types.nullptr}}@ // freestanding
55045504
\end{codeblock}
55055505

55065506
\pnum

0 commit comments

Comments
 (0)