# HG changeset patch # User Teemu Piippo # Date 1479224694 -7200 # Node ID 848ad1516e4d3f4052e5607de10bd68a4892d657 # Parent 71946fed475ac9532e0a7b7ce48c3f6d73cbd1f8 Removed the 'once' macro since it's not used diff -r 71946fed475a -r 848ad1516e4d src/macros.h --- a/src/macros.h Tue Nov 15 17:42:42 2016 +0200 +++ b/src/macros.h Tue Nov 15 17:44:54 2016 +0200 @@ -40,7 +40,7 @@ # define DIRSLASH_CHAR '/' #endif // WIN32 -#define dvalof(A) dprint ("value of '%1' = %2\n", #A, A) +#define printValueOf(A) dprint ("value of '%1' = %2\n", #A, A) #define for_axes(AX) for (const Axis AX : std::initializer_list ({X, Y, Z})) #define MAKE_ITERABLE_ENUM(T, FIRST, LAST) \ @@ -63,27 +63,3 @@ bool checkFlag(Flag flag) const { return !!(m_flags & flag); } \ void setFlag(Flag flag) { m_flags |= flag; } \ void unsetFlag(Flag flag) { m_flags &= ~flag; } - -// once-statement -struct OnceGuard -{ - bool triggered; - OnceGuard() : triggered (false) {} - - bool pass() - { - if (triggered) - { - return false; - } - else - { - triggered = true; - return true; - } - } -}; - -#define TEE_2(A,B) A ## B -#define TEE(A,B) TEE_2(A,B) -#define once static OnceGuard TEE(_once_, __LINE__); if (TEE(_once_, __LINE__).pass())