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 91c24ca

Browse files
bzoznodejs-ci
authored andcommittedSep 4, 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 32963b2 commit 91c24ca

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
@@ -4161,10 +4161,12 @@ class V8_EXPORT WasmCompiledModule : public Object {
41614161
// supports move semantics, and does not support copy semantics.
41624162
class TransferrableModule final {
41634163
public:
4164-
TransferrableModule(TransferrableModule&& src) = default;
4164+
TransferrableModule(TransferrableModule&& src)
4165+
: compiled_code(std::move(src.compiled_code)),
4166+
wire_bytes(std::move(src.wire_bytes)) {}
41654167
TransferrableModule(const TransferrableModule& src) = delete;
41664168

4167-
TransferrableModule& operator=(TransferrableModule&& src) = default;
4169+
TransferrableModule& operator=(TransferrableModule&& src);
41684170
TransferrableModule& operator=(const TransferrableModule& src) = delete;
41694171

41704172
private:
@@ -4277,9 +4279,11 @@ class V8_EXPORT WasmModuleObjectBuilder final {
42774279
// Disable copy semantics *in this implementation*. We can choose to
42784280
// relax this, albeit it's not clear why.
42794281
WasmModuleObjectBuilder(const WasmModuleObjectBuilder&) = delete;
4280-
WasmModuleObjectBuilder(WasmModuleObjectBuilder&&) = default;
4282+
WasmModuleObjectBuilder(WasmModuleObjectBuilder&& src)
4283+
: received_buffers_(std::move(src.received_buffers_)),
4284+
total_size_(src.total_size_) {}
42814285
WasmModuleObjectBuilder& operator=(const WasmModuleObjectBuilder&) = delete;
4282-
WasmModuleObjectBuilder& operator=(WasmModuleObjectBuilder&&) = default;
4286+
WasmModuleObjectBuilder& operator=(WasmModuleObjectBuilder&&);
42834287

42844288
std::vector<Buffer> received_buffers_;
42854289
size_t total_size_ = 0;

‎deps/v8/src/api.cc

+15
Original file line numberDiff line numberDiff line change
@@ -7806,6 +7806,14 @@ Local<String> WasmCompiledModule::GetWasmWireBytes() {
78067806
return Local<String>::Cast(Utils::ToLocal(wire_bytes));
78077807
}
78087808

7809+
WasmCompiledModule::TransferrableModule&
7810+
WasmCompiledModule::TransferrableModule::operator=(
7811+
TransferrableModule&& src) {
7812+
compiled_code = std::move(src.compiled_code);
7813+
wire_bytes = std::move(src.wire_bytes);
7814+
return *this;
7815+
}
7816+
78097817
// Currently, wasm modules are bound, both to Isolate and to
78107818
// the Context they were created in. The currently-supported means to
78117819
// decontextualize and then re-contextualize a module is via
@@ -7977,6 +7985,13 @@ MaybeLocal<WasmCompiledModule> WasmModuleObjectBuilder::Finish() {
79777985
return WasmCompiledModule::Compile(isolate_, wire_bytes.get(), total_size_);
79787986
}
79797987

7988+
WasmModuleObjectBuilder&
7989+
WasmModuleObjectBuilder::operator=(WasmModuleObjectBuilder&& src) {
7990+
received_buffers_ = std::move(src.received_buffers_);
7991+
total_size_ = src.total_size_;
7992+
return *this;
7993+
}
7994+
79807995
// static
79817996
v8::ArrayBuffer::Allocator* v8::ArrayBuffer::Allocator::NewDefaultAllocator() {
79827997
return new ArrayBufferAllocator();

0 commit comments

Comments
 (0)
Please sign in to comment.