From 0f182b791622ad4491c8aabf8edce21a63839bdc Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 22 Jun 2018 13:16:59 +0200 Subject: compat/meta: moved to macros already --- compat/macros.hpp | 12 ++++++++++-- compat/meta.hpp | 12 ------------ dinput/keybinding-worker.cpp | 2 +- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/compat/macros.hpp b/compat/macros.hpp index abe89c73..8b635201 100644 --- a/compat/macros.hpp +++ b/compat/macros.hpp @@ -51,9 +51,18 @@ # define PP_CAT1(x,y) x##y #endif +#define once_only(...) do { static bool once__ = false; if (!once__) { once__ = true; __VA_ARGS__; } } while(false) + #if defined __cplusplus -// from now only C++ macros +// from now only C++ + +#include + +template +using cv_qualified = std::conditional_t>, + std::decay_t, + std::add_lvalue_reference_t>>>; template [[deprecated]] constexpr force_inline void static_warn() {} @@ -70,4 +79,3 @@ constexpr force_inline void static_warn() {} // end c++-only macros #endif -#define once_only(...) do { static bool once__ = false; if (!once__) { once__ = true; __VA_ARGS__; } } while(false) diff --git a/compat/meta.hpp b/compat/meta.hpp index c33777f4..b02029a7 100644 --- a/compat/meta.hpp +++ b/compat/meta.hpp @@ -7,18 +7,6 @@ * copyright notice and this permission notice appear in all copies. */ -#include - -template -using cv_qualified = std::conditional_t>, - std::decay_t, - std::add_lvalue_reference_t>>>; - -#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) - #if 0 #include diff --git a/dinput/keybinding-worker.cpp b/dinput/keybinding-worker.cpp index adcd9a96..40754b4f 100644 --- a/dinput/keybinding-worker.cpp +++ b/dinput/keybinding-worker.cpp @@ -9,7 +9,7 @@ #ifdef _WIN32 #include "keybinding-worker.hpp" -#include "compat/meta.hpp" +#include "compat/macros.hpp" #include #include -- cgit v1.2.3