Skip to content

Commit 5982a7c

Browse files
AlisdairMtkoeppe
authored andcommitted
[atomics.syn][atomics.h.syn] Improve indexing for macros
1 parent 003506a commit 5982a7c

File tree

1 file changed

+37
-49
lines changed

1 file changed

+37
-49
lines changed

source/threads.tex

Lines changed: 37 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2405,17 +2405,17 @@
24052405
}
24062406

24072407
// \ref{atomics.lockfree}, lock-free property
2408-
#define ATOMIC_BOOL_LOCK_FREE @\unspecnc@ // freestanding
2409-
#define ATOMIC_CHAR_LOCK_FREE @\unspecnc@ // freestanding
2410-
#define ATOMIC_CHAR8_T_LOCK_FREE @\unspecnc@ // freestanding
2411-
#define ATOMIC_CHAR16_T_LOCK_FREE @\unspecnc@ // freestanding
2412-
#define ATOMIC_CHAR32_T_LOCK_FREE @\unspecnc@ // freestanding
2413-
#define ATOMIC_WCHAR_T_LOCK_FREE @\unspecnc@ // freestanding
2414-
#define ATOMIC_SHORT_LOCK_FREE @\unspecnc@ // freestanding
2415-
#define ATOMIC_INT_LOCK_FREE @\unspecnc@ // freestanding
2416-
#define ATOMIC_LONG_LOCK_FREE @\unspecnc@ // freestanding
2417-
#define ATOMIC_LLONG_LOCK_FREE @\unspecnc@ // freestanding
2418-
#define ATOMIC_POINTER_LOCK_FREE @\unspecnc@ // freestanding
2408+
#define @\libmacro{ATOMIC_BOOL_LOCK_FREE}@ @\unspecnc@ // freestanding
2409+
#define @\libmacro{ATOMIC_CHAR_LOCK_FREE}@ @\unspecnc@ // freestanding
2410+
#define @\libmacro{ATOMIC_CHAR8_T_LOCK_FREE}@ @\unspecnc@ // freestanding
2411+
#define @\libmacro{ATOMIC_CHAR16_T_LOCK_FREE}@ @\unspecnc@ // freestanding
2412+
#define @\libmacro{ATOMIC_CHAR32_T_LOCK_FREE}@ @\unspecnc@ // freestanding
2413+
#define @\libmacro{ATOMIC_WCHAR_T_LOCK_FREE}@ @\unspecnc@ // freestanding
2414+
#define @\libmacro{ATOMIC_SHORT_LOCK_FREE}@ @\unspecnc@ // freestanding
2415+
#define @\libmacro{ATOMIC_INT_LOCK_FREE}@ @\unspecnc@ // freestanding
2416+
#define @\libmacro{ATOMIC_LONG_LOCK_FREE}@ @\unspecnc@ // freestanding
2417+
#define @\libmacro{ATOMIC_LLONG_LOCK_FREE}@ @\unspecnc@ // freestanding
2418+
#define @\libmacro{ATOMIC_POINTER_LOCK_FREE}@ @\unspecnc@ // freestanding
24192419

