Skip to content

Commit

Permalink
fix C++20 compliance with application of upstream PR 965
Browse files Browse the repository at this point in the history
These symbols are no longer valid on macOS and will fail builds if the `NDEBUG` symbol is defined, as it is now in default build settings for all react-native projects since release of react-native 0.76

This same change was applied upstream but never released, and it appears it has not been applied here

google#965 (comment)
  • Loading branch information
mikehardy authored Oct 26, 2024
1 parent 2cc3364 commit dc346eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/env_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ class SingletonEnv {
public:
SingletonEnv() {
#if !defined(NDEBUG)
env_initialized_.store(true, std::memory_order::memory_order_relaxed);
env_initialized_.store(true, std::memory_order_relaxed);
#endif // !defined(NDEBUG)
static_assert(sizeof(env_storage_) >= sizeof(EnvType),
"env_storage_ will not fit the Env");
Expand All @@ -854,7 +854,7 @@ class SingletonEnv {

static void AssertEnvNotInitialized() {
#if !defined(NDEBUG)
assert(!env_initialized_.load(std::memory_order::memory_order_relaxed));
assert(!env_initialized_.load(std::memory_order_relaxed));
#endif // !defined(NDEBUG)
}

Expand Down

0 comments on commit dc346eb

Please sign in to comment.