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 f9abfc2

Browse files
bzoznodejs-ci
authored andcommittedSep 3, 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 ee1925c commit f9abfc2

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
@@ -7786,6 +7786,14 @@ Local<String> WasmCompiledModule::GetWasmWireBytes() {
77867786
return Local<String>::Cast(Utils::ToLocal(wire_bytes));
77877787
}
77887788

7789+
WasmCompiledModule::TransferrableModule&
7790+
WasmCompiledModule::TransferrableModule::operator=(
7791+
TransferrableModule&& src) {
7792+
compiled_code = std::move(src.compiled_code);
7793+
wire_bytes = std::move(src.wire_bytes);
7794+
return *this;
7795+
}
7796+
77897797
// Currently, wasm modules are bound, both to Isolate and to
77907798
// the Context they were created in. The currently-supported means to
77917799
// decontextualize and then re-contextualize a module is via
@@ -7957,6 +7965,13 @@ MaybeLocal<WasmCompiledModule> WasmModuleObjectBuilder::Finish() {
79577965
return WasmCompiledModule::Compile(isolate_, wire_bytes.get(), total_size_);
79587966
}
79597967

7968+
WasmModuleObjectBuilder&
7969+
WasmModuleObjectBuilder::operator=(WasmModuleObjectBuilder&& src) {
7970+
received_buffers_ = std::move(src.received_buffers_);
7971+
total_size_ = src.total_size_;
7972+
return *this;
7973+
}
7974+
79607975
// static
79617976
v8::ArrayBuffer::Allocator* v8::ArrayBuffer::Allocator::NewDefaultAllocator() {
79627977
return new ArrayBufferAllocator();

0 commit comments

Comments
 (0)
Please sign in to comment.