From 65352befe1257a2ef2ed566349dcd26db90cad1d Mon Sep 17 00:00:00 2001
From: Florian Fischer <florian.fischer@muhq.space>
Date: Fri, 8 Oct 2021 11:03:38 +0200
Subject: [PATCH] [Common.hpp] fix CACHE_LINE_EXCLUSIVE macro

The macro did not replace symbol in __symbol_mem and always
created the literal symbol __symbol_mem which makes the
macro unusable in the same scope twice.
---
 emper/Common.hpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/emper/Common.hpp b/emper/Common.hpp
index 6fd18884..c3e57afd 100644
--- a/emper/Common.hpp
+++ b/emper/Common.hpp
@@ -31,9 +31,9 @@ using func_t = std::function<void()>;
 #define unlikely(x) __builtin_expect(!!(x), 0)
 
 #define ALIGN_TO_CACHE_LINE alignas(64)
-#define CACHE_LINE_EXCLUSIVE(T, symbol)            \
-	std::aligned_storage<64, 64>::type __symbol_mem; \
-	T& symbol = *new (&__symbol_mem) T()
+#define CACHE_LINE_EXCLUSIVE(T, symbol)                \
+	std::aligned_storage<64, 64>::type __##symbol##_mem; \
+	T& symbol = *new (&__##symbol##_mem) T()
 
 [[noreturn]] void die(const char* message, bool usePerror);
 
-- 
GitLab