summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--compat/macros.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/compat/macros.hpp b/compat/macros.hpp
index 5a2f01e3..8f807bf0 100644
--- a/compat/macros.hpp
+++ b/compat/macros.hpp
@@ -5,6 +5,13 @@
#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__
# define never_inline __attribute__((noinline))