Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
fix: export DebugOptions parser in a cross-platform-compatible way
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon committed Sep 20, 2018
1 parent fd1a701 commit de6c741
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ component("node_lib") {
defines = [
"NODE_WANT_INTERNALS=1",
"NODE_WITHOUT_NODE_OPTIONS",
"NODE_IMPLEMENTATION",
]

if (is_component_build) {
Expand Down
4 changes: 4 additions & 0 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
# define NODE_EXTERN __declspec(dllimport)
# endif
#else
#if defined(NODE_IMPLEMENTATION)
# define NODE_EXTERN __attribute__((visibility("default")))
#else
# define NODE_EXTERN
#endif
#endif

#ifdef BUILDING_NODE_EXTENSION
Expand Down
2 changes: 1 addition & 1 deletion src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace options_parser {
// doc/api/cli.md
// TODO(addaleax): Make that unnecessary.

template class OptionsParser<DebugOptions>;
template class EXPORT_TEMPLATE_DEFINE(NODE_EXTERN) OptionsParser<DebugOptions>;

DebugOptionsParser::DebugOptionsParser() {
#if HAVE_INSPECTOR
Expand Down
3 changes: 2 additions & 1 deletion src/node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <vector>
#include <unordered_map>
#include <memory>
#include "base/export_template.h"
#include "node_constants.h"

namespace node {
Expand Down Expand Up @@ -340,7 +341,7 @@ class OptionsParser {
friend void GetOptions(const v8::FunctionCallbackInfo<v8::Value>& args);
};

extern template class OptionsParser<DebugOptions>;
extern template class EXPORT_TEMPLATE_DECLARE(NODE_EXTERN) OptionsParser<DebugOptions>;

class NODE_EXTERN DebugOptionsParser : public OptionsParser<DebugOptions> {
public:
Expand Down

0 comments on commit de6c741

Please # to comment.