Skip to content

Commit 7577e23

Browse files
committed
Fix registered keyword within appleclang 16
1 parent b2e7d16 commit 7577e23

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

3rdparty/stop_token.hpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ inline void __spin_yield() noexcept {
2626
// internal types for shared stop state
2727
//-----------------------------------------------
2828

29-
struct __stop_callback_base {
30-
void(*__callback_)(__stop_callback_base*) = nullptr;
29+
struct ___stop_callback_base {
30+
void(*__callback_)(___stop_callback_base*) = nullptr;
3131

32-
__stop_callback_base* __next_ = nullptr;
33-
__stop_callback_base** __prev_ = nullptr;
32+
___stop_callback_base* __next_ = nullptr;
33+
___stop_callback_base** __prev_ = nullptr;
3434
bool* __isRemoved_ = nullptr;
3535
std::atomic<bool> __callbackFinishedExecuting_{false};
3636

@@ -41,10 +41,10 @@ struct __stop_callback_base {
4141
protected:
4242
// it shall only by us who deletes this
4343
// (workaround for virtual __execute() and destructor)
44-
~__stop_callback_base() = default;
44+
~___stop_callback_base() = default;
4545
};
4646

47-
struct __stop_state {
47+
struct ___stop_state {
4848
public:
4949
void __add_token_reference() noexcept {
5050
__state_.fetch_add(__token_ref_increment, std::memory_order_relaxed);
@@ -139,7 +139,7 @@ struct __stop_state {
139139
}
140140

141141
bool __try_add_callback(
142-
__stop_callback_base* __cb,
142+
___stop_callback_base* __cb,
143143
bool __incrementRefCountIfSuccessful) noexcept {
144144
std::uint64_t __oldState;
145145
goto __load_state;
@@ -178,7 +178,7 @@ struct __stop_state {
178178
return true;
179179
}
180180

181-
void __remove_callback(__stop_callback_base* __cb) noexcept {
181+
void __remove_callback(___stop_callback_base* __cb) noexcept {
182182
__lock();
183183

184184
if (__cb->__prev_ != nullptr) {
@@ -299,7 +299,7 @@ struct __stop_state {
299299
// bits 2-32 - token ref count (31 bits)
300300
// bits 33-63 - source ref count (31 bits)
301301
std::atomic<std::uint64_t> __state_{__source_ref_increment};
302-
__stop_callback_base* __head_ = nullptr;
302+
___stop_callback_base* __head_ = nullptr;
303303
std::thread::id __signallingThread_{};
304304
};
305305

@@ -391,13 +391,13 @@ class stop_token {
391391
template <typename _Callback>
392392
friend class stop_callback;
393393

394-
explicit stop_token(__stop_state* __state) noexcept : __state_(__state) {
394+
explicit stop_token(___stop_state* __state) noexcept : __state_(__state) {
395395
if (__state_ != nullptr) {
396396
__state_->__add_token_reference();
397397
}
398398
}
399399

400-
__stop_state* __state_;
400+
___stop_state* __state_;
401401
};
402402

403403

@@ -407,7 +407,7 @@ class stop_token {
407407

408408
class stop_source {
409409
public:
410-
stop_source() : __state_(new __stop_state()) {}
410+
stop_source() : __state_(new ___stop_state()) {}
411411

412412
explicit stop_source(nostopstate_t) noexcept : __state_(nullptr) {}
413413

@@ -476,7 +476,7 @@ class stop_source {
476476
}
477477

478478
private:
479-
__stop_state* __state_;
479+
___stop_state* __state_;
480480
};
481481

482482

@@ -486,7 +486,7 @@ class stop_source {
486486

487487
template <typename _Callback>
488488
// requires Destructible<_Callback> && Invocable<_Callback>
489-
class [[nodiscard]] stop_callback : private __stop_callback_base {
489+
class [[nodiscard]] stop_callback : private ___stop_callback_base {
490490
public:
491491
using callback_type = _Callback;
492492

@@ -513,7 +513,7 @@ class [[nodiscard]] stop_callback : private __stop_callback_base {
513513
// requires Constructible<Callback, C>
514514
explicit stop_callback(stop_token&& __token, _CB&& __cb) noexcept(
515515
std::is_nothrow_constructible_v<_Callback, _CB>)
516-
: __stop_callback_base{[](__stop_callback_base *__that) noexcept {
516+
: ___stop_callback_base{[](___stop_callback_base *__that) noexcept {
517517
static_cast<stop_callback*>(__that)->__execute();
518518
}},
519519
__state_(nullptr),

0 commit comments

Comments
 (0)