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 f4dc3d7df5a33ce92ca52e901283db5aa9f143b4..b9d6108c5db800465e6c7156ad1c28002c33261b 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 5fb23cfda7aebca507174555b78c9a73e837dda0..ce86827024126c6b0d8462c811360057c298ec5b 100644
--- a/src/node_options.h
+++ b/src/node_options.h
@@ -61,11 +61,11 @@ struct InspectPublishUid {
 // 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;
