Skip to content

Commit

Permalink
[too many to list] Index macros directly from definitions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AlisdairM committed Dec 30, 2024
1 parent 399b939 commit 1dab1c5
Show file tree
Hide file tree
Showing 9 changed files with 291 additions and 555 deletions.
227 changes: 76 additions & 151 deletions source/diagnostics.tex

Large diffs are not rendered by default.

20 changes: 7 additions & 13 deletions source/future.tex
Original file line number Diff line number Diff line change
Expand Up @@ -221,34 +221,28 @@

\pnum
The header \libheaderref{stdalign.h} has the following macros:
\indexlibraryglobal{__alignas_is_defined}%
\begin{codeblock}
#define @\xname{alignas_is_defined}@ 1
#define @\xname{alignof_is_defined}@ 1
#define @\libglobal{alignas_is_defined}@ 1
#define @\libglobal{alignof_is_defined}@ 1
\end{codeblock}

\pnum
The header \libheaderref{stdbool.h} has the following macro:
\indexhdr{stdbool.h}%
\indexlibraryglobal{__bool_true_false_are_defined}%
\begin{codeblock}
#define @\xname{bool_true_false_are_defined}@ 1
#define @\libglobal{bool_true_false_are_defined}@ 1
\end{codeblock}

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

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

\indexlibraryglobal{ENODATA}%
\indexlibraryglobal{ENOSR}%
\indexlibraryglobal{ENOSTR}%
\indexlibraryglobal{ETIME}%
\begin{codeblock}
#define ENODATA @\seebelow@
#define ENOSR @\seebelow@
#define ENOSTR @\seebelow@
#define ETIME @\seebelow@
#define @\libglobal{ENODATA}@ @\seebelow@
#define @\libglobal{ENOSR}@ @\seebelow@
#define @\libglobal{ENOSTR}@ @\seebelow@
#define @\libglobal{ETIME}@ @\seebelow@
\end{codeblock}

\pnum
Expand Down
114 changes: 38 additions & 76 deletions source/iostreams.tex
Original file line number Diff line number Diff line change
Expand Up @@ -18825,22 +18825,6 @@
\indexlibraryglobal{size_t}%
\indexlibraryglobal{FILE}%
\indexlibraryglobal{fpos_t}%
\indexlibraryglobal{NULL}%
\indexlibraryglobal{_IOFBF}%
\indexlibraryglobal{_IOLBF}%
\indexlibraryglobal{_IONBF}%
\indexlibraryglobal{BUFSIZ}%
\indexlibraryglobal{EOF}%
\indexlibraryglobal{FOPEN_MAX}%
\indexlibraryglobal{FILENAME_MAX}%
\indexlibraryglobal{L_tmpnam}%
\indexlibraryglobal{SEEK_CUR}%
\indexlibraryglobal{SEEK_END}%
\indexlibraryglobal{SEEK_SET}%
\indexlibraryglobal{TMP_MAX}%
\indexlibraryglobal{stderr}%
\indexlibraryglobal{stdin}%
\indexlibraryglobal{stdout}%
\indexlibraryglobal{remove}%
\indexlibraryglobal{rename}%
\indexlibraryglobal{tmpfile}%
Expand Down Expand Up @@ -18893,22 +18877,22 @@
using fpos_t = @\seebelow@;
}

