diff options
author | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-15 08:51:28 +0000 |
---|---|---|
committer | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-15 08:51:28 +0000 |
commit | a48610cce51c396e5667b70bce05a5ad80fbc83c (patch) | |
tree | 95b14cb1455470ee1b300fc5d34f6de2d840058c /base/atomicops.h | |
parent | 2632f5046d811f8780484cbaf983f3c9a97c9ea9 (diff) | |
download | chromium_src-a48610cce51c396e5667b70bce05a5ad80fbc83c.zip chromium_src-a48610cce51c396e5667b70bce05a5ad80fbc83c.tar.gz chromium_src-a48610cce51c396e5667b70bce05a5ad80fbc83c.tar.bz2 |
Workaround to make MemoryBarrier compile on Win x64
windows.h #defines "MemoryBarrier" on x64 (on x86 it's an forceinline function). Because atomicops.h uses MemoryBarrier as the public api name, workaround by #undefing and then calling the implementation directly.
ref: http://msdn.microsoft.com/en-us/library/windows/desktop/ms684208.aspx
R=brettw@chromium.org
BUG=166496
Review URL: https://chromiumcodereview.appspot.com/11888016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176859 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/atomicops.h')
-rw-r--r-- | base/atomicops.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/base/atomicops.h b/base/atomicops.h index de5554e..13fb7e4 100644 --- a/base/atomicops.h +++ b/base/atomicops.h @@ -31,6 +31,15 @@ #include "base/basictypes.h" #include "build/build_config.h" +#if defined(OS_WIN) && defined(ARCH_CPU_64_BITS) +// windows.h #defines this (only on x64). This causes problems because the +// public API also uses MemoryBarrier at the public name for this fence. So, on +// X64, undef it, and call its documented +// (http://msdn.microsoft.com/en-us/library/windows/desktop/ms684208.aspx) +// implementation directly. +#undef MemoryBarrier +#endif + namespace base { namespace subtle { |