summary refs log tree commit diff
path: root/src/Common/Unique.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Unique.hpp')
-rw-r--r--src/Common/Unique.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Common/Unique.hpp b/src/Common/Unique.hpp
new file mode 100644
index 0000000..147fb0e
--- /dev/null
+++ b/src/Common/Unique.hpp
@@ -0,0 +1,12 @@
+#pragma once
+
+// TODO: Put this macro in it's own Common header,
+// it's useful often.
+#define _UNIQUE_CONCAT(a, b) _UNIQUE_CONCAT2(a, b)
+#define _UNIQUE_CONCAT2(a, b) a##b
+
+#define _UNIQUE_NAME_PREFIX _unique_name_
+#define UNIQUE_NAME _UNIQUE_CONCAT(_UNIQUE_NAME_PREFIX, __COUNTER__)
+
+#define _UNIQUE_NUMBER_PREFIX 0xAEF
+#define UNIQUE_NUMBER _UNIQUE_CONCAT(_UNIQUE_NUMBER_PREFIX, __COUNTER__)