#define NULL @\textit{see \ref{support.types.nullptr}}@
#define _IOFBF @\seebelow@
#define _IOLBF @\seebelow@
#define _IONBF @\seebelow@
#define BUFSIZ @\seebelow@
#define EOF @\seebelow@
#define FOPEN_MAX @\seebelow@
#define FILENAME_MAX @\seebelow@
#define L_tmpnam @\seebelow@
#define SEEK_CUR @\seebelow@
#define SEEK_END @\seebelow@
#define SEEK_SET @\seebelow@
#define TMP_MAX @\seebelow@
#define stderr @\seebelow@
#define stdin @\seebelow@
#define stdout @\seebelow@
#define @\libglobal{NULL}@ @\textit{see \ref{support.types.nullptr}}@
#define @\libglobal{_IOFBF}@ @\seebelow@
#define @\libglobal{_IOLBF}@ @\seebelow@
#define @\libglobal{_IONBF}@ @\seebelow@
#define @\libglobal{BUFSIZ}@ @\seebelow@
#define @\libglobal{EOF}@ @\seebelow@
#define @\libglobal{FOPEN_MAX}@ @\seebelow@
#define @\libglobal{FILENAME_MAX}@ @\seebelow@
#define @\libglobal{L_tmpnam}@ @\seebelow@
#define @\libglobal{SEEK_CUR}@ @\seebelow@
#define @\libglobal{SEEK_END}@ @\seebelow@
#define @\libglobal{SEEK_SET}@ @\seebelow@
#define @\libglobal{TMP_MAX}@ @\seebelow@
#define @\libglobal{stderr}@ @\seebelow@
#define @\libglobal{stdin}@ @\seebelow@
#define @\libglobal{stdout}@ @\seebelow@

