summaryrefslogtreecommitdiffhomepage
path: root/compat/macros.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-18 12:28:25 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-18 12:34:58 +0100
commit364c1ecd8703dadaaa9c7479335e469b153a1be0 (patch)
treea2ba1f508c5007857d865cc06bb696de0e398038 /compat/macros.hpp
parent11ef6b48676c52a42a81f1f5ee021cb37e728800 (diff)
compat: split/cleanup util.hpp
Some of the headers are clearly useless. Remove them. Move what's inside util.hpp into separate headers. Adjust usages. Will remove util.hpp.
Diffstat (limited to 'compat/macros.hpp')
-rw-r--r--compat/macros.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/compat/macros.hpp b/compat/macros.hpp
index e3b5976a..d51bace7 100644
--- a/compat/macros.hpp
+++ b/compat/macros.hpp
@@ -70,3 +70,8 @@
# define likely(x) (x)
# define unlikely(x) (x)
#endif
+
+#define progn(...) (([&]() { __VA_ARGS__ })())
+#define prog1(x, ...) (([&]() { auto _ret1324 = (x); do { __VA_ARGS__; } while (0); return _ret1324; })())
+
+#define once_only(...) do { static bool once__ = false; if (!once__) { once__ = true; __VA_ARGS__; } } while(false)