OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 #endif // COMPILER_MSVC | 67 #endif // COMPILER_MSVC |
68 | 68 |
69 | 69 |
70 // Annotate a variable indicating it's ok if the variable is not used. | 70 // Annotate a variable indicating it's ok if the variable is not used. |
71 // (Typically used to silence a compiler warning when the assignment | 71 // (Typically used to silence a compiler warning when the assignment |
72 // is important for some other reason.) | 72 // is important for some other reason.) |
73 // Use like: | 73 // Use like: |
74 // int x ALLOW_UNUSED = ...; | 74 // int x ALLOW_UNUSED = ...; |
75 #if defined(COMPILER_GCC) | 75 #if defined(COMPILER_GCC) |
76 #define ALLOW_UNUSED __attribute__((unused)) | 76 #define ALLOW_UNUSED __attribute__((unused)) |
77 #define NOINLINE __attribute__((noinline)) | |
Evan Martin
2011/05/09 22:49:44
Sorry to nitpick, but the comment above doesn't ma
| |
77 #else | 78 #else |
78 #define ALLOW_UNUSED | 79 #define ALLOW_UNUSED |
80 #define NOINLINE | |
79 #endif | 81 #endif |
80 | 82 |
81 // Annotate a virtual method indicating it must be overriding a virtual | 83 // Annotate a virtual method indicating it must be overriding a virtual |
82 // method in the parent class. | 84 // method in the parent class. |
83 // Use like: | 85 // Use like: |
84 // virtual void foo() OVERRIDE; | 86 // virtual void foo() OVERRIDE; |
85 #if defined(COMPILER_MSVC) | 87 #if defined(COMPILER_MSVC) |
86 #define OVERRIDE override | 88 #define OVERRIDE override |
87 #elif defined(__clang__) | 89 #elif defined(__clang__) |
88 #define OVERRIDE override | 90 #define OVERRIDE override |
(...skipping 23 matching lines...) Expand all Loading... | |
112 #endif | 114 #endif |
113 | 115 |
114 // WPRINTF_FORMAT is the same, but for wide format strings. | 116 // WPRINTF_FORMAT is the same, but for wide format strings. |
115 // This doesn't appear to yet be implemented in any compiler. | 117 // This doesn't appear to yet be implemented in any compiler. |
116 // See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38308 . | 118 // See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38308 . |
117 #define WPRINTF_FORMAT(format_param, dots_param) | 119 #define WPRINTF_FORMAT(format_param, dots_param) |
118 // If available, it would look like: | 120 // If available, it would look like: |
119 // __attribute__((format(wprintf, format_param, dots_param))) | 121 // __attribute__((format(wprintf, format_param, dots_param))) |
120 | 122 |
121 #endif // BASE_COMPILER_SPECIFIC_H_ | 123 #endif // BASE_COMPILER_SPECIFIC_H_ |
OLD | NEW |