namespace std {
int remove(const char* filename);
Expand Down Expand Up @@ -19015,28 +18999,6 @@
\indexlibraryglobal{SCNoFASTN}%
\indexlibraryglobal{SCNuFASTN}%
\indexlibraryglobal{SCNxFASTN}%
\indexlibraryglobal{PRIdMAX}%
\indexlibraryglobal{PRIiMAX}%
\indexlibraryglobal{PRIoMAX}%
\indexlibraryglobal{PRIuMAX}%
\indexlibraryglobal{PRIxMAX}%
\indexlibraryglobal{PRIXMAX}%
\indexlibraryglobal{SCNdMAX}%
\indexlibraryglobal{SCNiMAX}%
\indexlibraryglobal{SCNoMAX}%
\indexlibraryglobal{SCNuMAX}%
\indexlibraryglobal{SCNxMAX}%
\indexlibraryglobal{PRIdPTR}%
\indexlibraryglobal{PRIiPTR}%
\indexlibraryglobal{PRIoPTR}%
\indexlibraryglobal{PRIuPTR}%
\indexlibraryglobal{PRIxPTR}%
\indexlibraryglobal{PRIXPTR}%
\indexlibraryglobal{SCNdPTR}%
\indexlibraryglobal{SCNiPTR}%
\indexlibraryglobal{SCNoPTR}%
\indexlibraryglobal{SCNuPTR}%
\indexlibraryglobal{SCNxPTR}%
\begin{codeblock}
#include <cstdint> // see \ref{cstdint.syn}

Expand Down Expand Up @@ -19087,28 +19049,28 @@
#define SCNoFAST@\placeholdernc{N}@ @\seebelow@
#define SCNuFAST@\placeholdernc{N}@ @\seebelow@
#define SCNxFAST@\placeholdernc{N}@ @\seebelow@
#define PRIdMAX @\seebelow@
#define PRIiMAX @\seebelow@
#define PRIoMAX @\seebelow@
#define PRIuMAX @\seebelow@
#define PRIxMAX @\seebelow@
#define PRIXMAX @\seebelow@
#define SCNdMAX @\seebelow@
#define SCNiMAX @\seebelow@
#define SCNoMAX @\seebelow@
#define SCNuMAX @\seebelow@
#define SCNxMAX @\seebelow@
#define PRIdPTR @\seebelow@
#define PRIiPTR @\seebelow@
#define PRIoPTR @\seebelow@
#define PRIuPTR @\seebelow@
#define PRIxPTR @\seebelow@
#define PRIXPTR @\seebelow@
#define SCNdPTR @\seebelow@
#define SCNiPTR @\seebelow@
#define SCNoPTR @\seebelow@
#define SCNuPTR @\seebelow@
#define SCNxPTR @\seebelow@
#define @\libglobal{PRIdMAX}@ @\seebelow@
#define @\libglobal{PRIiMAX}@ @\seebelow@
#define @\libglobal{PRIoMAX}@ @\seebelow@
#define @\libglobal{PRIuMAX}@ @\seebelow@
#define @\libglobal{PRIxMAX}@ @\seebelow@
#define @\libglobal{PRIXMAX}@ @\seebelow@
#define @\libglobal{SCNdMAX}@ @\seebelow@
#define @\libglobal{SCNiMAX}@ @\seebelow@
#define @\libglobal{SCNoMAX}@ @\seebelow@
#define @\libglobal{SCNuMAX}@ @\seebelow@
#define @\libglobal{SCNxMAX}@ @\seebelow@
#define @\libglobal{PRIdPTR}@ @\seebelow@
#define @\libglobal{PRIiPTR}@ @\seebelow@
#define @\libglobal{PRIoPTR}@ @\seebelow@
#define @\libglobal{PRIuPTR}@ @\seebelow@
#define @\libglobal{PRIxPTR}@ @\seebelow@
#define @\libglobal{PRIXPTR}@ @\seebelow@
#define @\libglobal{SCNdPTR}@ @\seebelow@
#define @\libglobal{SCNiPTR}@ @\seebelow@
#define @\libglobal{SCNoPTR}@ @\seebelow@
#define @\libglobal{SCNuPTR}@ @\seebelow@
#define @\libglobal{SCNxPTR}@ @\seebelow@
\end{codeblock}

\pnum
Expand Down
89 changes: 30 additions & 59 deletions source/numerics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,20 @@
\indexlibraryglobal{feholdexcept}%
\indexlibraryglobal{fesetenv}%
\indexlibraryglobal{feupdateenv}%
\indexlibraryglobal{FE_ALL_EXCEPT}%
\indexlibraryglobal{FE_DIVBYZERO}%
\indexlibraryglobal{FE_INEXACT}%
\indexlibraryglobal{FE_INVALID}%
\indexlibraryglobal{FE_OVERFLOW}%
\indexlibraryglobal{FE_UNDERFLOW}%
\indexlibraryglobal{FE_DOWNWARD}%
\indexlibraryglobal{FE_TONEAREST}%
\indexlibraryglobal{FE_TOWARDZERO}%
\indexlibraryglobal{FE_UPWARD}%
\indexlibraryglobal{FE_DFL_ENV}%
\begin{codeblock}
#define FE_ALL_EXCEPT @\seebelow@
#define FE_DIVBYZERO @\seebelow@ // optional
#define FE_INEXACT @\seebelow@ // optional
#define FE_INVALID @\seebelow@ // optional
#define FE_OVERFLOW @\seebelow@ // optional
#define FE_UNDERFLOW @\seebelow@ // optional
#define @\libglobal{FE_ALL_EXCEPT}@ @\seebelow@
#define @\libglobal{FE_DIVBYZERO}@ @\seebelow@ // optional
#define @\libglobal{FE_INEXACT}@ @\seebelow@ // optional
#define @\libglobal{FE_INVALID}@ @\seebelow@ // optional
#define @\libglobal{FE_OVERFLOW}@ @\seebelow@ // optional
#define @\libglobal{FE_UNDERFLOW}@ @\seebelow@ // optional

#define FE_DOWNWARD @\seebelow@ // optional
#define FE_TONEAREST @\seebelow@ // optional
#define FE_TOWARDZERO @\seebelow@ // optional
#define FE_UPWARD @\seebelow@ // optional
#define @\libglobal{FE_DOWNWARD}@ @\seebelow@ // optional
#define @\libglobal{FE_TONEAREST}@ @\seebelow@ // optional
#define @\libglobal{FE_TOWARDZERO}@ @\seebelow@ // optional
#define @\libglobal{FE_UPWARD}@ @\seebelow@ // optional

#define FE_DFL_ENV @\seebelow@
#define @\libglobal{FE_DFL_ENV}@ @\seebelow@

namespace std {
// types
Expand Down Expand Up @@ -9128,23 +9117,6 @@
\rSec2[cmath.syn]{Header \tcode{<cmath>} synopsis}

\indexheader{cmath}%
\indexlibraryglobal{FP_FAST_FMA}%
\indexlibraryglobal{FP_FAST_FMAF}%
\indexlibraryglobal{FP_FAST_FMAL}%
\indexlibraryglobal{FP_ILOGB0}%
\indexlibraryglobal{FP_ILOGBNAN}%
\indexlibraryglobal{FP_INFINITE}%
\indexlibraryglobal{FP_NAN}%
\indexlibraryglobal{FP_NORMAL}%
\indexlibraryglobal{FP_SUBNORMAL}%
\indexlibraryglobal{FP_ZERO}%
\indexlibraryglobal{HUGE_VAL}%
\indexlibraryglobal{HUGE_VALF}%
\indexlibraryglobal{HUGE_VALL}%
\indexlibraryglobal{INFINITY}%
\indexlibraryglobal{MATH_ERREXCEPT}%
\indexlibraryglobal{MATH_ERRNO}%
\indexlibraryglobal{NAN}%
\indexlibraryglobal{abs}%
\indexlibraryglobal{acos}%
\indexlibraryglobal{acosf}%
Expand Down Expand Up @@ -9273,7 +9245,6 @@
\indexlibraryglobal{lround}%
\indexlibraryglobal{lroundf}%
\indexlibraryglobal{lroundl}%
\indexlibraryglobal{math_errhandling}%
\indexlibraryglobal{modf}%
\indexlibraryglobal{modff}%
\indexlibraryglobal{modfl}%
Expand Down Expand Up @@ -9338,25 +9309,25 @@
using double_t = @\seebelow@;
}

#define HUGE_VAL @\seebelow@
#define HUGE_VALF @\seebelow@
#define HUGE_VALL @\seebelow@
#define INFINITY @\seebelow@
#define NAN @\seebelow@
#define FP_INFINITE @\seebelow@
#define FP_NAN @\seebelow@
#define FP_NORMAL @\seebelow@
#define FP_SUBNORMAL @\seebelow@
#define FP_ZERO @\seebelow@
#define FP_FAST_FMA @\seebelow@
#define FP_FAST_FMAF @\seebelow@
#define FP_FAST_FMAL @\seebelow@
#define FP_ILOGB0 @\seebelow@
#define FP_ILOGBNAN @\seebelow@
#define MATH_ERRNO @\seebelow@
#define MATH_ERREXCEPT @\seebelow@

#define math_errhandling @\seebelow@
#define @\libglobal{HUGE_VAL}@ @\seebelow@
#define @\libglobal{HUGE_VALF}@ @\seebelow@
#define @\libglobal{HUGE_VALL}@ @\seebelow@
#define @\libglobal{INFINITY}@ @\seebelow@
#define @\libglobal{NAN}@ @\seebelow@
#define @\libglobal{FP_INFINITE}@ @\seebelow@
#define @\libglobal{FP_NAN}@ @\seebelow@
#define @\libglobal{FP_NORMAL}@ @\seebelow@
#define @\libglobal{FP_SUBNORMAL}@ @\seebelow@
#define @\libglobal{FP_ZERO}@ @\seebelow@
#define @\libglobal{FP_FAST_FMA}@ @\seebelow@
#define @\libglobal{FP_FAST_FMAF}@ @\seebelow@
#define @\libglobal{FP_FAST_FMAL}@ @\seebelow@
#define @\libglobal{FP_ILOGB0}@ @\seebelow@
#define @\libglobal{FP_ILOGBNAN}@ @\seebelow@
#define @\libglobal{MATH_ERRNO}@ @\seebelow@
#define @\libglobal{MATH_ERREXCEPT}@ @\seebelow@

#define @\libglobal{math_errhandling}@ @\seebelow@

namespace std {
constexpr @\placeholdernc{floating-point-type}@ acos(@\placeholdernc{floating-point-type}@ x);
Expand Down
2 changes: 1 addition & 1 deletion source/strings.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5500,7 +5500,7 @@
size_t strlen(const char* s); // freestanding
}

#define NULL @\textit{see \ref{support.types.nullptr}}@ // freestanding
#define @\libglobal{NULL}@ @\textit{see \ref{support.types.nullptr}}@ // freestanding
\end{codeblock}

\pnum
Expand Down
Loading

0 comments on commit 1dab1c5

Please sign in to comment.