summaryrefslogtreecommitdiffstats
path: root/third_party
diff options
context:
space:
mode:
authorhans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-31 19:14:32 +0000
committerhans@chromium.org <hans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-31 19:14:32 +0000
commit53f1a3a1dd6e4bb655b1595aca2fcbb0cabd593e (patch)
tree0bf428fcb2b3bb04573f214d9f02b9a55bc9bd10 /third_party
parent29bad37f2823e596b6bbe5ef98f2a40c3b96342d (diff)
downloadchromium_src-53f1a3a1dd6e4bb655b1595aca2fcbb0cabd593e.zip
chromium_src-53f1a3a1dd6e4bb655b1595aca2fcbb0cabd593e.tar.gz
chromium_src-53f1a3a1dd6e4bb655b1595aca2fcbb0cabd593e.tar.bz2
atomicops-internals-windows.h: Don't declare intrincs when using Clang
Clang provides inline definitions in its Intrin.h file. If we declare our own intrinsic functions in base::subtle::, we will use those instead, and fail to link because they are not defined anywhere. BUG=82385 Review URL: https://codereview.chromium.org/150823003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248240 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r--third_party/tcmalloc/chromium/src/base/atomicops-internals-windows.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/third_party/tcmalloc/chromium/src/base/atomicops-internals-windows.h b/third_party/tcmalloc/chromium/src/base/atomicops-internals-windows.h
index 6a38bad..e4d6bb9 100644
--- a/third_party/tcmalloc/chromium/src/base/atomicops-internals-windows.h
+++ b/third_party/tcmalloc/chromium/src/base/atomicops-internals-windows.h
@@ -86,21 +86,29 @@ inline LONG FastInterlockedExchangeAdd(volatile LONG* ptr, LONG increment) {
// have conflicting declarations of some intrinsics, breaking
// compilation. So we declare the intrinsics we need ourselves. See
// http://connect.microsoft.com/VisualStudio/feedback/details/262047
+
+// Don't declare the intrinsics if using Clang. Clang provides inline
+// definitions in its Intrin.h.
+#ifndef __clang__
LONG _InterlockedCompareExchange(volatile LONG* ptr, LONG newval, LONG oldval);
#pragma intrinsic(_InterlockedCompareExchange)
+
+LONG _InterlockedExchange(volatile LONG* ptr, LONG newval);
+#pragma intrinsic(_InterlockedExchange)
+
+LONG _InterlockedExchangeAdd(volatile LONG* ptr, LONG increment);
+#pragma intrinsic(_InterlockedExchangeAdd)
+#endif
+
inline LONG FastInterlockedCompareExchange(volatile LONG* ptr,
LONG newval, LONG oldval) {
return _InterlockedCompareExchange(ptr, newval, oldval);
}
-LONG _InterlockedExchange(volatile LONG* ptr, LONG newval);
-#pragma intrinsic(_InterlockedExchange)
inline LONG FastInterlockedExchange(volatile LONG* ptr, LONG newval) {
return _InterlockedExchange(ptr, newval);
}
-LONG _InterlockedExchangeAdd(volatile LONG* ptr, LONG increment);
-#pragma intrinsic(_InterlockedExchangeAdd)
inline LONG FastInterlockedExchangeAdd(volatile LONG* ptr, LONG increment) {
return _InterlockedExchangeAdd(ptr, increment);
}