From 11bed3b2b78187edb1f5d44fe658eb36c62e676e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 26 Dec 2017 22:15:29 +0100 Subject: compat/macros: add portable memory barrier --- compat/macros.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compat/macros.hpp b/compat/macros.hpp index 5a2f01e3..8f807bf0 100644 --- a/compat/macros.hpp +++ b/compat/macros.hpp @@ -4,6 +4,13 @@ #define otr_tr(str) (QCoreApplication::translate(OTR_MODULE_NAME, (str))) #define _(x) otr_tr(x) +#if defined _MSC_VER +# +# define MEMORY_BARRIER _ReadWriteBarrier() +#else +# define MEMORY_BARRIER asm volatile("" ::: "memory") +#endif + #if defined _MSC_VER # define never_inline __declspec(noinline) #elif defined __GNUG__ -- cgit v1.2.3