aboutsummaryrefslogtreecommitdiff
path: root/source/Macros.hpp
diff options
context:
space:
mode:
authorhnOsmium0001 <[email protected]>2022-04-06 20:52:51 -0700
committerhnOsmium0001 <[email protected]>2022-04-06 20:52:51 -0700
commit3fdc6eb4f2cbeffce9b250beec4d3a2d52a3f534 (patch)
tree05991741844aa2814b3ac71e2c843ebe07244845 /source/Macros.hpp
parentebd42760caaec8330a3c028f31adc7bc0b339d16 (diff)
Work on moving infrastruture to this project
Diffstat (limited to 'source/Macros.hpp')
-rw-r--r--source/Macros.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/source/Macros.hpp b/source/Macros.hpp
new file mode 100644
index 0000000..71a438a
--- /dev/null
+++ b/source/Macros.hpp
@@ -0,0 +1,29 @@
+#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;
+
+#if defined(_MSC_VER)
+# define UNREACHABLE __assume(0)
+#elif defined(__GNUC__) || defined(__clang__)
+# define UNREACHABLE __builtin_unreachable()
+#else
+# define UNREACHABLE
+#endif
+
+#if defined(DOCTEST_CONFIG_DISABLE)
+# define TESTED_MEMEBERS_VISBILITY private
+#else
+# define TESTED_MEMEBERS_VISBILITY public
+#endif