Bug 1041325 - Use intrin.h for _ReturnAddress in the chromium sandbox code; r=bbondy
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 20 Jul 2014 19:05:44 -0400
changeset 217190 d11fc9a23f6876cb5f1bdc5ea1bd227dccd39385
parent 217189 ea2341b06e6fe167dd3a458de0998c8d560a3d6f
child 217191 f09caa4ea7c5335b679b8a9c60a5ca5b8fb90b76
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbondy
bugs1041325
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1041325 - Use intrin.h for _ReturnAddress in the chromium sandbox code; r=bbondy
security/sandbox/chromium/base/location.cc
security/sandbox/chromium/base/win/scoped_handle.h
--- a/security/sandbox/chromium/base/location.cc
+++ b/security/sandbox/chromium/base/location.cc
@@ -1,19 +1,16 @@
 // Copyright (c) 2012 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.
 
 #include "build/build_config.h"
 
 #if defined(COMPILER_MSVC)
-// MSDN says to #include <intrin.h>, but that breaks the VS2005 build.
-extern "C" {
-  void* _ReturnAddress();
-}
+#include <intrin.h>
 #endif
 
 #include "base/location.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/stringprintf.h"
 
 namespace tracked_objects {
 
--- a/security/sandbox/chromium/base/win/scoped_handle.h
+++ b/security/sandbox/chromium/base/win/scoped_handle.h
@@ -8,31 +8,28 @@
 #include <windows.h>
 
 #include "base/base_export.h"
 #include "base/basictypes.h"
 #include "base/location.h"
 #include "base/logging.h"
 #include "base/move.h"
 
-namespace base {
-namespace win {
-
 // TODO(rvargas): remove this with the rest of the verifier.
 #if defined(COMPILER_MSVC)
-// MSDN says to #include <intrin.h>, but that breaks the VS2005 build.
-extern "C" {
-  void* _ReturnAddress();
-}
+#include <intrin.h>
 #define BASE_WIN_GET_CALLER _ReturnAddress()
 #elif defined(COMPILER_GCC)
 #define BASE_WIN_GET_CALLER __builtin_extract_return_addr(\\
     __builtin_return_address(0))
 #endif
 
+namespace base {
+namespace win {
+
 // Generic wrapper for raw handles that takes care of closing handles
 // automatically. The class interface follows the style of
 // the ScopedStdioHandle class with a few additions:
 //   - IsValid() method can tolerate multiple invalid handle values such as NULL
 //     and INVALID_HANDLE_VALUE (-1) for Win32 handles.
 //   - Receive() method allows to receive a handle value from a function that
 //     takes a raw handle pointer only.
 template <class Traits, class Verifier>