From b411114a52d04fdd380094ff6e783dc0020e861f Mon Sep 17 00:00:00 2001 From: Refael Ackermann Date: Thu, 23 May 2019 12:02:15 -0400 Subject: [PATCH] deps: V8: use ATOMIC_VAR_INIT instead of std::atomic_init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `std::atomic_init` is not implemented in all platforms. * pragma to ignore `-Wbraced-scalar-init` Backport-PR-URL: https://github.com/nodejs/node/pull/28005 PR-URL: https://github.com/nodejs/node/pull/27375 Reviewed-By: Michaƫl Zasso Reviewed-By: Ujjwal Sharma Reviewed-By: Refael Ackermann Reviewed-By: Matteo Collina Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott --- common.gypi | 2 +- deps/v8/src/wasm/module-compiler.cc | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common.gypi b/common.gypi index cc7bfd2c9a2207..e4af01543a1562 100644 --- a/common.gypi +++ b/common.gypi @@ -38,7 +38,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.8', + 'v8_embedder_string': '-node.9', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/wasm/module-compiler.cc b/deps/v8/src/wasm/module-compiler.cc index 568f9eb0f80991..6f061e7b5da61a 100644 --- a/deps/v8/src/wasm/module-compiler.cc +++ b/deps/v8/src/wasm/module-compiler.cc @@ -131,7 +131,14 @@ class CompilationUnitQueues { queues_[task_id].next_steal_task_id_ = next_task_id(task_id); } for (auto& atomic_counter : num_units_) { - std::atomic_init(&atomic_counter, size_t{0}); +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wbraced-scalar-init" +#endif + atomic_counter = ATOMIC_VAR_INIT(0); +#ifdef __clang__ +#pragma clang diagnostic pop +#endif } }