git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge remote-tracking branch 'pure11/pure11' into native
commit1a79a34e87a6ac3c19ba36db9dd21366fb77627f authorAndy Arvanitis <andyarvanitis@gmail.com> dateThu 22 Dec 2016, 18:40 (10 years ago) parent695865a8698eaa
4 files changed+11−11
pcc/runtime/purescript.cc+3 pcc/runtime/purescript.hh+3−8 pcc/support/Makefile+1−1 src/Language/PureScript/Pretty/Cpp.hs+4−2
pcc/runtime/purescript.cc+3
@@ -17,6 +17,9 @@
1717
1818namespace PureScript {
1919
20+any::closure::~closure() {}
21+any::eff_closure::~eff_closure() {}
22+
2023#define RETURN_VALUE(TAG, ACCESSOR, INDIRECTION) \
2124 const any& variant = unthunkVariant(*this); \
2225 assert(variant.tag == TAG); \
pcc/runtime/purescript.hh+3−8
@@ -45,6 +45,7 @@ namespace PureScript {
4545
4646using cstring = const char *;
4747using std::nullptr_t;
48+using std::runtime_error;
4849
4950namespace Private {
5051 struct symbol_generator_anchor_t {};
@@ -68,12 +69,6 @@ using symbol_t = const Private::symbol_generator_anchor_t *;
6869 }
6970#define symbol(S) (&Private::symbol_generator<::PureScript::Private::Symbol::S_ ## S>::anchor)
7071
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−
7772constexpr bool undefined = false;
7873
7974// Not a real limit, just used for simpler accessors
@@ -128,7 +123,7 @@ class any {
128123 class closure {
129124 public:
130125 virtual auto operator()(const any&) const -> any = 0;
131− virtual ~closure() {}
126+ virtual ~closure();
132127 };
133128
134129 template <typename T>
@@ -144,7 +139,7 @@ class any {
144139 class eff_closure {
145140 public:
146141 virtual auto operator()() const -> any = 0;
147− virtual ~eff_closure() {}
142+ virtual ~eff_closure();
148143 };
149144
150145 template <typename T>
pcc/support/Makefile+1−1
@@ -41,7 +41,7 @@ ifeq ("$(wildcard $(PSC_PACKAGE))","")
4141 PSC_PACKAGE := $(PSC_PKG_BIN)
4242endif
4343
44−PACKAGE_SOURCES = $(shell $(PSC_PACKAGE) sources)
44+PACKAGE_SOURCES = $(subst \,/,$(shell $(PSC_PACKAGE) sources))
4545PURESCRIPT_PKGS := $(firstword $(subst /, ,$(PACKAGE_SOURCES)))
4646
4747## Not all environments support globstar (** dir pattern)
src/Language/PureScript/Pretty/Cpp.hs+4−2
@@ -106,16 +106,18 @@ literals = mkPattern' match
106106 , return $ T.intercalate ", " es
107107 , return " }"
108108 ]
109+ match (CppMapLiteral Record []) = return "nullptr"
109110 match (CppMapLiteral _ ps) = mconcat <$> sequence
110111 [ return $ runType (mapType $ length ps + 1) <> "{{\n"
111112 , withIndent $ do
113+ let ps' = ps ++ [(CppVar "nullptr", CppVar "nullptr")]
112114 cpps <-
113− forM ps $ \(key, value) -> do
115+ forM ps' $ \(key, value) -> do
114116 value' <- prettyPrintCpp' value
115117 key' <- prettyPrintCpp' key
116118 return $ "{ " <> key' <> ", " <> value' <> " }"
117119 indentString <- currentIndent
118− return $ T.intercalate ", \n" $ map (indentString <>) (cpps ++ ["{ nullptr, nullptr }"])
120+ return $ T.intercalate ", \n" $ map (indentString <>) cpps
119121 , return "\n"
120122 , currentIndent
121123 , return "}}"