summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2016-04-06 13:38:22 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2016-04-06 13:38:22 +0200
commitfd7a8d18ea3a844be1a82490be3c154549dfee47 (patch)
treed8e115bf138a448022081c9057b224c8f7e2ab52
parent9794cf2311c8fe86f05e046f0b96b46862219e03 (diff)
downloadmariadb-git-fd7a8d18ea3a844be1a82490be3c154549dfee47.tar.gz
Fix compile error in UT_COMPILER_BARRIER on Visual Studio compiler.
-rw-r--r--storage/innobase/include/ut0ut.h8
-rw-r--r--storage/xtradb/include/ut0ut.h8
2 files changed, 14 insertions, 2 deletions
diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h
index 1334a6000be..5c4a358f9a6 100644
--- a/storage/innobase/include/ut0ut.h
+++ b/storage/innobase/include/ut0ut.h
@@ -97,7 +97,13 @@ private:
# define UT_RELAX_CPU() ((void)0) /* avoid warning for an empty statement */
# endif
-#define UT_COMPILER_BARRIER() __asm__ __volatile__ ("":::"memory")
+#if defined (__GNUC__)
+# define UT_COMPILER_BARRIER() __asm__ __volatile__ ("":::"memory")
+#elif defined (_MSC_VER)
+# define UT_COMPILER_BARRIER() MemoryBarrier()
+#else
+# define UT_COMPILER_BARRIER()
+#endif
# if defined(HAVE_HMT_PRIORITY_INSTRUCTION)
#include <sys/platform/ppc.h>
diff --git a/storage/xtradb/include/ut0ut.h b/storage/xtradb/include/ut0ut.h
index 722acdb607e..053eb78e42b 100644
--- a/storage/xtradb/include/ut0ut.h
+++ b/storage/xtradb/include/ut0ut.h
@@ -94,7 +94,13 @@ private:
# define UT_RELAX_CPU() ((void)0) /* avoid warning for an empty statement */
# endif
-#define UT_COMPILER_BARRIER() __asm__ __volatile__ ("":::"memory")
+#if defined (__GNUC__)
+# define UT_COMPILER_BARRIER() __asm__ __volatile__ ("":::"memory")
+#elif defined (_MSC_VER)
+# define UT_COMPILER_BARRIER() MemoryBarrier()
+#else
+# define UT_COMPILER_BARRIER()
+#endif
# if defined(HAVE_HMT_PRIORITY_INSTRUCTION)
#include <sys/platform/ppc.h>