aboutsummaryrefslogtreecommitdiff
path: root/src/system_wrappers/interface/fix_interlocked_exchange_pointer_win.h
diff options
context:
space:
mode:
authorAlexander Gutkin <agutkin@google.com>2012-09-17 08:53:18 +0100
committerAlexander Gutkin <agutkin@google.com>2012-09-18 10:56:58 +0100
commita6451827d543eb00824bc95097e47d0aac51ae93 (patch)
tree4a8cf6cf1ff19717bdbf501c94a899d83518bf93 /src/system_wrappers/interface/fix_interlocked_exchange_pointer_win.h
parent6f12fff925188ced26e518cd2252aff3e93bb04e (diff)
downloadwebrtc-a6451827d543eb00824bc95097e47d0aac51ae93.tar.gz
Added fixed point iSAC codec implementation.
- Added fixed-point iSAC audio codec implementation (from stable r2699). - Updated system wrappers (from stable r2699). - Some cosmetic makefile changes. Change-Id: If75d503698c11a4e4ceb851529127aadfe52f255
Diffstat (limited to 'src/system_wrappers/interface/fix_interlocked_exchange_pointer_win.h')
-rw-r--r--src/system_wrappers/interface/fix_interlocked_exchange_pointer_win.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/system_wrappers/interface/fix_interlocked_exchange_pointer_win.h b/src/system_wrappers/interface/fix_interlocked_exchange_pointer_win.h
new file mode 100644
index 0000000000..d85c724729
--- /dev/null
+++ b/src/system_wrappers/interface/fix_interlocked_exchange_pointer_win.h
@@ -0,0 +1,35 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file under third_party_mods/chromium directory of
+// source tree or at
+// http://src.chromium.org/viewvc/chrome/trunk/src/LICENSE
+
+// Various inline functions and macros to fix compilation of 32 bit target
+// on MSVC with /Wp64 flag enabled.
+
+// The original code can be found here:
+// http://src.chromium.org/svn/trunk/src/base/fix_wp64.h
+
+#ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_FIX_INTERLOCKED_EXCHANGE_POINTER_WINDOWS_H_
+#define WEBRTC_SYSTEM_WRAPPERS_SOURCE_FIX_INTERLOCKED_EXCHANGE_POINTER_WINDOWS_H_
+
+#include <windows.h>
+
+// Platform SDK fixes when building with /Wp64 for a 32 bits target.
+#if !defined(_WIN64) && defined(_Wp64)
+
+#ifdef InterlockedExchangePointer
+#undef InterlockedExchangePointer
+// The problem is that the macro provided for InterlockedExchangePointer() is
+// doing a (LONG) C-style cast that triggers invariably the warning C4312 when
+// building on 32 bits.
+inline void* InterlockedExchangePointer(void* volatile* target, void* value) {
+ return reinterpret_cast<void*>(static_cast<LONG_PTR>(InterlockedExchange(
+ reinterpret_cast<volatile LONG*>(target),
+ static_cast<LONG>(reinterpret_cast<LONG_PTR>(value)))));
+}
+#endif // #ifdef InterlockedExchangePointer
+
+#endif // #if !defined(_WIN64) && defined(_Wp64)
+
+#endif // WEBRTC_SYSTEM_WRAPPERS_SOURCE_FIX_INTERLOCKED_EXCHANGE_POINTER_WINDOWS_H_