git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
C++: address -Wweak-vtable warnings and remove runtime_error alias
480f30fAndy Arvanitis
pcc/runtime/purescript.cc+3
@@ -17,6 +17,9 @@
17
17
18namespace PureScript {
18namespace PureScript {
19
19
20+any::closure::~closure() {}
21+any::eff_closure::~eff_closure() {}
22+
20#define RETURN_VALUE(TAG, ACCESSOR, INDIRECTION) \
23#define RETURN_VALUE(TAG, ACCESSOR, INDIRECTION) \
21 const any& variant = unthunkVariant(*this); \
24 const any& variant = unthunkVariant(*this); \
22 assert(variant.tag == TAG); \
25 assert(variant.tag == TAG); \
pcc/runtime/purescript.hh+3−8
@@ -45,6 +45,7 @@ namespace PureScript {
45
45
46using cstring = const char *;
46using cstring = const char *;
47using std::nullptr_t;
47using std::nullptr_t;
48+using std::runtime_error;
48
49
49namespace Private {
50namespace Private {
50 struct symbol_generator_anchor_t {};
51 struct symbol_generator_anchor_t {};
@@ -68,12 +69,6 @@ using symbol_t = const Private::symbol_generator_anchor_t *;
68 }
69 }
69#define symbol(S) (&Private::symbol_generator<::PureScript::Private::Symbol::S_ ## S>::anchor)
70#define symbol(S) (&Private::symbol_generator<::PureScript::Private::Symbol::S_ ## S>::anchor)
70
71
71−// Workaround for missing C++11 version in gcc
72−class runtime_error : public std::runtime_error {
73−public:
74− runtime_error(const char message[]) : std::runtime_error(std::string(message)) {}
75−};
76−
77constexpr bool undefined = false;
72constexpr bool undefined = false;
78
73
79// Not a real limit, just used for simpler accessors
74// Not a real limit, just used for simpler accessors
@@ -128,7 +123,7 @@ class any {
128 class closure {
123 class closure {
129 public:
124 public:
130 virtual auto operator()(const any&) const -> any = 0;
125 virtual auto operator()(const any&) const -> any = 0;
131− virtual ~closure() {}
126+ virtual ~closure();
132 };
127 };
133
128
134 template <typename T>
129 template <typename T>
@@ -144,7 +139,7 @@ class any {
144 class eff_closure {
139 class eff_closure {
145 public:
140 public:
146 virtual auto operator()() const -> any = 0;
141 virtual auto operator()() const -> any = 0;
147− virtual ~eff_closure() {}
142+ virtual ~eff_closure();
148 };
143 };
149
144
150 template <typename T>
145 template <typename T>