OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file is an internal atomic implementation, use base/atomicops.h instead. | 5 // This file is an internal atomic implementation, use base/atomicops.h instead. |
6 | 6 |
7 #ifndef BASE_ATOMICOPS_INTERNALS_X86_MSVC_H_ | 7 #ifndef BASE_ATOMICOPS_INTERNALS_X86_MSVC_H_ |
8 #define BASE_ATOMICOPS_INTERNALS_X86_MSVC_H_ | 8 #define BASE_ATOMICOPS_INTERNALS_X86_MSVC_H_ |
9 | 9 |
10 #include <windows.h> | 10 #include <windows.h> |
11 | 11 |
| 12 #include "base/macros.h" |
| 13 |
12 #if defined(ARCH_CPU_64_BITS) | 14 #if defined(ARCH_CPU_64_BITS) |
13 // windows.h #defines this (only on x64). This causes problems because the | 15 // windows.h #defines this (only on x64). This causes problems because the |
14 // public API also uses MemoryBarrier at the public name for this fence. So, on | 16 // public API also uses MemoryBarrier at the public name for this fence. So, on |
15 // X64, undef it, and call its documented | 17 // X64, undef it, and call its documented |
16 // (http://msdn.microsoft.com/en-us/library/windows/desktop/ms684208.aspx) | 18 // (http://msdn.microsoft.com/en-us/library/windows/desktop/ms684208.aspx) |
17 // implementation directly. | 19 // implementation directly. |
18 #undef MemoryBarrier | 20 #undef MemoryBarrier |
19 #endif | 21 #endif |
20 | 22 |
21 namespace base { | 23 namespace base { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 return NoBarrier_CompareAndSwap(ptr, old_value, new_value); | 187 return NoBarrier_CompareAndSwap(ptr, old_value, new_value); |
186 } | 188 } |
187 | 189 |
188 | 190 |
189 #endif // defined(_WIN64) | 191 #endif // defined(_WIN64) |
190 | 192 |
191 } // namespace base::subtle | 193 } // namespace base::subtle |
192 } // namespace base | 194 } // namespace base |
193 | 195 |
194 #endif // BASE_ATOMICOPS_INTERNALS_X86_MSVC_H_ | 196 #endif // BASE_ATOMICOPS_INTERNALS_X86_MSVC_H_ |
OLD | NEW |