Bug 1041325 - Use intrin.h for _ReturnAddress in the chromium sandbox code; r=bbondy

--HG--
extra : rebase_source : 06bb642636a9f3df2e75eb950816a7d48da85faf
This commit is contained in:
Ehsan Akhgari 2014-07-20 19:05:44 -04:00
parent 32baa5a3ed
commit c7a033be8e
2 changed files with 5 additions and 11 deletions

View File

@ -5,10 +5,7 @@
#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"

View File

@ -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: