git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
C++: minor changes to for MS Visual Studio
commit7f8c2d86f4cc506dcf482828a6be2d23a0ba6f27 authorAndy Arvanitis <andyarvanitis@gmail.com> dateTue 12 Apr 2016, 20:17 (11 years ago) parentb64dad8
1 file changed+13
pcc/include/purescript.hh+13
pcc/include/purescript.hh+13
@@ -32,6 +32,7 @@
3232#include <deque>
3333#include <utility>
3434#include <stdexcept>
35+#include <iso646.h> // mostly for MS Visual Studio compiler
3536
3637#define DECLARE_OPERATOR(op, ty, rty) \
3738 friend auto operator op (const any&, ty) -> rty; \
@@ -328,6 +329,10 @@ class any {
328329 DECLARE_COMPARISON_OPERATOR(>)
329330 DECLARE_COMPARISON_OPERATOR(>=)
330331
332+ // For MS Visual Studio compiler: broken typed-enum workaround
333+ DECLARE_OPERATOR(==, int, bool)
334+ DECLARE_OPERATOR(!=, int, bool)
335+
331336 friend auto operator+(const any&, const any&) -> any;
332337
333338 DECLARE_OPERATOR(+, long, long)
@@ -361,6 +366,14 @@ class any {
361366 friend auto operator-(const any&) -> any; // unary negate
362367};
363368
369+// For MS Visual Studio compiler: broken typed-enum workaround
370+inline auto operator==(const any& lhs, int rhs) -> bool {
371+ return lhs == (long)rhs;
372+}
373+inline auto operator!=(const any& lhs, int rhs) -> bool {
374+ return lhs != (long)rhs;
375+}
376+
364377} // namespace PureScript
365378
366379#undef DECLARE_OPERATOR