Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: base/location.cc

Issue 403103006: base: Include intrin.h to get _ReturnAddress from clang (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added the bug number to the commit message. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(COMPILER_MSVC) 7 #if defined(COMPILER_MSVC)
8 // MSDN says to #include <intrin.h>, but that breaks the VS2005 build. 8 #include <intrin.h>
9 extern "C" {
10 void* _ReturnAddress();
11 }
12 #endif 9 #endif
13 10
14 #include "base/location.h" 11 #include "base/location.h"
15 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
16 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
17 14
18 namespace tracked_objects { 15 namespace tracked_objects {
19 16
20 Location::Location(const char* function_name, 17 Location::Location(const char* function_name,
21 const char* file_name, 18 const char* file_name,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 BASE_EXPORT const void* GetProgramCounter() { 89 BASE_EXPORT const void* GetProgramCounter() {
93 #if defined(COMPILER_MSVC) 90 #if defined(COMPILER_MSVC)
94 return _ReturnAddress(); 91 return _ReturnAddress();
95 #elif defined(COMPILER_GCC) && !defined(OS_NACL) 92 #elif defined(COMPILER_GCC) && !defined(OS_NACL)
96 return __builtin_extract_return_addr(__builtin_return_address(0)); 93 return __builtin_extract_return_addr(__builtin_return_address(0));
97 #endif // COMPILER_GCC 94 #endif // COMPILER_GCC
98 return NULL; 95 return NULL;
99 } 96 }
100 97
101 } // namespace tracked_objects 98 } // namespace tracked_objects
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698