summaryrefslogtreecommitdiff
path: root/src/sexpr/variant.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sexpr/variant.hpp')
-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))