OLD | NEW |
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 #ifndef BASE_COMPILER_SPECIFIC_H_ | 5 #ifndef BASE_COMPILER_SPECIFIC_H_ |
6 #define BASE_COMPILER_SPECIFIC_H_ | 6 #define BASE_COMPILER_SPECIFIC_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(COMPILER_MSVC) | 10 #if defined(COMPILER_MSVC) |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 // WPRINTF_FORMAT is the same, but for wide format strings. | 192 // WPRINTF_FORMAT is the same, but for wide format strings. |
193 // This doesn't appear to yet be implemented in any compiler. | 193 // This doesn't appear to yet be implemented in any compiler. |
194 // See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38308 . | 194 // See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38308 . |
195 #define WPRINTF_FORMAT(format_param, dots_param) | 195 #define WPRINTF_FORMAT(format_param, dots_param) |
196 // If available, it would look like: | 196 // If available, it would look like: |
197 // __attribute__((format(wprintf, format_param, dots_param))) | 197 // __attribute__((format(wprintf, format_param, dots_param))) |
198 | 198 |
199 | 199 |
200 // MemorySanitizer annotations. | 200 // MemorySanitizer annotations. |
201 #ifdef MEMORY_SANITIZER | 201 #ifdef MEMORY_SANITIZER |
202 extern "C" { | 202 #include <sanitizer/msan_interface.h> |
203 void __msan_unpoison(const void *p, unsigned long s); | |
204 } // extern "C" | |
205 | 203 |
206 // Mark a memory region fully initialized. | 204 // Mark a memory region fully initialized. |
207 // Use this to annotate code that deliberately reads uninitialized data, for | 205 // Use this to annotate code that deliberately reads uninitialized data, for |
208 // example a GC scavenging root set pointers from the stack. | 206 // example a GC scavenging root set pointers from the stack. |
209 #define MSAN_UNPOISON(p, s) __msan_unpoison(p, s) | 207 #define MSAN_UNPOISON(p, s) __msan_unpoison(p, s) |
210 #else // MEMORY_SANITIZER | 208 #else // MEMORY_SANITIZER |
211 #define MSAN_UNPOISON(p, s) | 209 #define MSAN_UNPOISON(p, s) |
212 #endif // MEMORY_SANITIZER | 210 #endif // MEMORY_SANITIZER |
213 | 211 |
214 // Macro useful for writing cross-platform function pointers. | 212 // Macro useful for writing cross-platform function pointers. |
215 #if !defined(CDECL) | 213 #if !defined(CDECL) |
216 #if defined(OS_WIN) | 214 #if defined(OS_WIN) |
217 #define CDECL __cdecl | 215 #define CDECL __cdecl |
218 #else // defined(OS_WIN) | 216 #else // defined(OS_WIN) |
219 #define CDECL | 217 #define CDECL |
220 #endif // defined(OS_WIN) | 218 #endif // defined(OS_WIN) |
221 #endif // !defined(CDECL) | 219 #endif // !defined(CDECL) |
222 | 220 |
223 #endif // BASE_COMPILER_SPECIFIC_H_ | 221 #endif // BASE_COMPILER_SPECIFIC_H_ |
OLD | NEW |