From 725f63aabc0ca818e856c864e87680b26509a8e6 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Wed, 19 Jun 2024 23:16:16 +0200 Subject: [PATCH] vector: prefix macros with AQ_ --- include/hyprutils/math/Vector2D.hpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/include/hyprutils/math/Vector2D.hpp b/include/hyprutils/math/Vector2D.hpp index c204035..4cc0402 100644 --- a/include/hyprutils/math/Vector2D.hpp +++ b/include/hyprutils/math/Vector2D.hpp @@ -102,7 +102,7 @@ namespace Hyprutils { } // absolutely ridiculous formatter spec parsing -#define FORMAT_PARSE(specs__, type__) \ +#define AQ_FORMAT_PARSE(specs__, type__) \ template \ constexpr auto parse(FormatContext& ctx) { \ auto it = ctx.begin(); \ @@ -112,10 +112,10 @@ namespace Hyprutils { return it; \ } -#define FORMAT_FLAG(spec__, flag__) \ +#define AQ_FORMAT_FLAG(spec__, flag__) \ case spec__: (flag__) = true; break; -#define FORMAT_NUMBER(buf__) \ +#define AQ_FORMAT_NUMBER(buf__) \ case '0': \ case '1': \ case '2': \ @@ -138,9 +138,9 @@ struct std::formatter : std::formatter bool formatJson = false; bool formatX = false; std::string precision = ""; - FORMAT_PARSE(FORMAT_FLAG('j', formatJson) // - FORMAT_FLAG('X', formatX) // - FORMAT_NUMBER(precision), + AQ_FORMAT_PARSE(AQ_FORMAT_FLAG('j', formatJson) // + AQ_FORMAT_FLAG('X', formatX) // + AQ_FORMAT_NUMBER(precision), Hyprutils::Math::Vector2D) template @@ -159,7 +159,3 @@ struct std::formatter : std::formatter } catch (std::format_error& e) { return std::format_to(ctx.out(), "[{}, {}]", vec.x, vec.y); } } }; - -#undef FORMAT_PARSE -#undef FORMAT_FLAG -#undef FORMAT_NUMBER