From f138311d2d2e0cc9ba0496d523bb46f2c1c9fb73 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Wed, 20 Sep 2023 23:58:58 -0700 Subject: Copy from the PlasticSCM repo, replace vendored glm wtih conan --- source/10-common/Macros.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 source/10-common/Macros.hpp (limited to 'source/10-common/Macros.hpp') diff --git a/source/10-common/Macros.hpp b/source/10-common/Macros.hpp new file mode 100644 index 0000000..a255ada --- /dev/null +++ b/source/10-common/Macros.hpp @@ -0,0 +1,31 @@ +#pragma once + +#define STRINGIFY_IMPL(text) #text +#define STRINGIFY(text) STRINGIFY_IMPL(text) + +#define CONCAT_IMPL(a, b) a##b +#define CONCAT(a, b) CONCAT_IMPL(a, b) +#define CONCAT_3(a, b, c) CONCAT(a, CONCAT(b, c)) +#define CONCAT_4(a, b, c, d) CONCAT(CONCAT(a, b), CONCAT(c, d)) + +#define UNIQUE_NAME(prefix) CONCAT(prefix, __COUNTER__) +#define UNIQUE_NAME_LINE(prefix) CONCAT(prefix, __LINE__) +#define DISCARD UNIQUE_NAME(_discard) + +#define UNUSED(x) (void)x; + +#define PRINTF_STRING_VIEW(s) (int)s.size(), s.data() + +#if defined(_MSC_VER) +# define UNREACHABLE __assume(0) +#elif defined(__GNUC__) || defined(__clang__) +# define UNREACHABLE __builtin_unreachable() +#else +# define UNREACHABLE +#endif + +#if _WIN32 +# define PLATFORM_PATH_STR "%ls" +#else +# define PLATFORM_PATH_STR "%s" +#endif -- cgit v1.2.3-70-g09d2