24202420
namespace std {
24212421
// \ref{atomics.ref.generic}, class template \tcode{atomic_ref}
@@ -2709,7 +2709,7 @@
27092709
constexpr void atomic_flag_notify_one(atomic_flag*) noexcept; // freestanding
27102710
void atomic_flag_notify_all(volatile atomic_flag*) noexcept; // freestanding
27112711
constexpr void atomic_flag_notify_all(atomic_flag*) noexcept; // freestanding
2712-
#define ATOMIC_FLAG_INIT @\seebelownc@ // freestanding
2712+
#define @\libmacro{ATOMIC_FLAG_INIT}@ @\seebelownc@ // freestanding
27132713

27142714
// \ref{atomics.fences}, fences
27152715
extern "C" constexpr void atomic_thread_fence(memory_order) noexcept; // freestanding
@@ -3010,30 +3010,19 @@
30103010

30113011
\rSec2[atomics.lockfree]{Lock-free property}
30123012

3013-
\indexlibraryglobal{ATOMIC_BOOL_LOCK_FREE}%
3014-
\indexlibraryglobal{ATOMIC_CHAR_LOCK_FREE}%
3015-
\indexlibraryglobal{ATOMIC_CHAR8_T_LOCK_FREE}%
3016-
\indexlibraryglobal{ATOMIC_CHAR16_T_LOCK_FREE}%
3017-
\indexlibraryglobal{ATOMIC_CHAR32_T_LOCK_FREE}%
3018-
\indexlibraryglobal{ATOMIC_WCHAR_T_LOCK_FREE}%
3019-
\indexlibraryglobal{ATOMIC_SHORT_LOCK_FREE}%
3020-
\indexlibraryglobal{ATOMIC_INT_LOCK_FREE}%
3021-
\indexlibraryglobal{ATOMIC_LONG_LOCK_FREE}%
3022-
\indexlibraryglobal{ATOMIC_LLONG_LOCK_FREE}%
3023-
\indexlibraryglobal{ATOMIC_POINTER_LOCK_FREE}%
30243013
\indeximpldef{values of various \tcode{ATOMIC_..._LOCK_FREE} macros}
30253014
\begin{codeblock}
3026-
#define ATOMIC_BOOL_LOCK_FREE @\unspec@
3027-
#define ATOMIC_CHAR_LOCK_FREE @\unspec@
3028-
#define ATOMIC_CHAR8_T_LOCK_FREE @\unspec@
3029-
#define ATOMIC_CHAR16_T_LOCK_FREE @\unspec@
3030-
#define ATOMIC_CHAR32_T_LOCK_FREE @\unspec@
3031-
#define ATOMIC_WCHAR_T_LOCK_FREE @\unspec@
3032-
#define ATOMIC_SHORT_LOCK_FREE @\unspec@
3033-
#define ATOMIC_INT_LOCK_FREE @\unspec@
3034-
#define ATOMIC_LONG_LOCK_FREE @\unspec@
3035-
#define ATOMIC_LLONG_LOCK_FREE @\unspec@
3036-
#define ATOMIC_POINTER_LOCK_FREE @\unspec@
3015+
#define @\libmacro{ATOMIC_BOOL_LOCK_FREE}@ @\unspec@
3016+
#define @\libmacro{ATOMIC_CHAR_LOCK_FREE}@ @\unspec@
3017+
#define @\libmacro{ATOMIC_CHAR8_T_LOCK_FREE}@ @\unspec@
3018+
#define @\libmacro{ATOMIC_CHAR16_T_LOCK_FREE}@ @\unspec@
3019+
#define @\libmacro{ATOMIC_CHAR32_T_LOCK_FREE}@ @\unspec@
3020+
#define @\libmacro{ATOMIC_WCHAR_T_LOCK_FREE}@ @\unspec@
3021+
#define @\libmacro{ATOMIC_SHORT_LOCK_FREE}@ @\unspec@
3022+
#define @\libmacro{ATOMIC_INT_LOCK_FREE}@ @\unspec@
3023+
#define @\libmacro{ATOMIC_LONG_LOCK_FREE}@ @\unspec@
3024+
#define @\libmacro{ATOMIC_LLONG_LOCK_FREE}@ @\unspec@
3025+
#define @\libmacro{ATOMIC_POINTER_LOCK_FREE}@ @\unspec@
30373026
\end{codeblock}
30383027

30393028
\pnum
@@ -6326,9 +6315,8 @@
63266315
This function is an atomic notifying operation\iref{atomics.wait}.
63276316
\end{itemdescr}
63286317

6329-
\indexlibraryglobal{ATOMIC_FLAG_INIT}%
63306318
\begin{itemdecl}
6331-
#define ATOMIC_FLAG_INIT @\seebelow@
6319+
#define @\libmacro{ATOMIC_FLAG_INIT}@ @\seebelow@
63326320
\end{itemdecl}
63336321

63346322
\begin{itemdescr}
@@ -6429,18 +6417,18 @@
64296417
template<class T>
64306418
using @\exposid{std-atomic}@ = std::atomic<T>; // \expos
64316419

6432-
#define _Atomic(T) @\exposid{std-atomic}@<T>
6420+
#define @\libmacro{_Atomic}@(T) @\exposid{std-atomic}@<T>
64336421

6434-
#define ATOMIC_BOOL_LOCK_FREE @\seebelow@
6435-
#define ATOMIC_CHAR_LOCK_FREE @\seebelow@
6436-
#define ATOMIC_CHAR16_T_LOCK_FREE @\seebelow@
6437-
#define ATOMIC_CHAR32_T_LOCK_FREE @\seebelow@
6438-
#define ATOMIC_WCHAR_T_LOCK_FREE @\seebelow@
6439-
#define ATOMIC_SHORT_LOCK_FREE @\seebelow@
6440-
#define ATOMIC_INT_LOCK_FREE @\seebelow@
6441-
#define ATOMIC_LONG_LOCK_FREE @\seebelow@
6442-
#define ATOMIC_LLONG_LOCK_FREE @\seebelow@
6443-
#define ATOMIC_POINTER_LOCK_FREE @\seebelow@
6422+
#define @\libmacro{ATOMIC_BOOL_LOCK_FREE}@ @\seebelow@
6423+
#define @\libmacro{ATOMIC_CHAR_LOCK_FREE}@ @\seebelow@
6424+
#define @\libmacro{ATOMIC_CHAR16_T_LOCK_FREE}@ @\seebelow@
6425+
#define @\libmacro{ATOMIC_CHAR32_T_LOCK_FREE}@ @\seebelow@
6426+
#define @\libmacro{ATOMIC_WCHAR_T_LOCK_FREE}@ @\seebelow@
6427+
#define @\libmacro{ATOMIC_SHORT_LOCK_FREE}@ @\seebelow@
6428+
#define @\libmacro{ATOMIC_INT_LOCK_FREE}@ @\seebelow@
6429+
#define @\libmacro{ATOMIC_LONG_LOCK_FREE}@ @\seebelow@
6430+
#define @\libmacro{ATOMIC_LLONG_LOCK_FREE}@ @\seebelow@
6431+
#define @\libmacro{ATOMIC_POINTER_LOCK_FREE}@ @\seebelow@
64446432

64456433
using std::@\libglobal{memory_order}@; // \seebelow
64466434
using std::@\libglobal{memory_order_relaxed}@; // \seebelow
@@ -6524,7 +6512,7 @@
65246512
using std::@\libglobal{atomic_flag_test_and_set_explicit}@; // \seebelow
65256513
using std::@\libglobal{atomic_flag_clear}@; // \seebelow
65266514
using std::@\libglobal{atomic_flag_clear_explicit}@; // \seebelow
6527-
#define ATOMIC_FLAG_INIT @\seebelow@
6515+
#define @\libmacro{ATOMIC_FLAG_INIT}@ @\seebelow@
65286516

65296517
using std::@\libglobal{atomic_thread_fence}@; // \seebelow
65306518
using std::@\libglobal{atomic_signal_fence}@; // \seebelow
@@ -6534,7 +6522,7 @@
65346522
Each \grammarterm{using-declaration} for some name $A$ in the synopsis above
65356523
makes available the same entity as \tcode{std::$A$}
65366524
declared in \libheaderrefx{atomic}{atomics.syn}.
6537-
Each macro listed above other than \tcode{_Atomic(T)}
6525+
Each macro listed above other than \tcode{\libmacro{_Atomic}(T)}
65386526
is defined as in \libheader{atomic}.
65396527
It is unspecified whether \libheader{stdatomic.h} makes available
65406528
any declarations in namespace \tcode{std}.

0 commit comments

Comments
 (0)