Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4c1a0b5

Browse files
bzoznodejs-ci
authored andcommittedSep 11, 2017
deps: fix addons compilation with VS2013
VS2013 does not support defaulting move constructor and assignment operator. This adds explicit definitions of those methods for two classes. This fix is required because we still support building addons with VS2013 and the incompatibility is in v8.h. Fixes: #4 PR-URL: nodejs/node#13263 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Myles Borins <[email protected]>
1 parent 174e876 commit 4c1a0b5

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed
 

‎deps/v8/include/v8.h

+8-4
Original file line numberDiff line numberDiff line change
@@ -4166,10 +4166,12 @@ class V8_EXPORT WasmCompiledModule : public Object {
41664166
// supports move semantics, and does not support copy semantics.
41674167
class TransferrableModule final {
41684168
public:
4169-
TransferrableModule(TransferrableModule&& src) = default;
4169+
TransferrableModule(TransferrableModule&& src)
4170+
: compiled_code(std::move(src.compiled_code)),
4171+
wire_bytes(std::move(src.wire_bytes)) {}
41704172
TransferrableModule(const TransferrableModule& src) = delete;
41714173

4172-
TransferrableModule& operator=(TransferrableModule&& src) = default;
4174+
TransferrableModule& operator=(TransferrableModule&& src);
41734175
TransferrableModule& operator=(const TransferrableModule& src) = delete;
41744176

41754177
private:
@@ -4282,9 +4284,11 @@ class V8_EXPORT WasmModuleObjectBuilder final {
42824284
// Disable copy semantics *in this implementation*. We can choose to
42834285
// relax this, albeit it's not clear why.
42844286
WasmModuleObjectBuilder(const WasmModuleObjectBuilder&) = delete;
4285-
WasmModuleObjectBuilder(WasmModuleObjectBuilder&&) = default;
4287+
WasmModuleObjectBuilder(WasmModuleObjectBuilder&& src)
4288+
: received_buffers_(std::move(src.received_buffers_)),
4289+
total_size_(src.total_size_) {}
42864290
WasmModuleObjectBuilder& operator=(const WasmModuleObjectBuilder&) = delete;
4287-
WasmModuleObjectBuilder& operator=(WasmModuleObjectBuilder&&) = default;
4291+
WasmModuleObjectBuilder& operator=(WasmModuleObjectBuilder&&);
42884292

42894293
std::vector<Buffer> received_buffers_;
42904294
size_t total_size_ = 0;

‎deps/v8/src/api.cc

+15
Original file line numberDiff line numberDiff line change
@@ -7819,6 +7819,14 @@ Local<String> WasmCompiledModule::GetWasmWireBytes() {
78197819
return Local<String>::Cast(Utils::ToLocal(wire_bytes));
78207820
}
78217821

7822+
WasmCompiledModule::TransferrableModule&
7823+
WasmCompiledModule::TransferrableModule::operator=(
7824+
TransferrableModule&& src) {
7825+
compiled_code = std::move(src.compiled_code);
7826+
wire_bytes = std::move(src.wire_bytes);
7827+
return *this;
7828+
}
7829+
78227830
// Currently, wasm modules are bound, both to Isolate and to
78237831
// the Context they were created in. The currently-supported means to
78247832
// decontextualize and then re-contextualize a module is via
@@ -7990,6 +7998,13 @@ MaybeLocal<WasmCompiledModule> WasmModuleObjectBuilder::Finish() {
79907998
return WasmCompiledModule::Compile(isolate_, wire_bytes.get(), total_size_);
79917999
}
79928000

8001+
WasmModuleObjectBuilder&
8002+
WasmModuleObjectBuilder::operator=(WasmModuleObjectBuilder&& src) {
8003+
received_buffers_ = std::move(src.received_buffers_);
8004+
total_size_ = src.total_size_;
8005+
return *this;
8006+
}
8007+
79938008
// static
79948009
v8::ArrayBuffer::Allocator* v8::ArrayBuffer::Allocator::NewDefaultAllocator() {
79958010
return new ArrayBufferAllocator();

0 commit comments

Comments
 (0)
Please sign in to comment.