summaryrefslogtreecommitdiff
path: root/src/sexpr
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-10-09 19:54:23 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-10-13 13:20:28 -0700
commita5e0fe8204a8b3299507a645f3479e9ead6c6110 (patch)
treefdb6b0afd0ea0138dd4f7f8f671c23bf6bb4f2eb /src/sexpr
parent0d9f2d217265e826a4843b3873824216344f1b24 (diff)
downloadtmwa-a5e0fe8204a8b3299507a645f3479e9ead6c6110.tar.gz
tmwa-a5e0fe8204a8b3299507a645f3479e9ead6c6110.tar.bz2
tmwa-a5e0fe8204a8b3299507a645f3479e9ead6c6110.tar.xz
tmwa-a5e0fe8204a8b3299507a645f3479e9ead6c6110.zip
Add OPTION_IS_SOME branching macro
Diffstat (limited to 'src/sexpr')
-rw-r--r--src/sexpr/variant.hpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/sexpr/variant.hpp b/src/sexpr/variant.hpp
index fbf9345..ecf0237 100644
--- a/src/sexpr/variant.hpp
+++ b/src/sexpr/variant.hpp
@@ -23,6 +23,8 @@
#include <cstddef>
#include <utility>
+#include "../compat/attr.hpp"
+
#include "union.hpp"
#include "void.hpp"
@@ -33,11 +35,6 @@ namespace tmwa
{
namespace sexpr
{
-#define JOIN(a, b) a##b
-
-#define WITH_VAR(ty, var, expr) \
- for (bool JOIN(var, _guard) = true; JOIN(var, _guard); ) \
- for (ty var = expr; JOIN(var, _guard); JOIN(var, _guard) = false)
#define MATCH(expr) \
WITH_VAR(auto&&, _match_var, expr) \
switch (tmwa::sexpr::VariantFriend::get_state(_match_var))