diff options
author | rnk@chromium.org <rnk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-11 05:35:14 +0000 |
---|---|---|
committer | rnk@chromium.org <rnk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-11 05:35:14 +0000 |
commit | 9436496b8401bec156a2d3ab70264d915e73dd1a (patch) | |
tree | 4f056d36957b1a647a224f320219fcdc45cca04b | |
parent | adb4edb5937cd2f421fcfbcba487bdd593b14fe0 (diff) | |
download | chromium_src-9436496b8401bec156a2d3ab70264d915e73dd1a.zip chromium_src-9436496b8401bec156a2d3ab70264d915e73dd1a.tar.gz chromium_src-9436496b8401bec156a2d3ab70264d915e73dd1a.tar.bz2 |
base: Include intrin.h to get _ReturnAddress from clang
Clang provides an implementation of _ReturnAddress in intrin.h, and you
have to include the header to get it. Without the include, we get link
errors because _ReturnAddress looks like a regular declaration.
According to the comments, this manual declaration was added to work
around a compiler problem in VS2005, but Chrome no longer supports that
toolchain.
R=cpu@chromium.org
BUG=82385
Review URL: https://codereview.chromium.org/26863006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228123 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/win/scoped_handle.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/base/win/scoped_handle.h b/base/win/scoped_handle.h index d236a70..d3f5c22 100644 --- a/base/win/scoped_handle.h +++ b/base/win/scoped_handle.h @@ -13,21 +13,18 @@ #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: |