From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Fri, 29 Mar 2019 17:17:30 +0900
Subject: fix: do not define DebugOptions's constructors in header

The e3ca89ef49 changed NODE_EXTERN to always expose symbols for
DebugOptions, and since the constructors of DebugOptions are defined in
header, the compiler would end up generating no constructor
implementations for DebugOptions.

Which means we would encounter crash when constructors of DebugOptions
is called.

By putting the definitions of constructors into the implementation file,
we can avoid this problem.

diff --git a/src/node_options.cc b/src/node_options.cc
index 79e69a031dfc6331e0022b6354c909a36ae51c51..a85b650d2e75b5c7dd8018d9af76ac88d0d741aa 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -26,6 +26,12 @@ Mutex cli_options_mutex;
 std::shared_ptr<PerProcessOptions> cli_options{new PerProcessOptions()};
 }  // namespace per_process
 
+DebugOptions::DebugOptions() = default;
+DebugOptions::DebugOptions(const DebugOptions&) = default;
+DebugOptions::DebugOptions(DebugOptions&&) = default;
+DebugOptions& DebugOptions::operator=(const DebugOptions&) = default;
+DebugOptions& DebugOptions::operator=(DebugOptions&&) = default;
+
 void DebugOptions::CheckOptions(std::vector<std::string>* errors) {
 #if !NODE_USE_V8_PLATFORM
   if (inspector_enabled) {
diff --git a/src/node_options.h b/src/node_options.h
index ddc18552611724e7e995862964dff616b1b9b66d..c79b08ad09c183ad24faf864fb8ba4692b527c70 100644
--- a/src/node_options.h
+++ b/src/node_options.h
@@ -56,11 +56,11 @@ class Options {
 // per-Isolate, rather than per-Environment.
 class NODE_EXTERN DebugOptions : public Options {
  public:
-  DebugOptions() = default;
-  DebugOptions(const DebugOptions&) = default;
-  DebugOptions& operator=(const DebugOptions&) = default;
-  DebugOptions(DebugOptions&&) = default;
-  DebugOptions& operator=(DebugOptions&&) = default;
+  DebugOptions();
+  DebugOptions(const DebugOptions&);
+  DebugOptions& operator=(const DebugOptions&);
+  DebugOptions(DebugOptions&&);
+  DebugOptions& operator=(DebugOptions&&);
 
   // --inspect
   bool inspector_enabled = false;
