Browse Source

Merge pull request #965 from ShawnZhong:cpp20

PiperOrigin-RevId: 420504266
naive_version
Victor Costan 2 years ago
parent
commit
e4ccaa0c9c
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      util/env_posix.cc
  2. +2
    -2
      util/env_windows.cc

+ 2
- 2
util/env_posix.cc View File

@ -870,7 +870,7 @@ class SingletonEnv {
public: public:
SingletonEnv() { SingletonEnv() {
#if !defined(NDEBUG) #if !defined(NDEBUG)
env_initialized_.store(true, std::memory_order::memory_order_relaxed);
env_initialized_.store(true, std::memory_order_relaxed);
#endif // !defined(NDEBUG) #endif // !defined(NDEBUG)
static_assert(sizeof(env_storage_) >= sizeof(EnvType), static_assert(sizeof(env_storage_) >= sizeof(EnvType),
"env_storage_ will not fit the Env"); "env_storage_ will not fit the Env");
@ -887,7 +887,7 @@ class SingletonEnv {
static void AssertEnvNotInitialized() { static void AssertEnvNotInitialized() {
#if !defined(NDEBUG) #if !defined(NDEBUG)
assert(!env_initialized_.load(std::memory_order::memory_order_relaxed));
assert(!env_initialized_.load(std::memory_order_relaxed));
#endif // !defined(NDEBUG) #endif // !defined(NDEBUG)
} }

+ 2
- 2
util/env_windows.cc View File

@ -765,7 +765,7 @@ class SingletonEnv {
public: public:
SingletonEnv() { SingletonEnv() {
#if !defined(NDEBUG) #if !defined(NDEBUG)
env_initialized_.store(true, std::memory_order::memory_order_relaxed);
env_initialized_.store(true, std::memory_order_relaxed);
#endif // !defined(NDEBUG) #endif // !defined(NDEBUG)
static_assert(sizeof(env_storage_) >= sizeof(EnvType), static_assert(sizeof(env_storage_) >= sizeof(EnvType),
"env_storage_ will not fit the Env"); "env_storage_ will not fit the Env");
@ -782,7 +782,7 @@ class SingletonEnv {
static void AssertEnvNotInitialized() { static void AssertEnvNotInitialized() {
#if !defined(NDEBUG) #if !defined(NDEBUG)
assert(!env_initialized_.load(std::memory_order::memory_order_relaxed));
assert(!env_initialized_.load(std::memory_order_relaxed));
#endif // !defined(NDEBUG) #endif // !defined(NDEBUG)
} }

Loading…
Cancel
Save