Chromium Code Reviews| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 // declaration (either "," or "{") has to be placed before the pop macro. | 48 // declaration (either "," or "{") has to be placed before the pop macro. |
| 49 // | 49 // |
| 50 // Example usage: | 50 // Example usage: |
| 51 // class EXPORT_API Foo : NON_EXPORTED_BASE(public Bar) { | 51 // class EXPORT_API Foo : NON_EXPORTED_BASE(public Bar) { |
| 52 // | 52 // |
| 53 // MSVC Compiler warning C4275: | 53 // MSVC Compiler warning C4275: |
| 54 // non dll-interface class 'Bar' used as base for dll-interface class 'Foo'. | 54 // non dll-interface class 'Bar' used as base for dll-interface class 'Foo'. |
| 55 // Note that this is intended to be used only when no access to the base class' | 55 // Note that this is intended to be used only when no access to the base class' |
| 56 // static data is done through derived classes or inline methods. For more info, | 56 // static data is done through derived classes or inline methods. For more info, |
| 57 // see http://msdn.microsoft.com/en-us/library/3tdb471s(VS.80).aspx | 57 // see http://msdn.microsoft.com/en-us/library/3tdb471s(VS.80).aspx |
| 58 #define NON_EXPORTED_BASE(code) MSVC_SUPPRESS_WARNING(4275) \ | 58 #define NON_EXPORTED_BASE(...) \ |
|
nhiroki
2016/06/01 05:51:47
Why do we need this change?
falken
2016/06/01 09:20:05
For some reason ServiceWorkerRegistration had to b
| |
| 59 code | 59 MSVC_SUPPRESS_WARNING(4275) \ |
| 60 __VA_ARGS__ | |
| 60 | 61 |
| 61 #else // Not MSVC | 62 #else // Not MSVC |
| 62 | 63 |
| 63 #define _Printf_format_string_ | 64 #define _Printf_format_string_ |
| 64 #define MSVC_SUPPRESS_WARNING(n) | 65 #define MSVC_SUPPRESS_WARNING(n) |
| 65 #define MSVC_PUSH_DISABLE_WARNING(n) | 66 #define MSVC_PUSH_DISABLE_WARNING(n) |
| 66 #define MSVC_PUSH_WARNING_LEVEL(n) | 67 #define MSVC_PUSH_WARNING_LEVEL(n) |
| 67 #define MSVC_POP_WARNING() | 68 #define MSVC_POP_WARNING() |
| 68 #define MSVC_DISABLE_OPTIMIZE() | 69 #define MSVC_DISABLE_OPTIMIZE() |
| 69 #define MSVC_ENABLE_OPTIMIZE() | 70 #define MSVC_ENABLE_OPTIMIZE() |
| 70 #define NON_EXPORTED_BASE(code) code | 71 #define NON_EXPORTED_BASE(...) __VA_ARGS__ |
| 71 | 72 |
| 72 #endif // COMPILER_MSVC | 73 #endif // COMPILER_MSVC |
| 73 | 74 |
| 74 | 75 |
| 75 // Annotate a variable indicating it's ok if the variable is not used. | 76 // Annotate a variable indicating it's ok if the variable is not used. |
| 76 // (Typically used to silence a compiler warning when the assignment | 77 // (Typically used to silence a compiler warning when the assignment |
| 77 // is important for some other reason.) | 78 // is important for some other reason.) |
| 78 // Use like: | 79 // Use like: |
| 79 // int x = ...; | 80 // int x = ...; |
| 80 // ALLOW_UNUSED_LOCAL(x); | 81 // ALLOW_UNUSED_LOCAL(x); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 | 190 |
| 190 // Compiler feature-detection. | 191 // Compiler feature-detection. |
| 191 // clang.llvm.org/docs/LanguageExtensions.html#has-feature-and-has-extension | 192 // clang.llvm.org/docs/LanguageExtensions.html#has-feature-and-has-extension |
| 192 #if defined(__has_feature) | 193 #if defined(__has_feature) |
| 193 #define HAS_FEATURE(FEATURE) __has_feature(FEATURE) | 194 #define HAS_FEATURE(FEATURE) __has_feature(FEATURE) |
| 194 #else | 195 #else |
| 195 #define HAS_FEATURE(FEATURE) 0 | 196 #define HAS_FEATURE(FEATURE) 0 |
| 196 #endif | 197 #endif |
| 197 | 198 |
| 198 #endif // BASE_COMPILER_SPECIFIC_H_ | 199 #endif // BASE_COMPILER_SPECIFIC_H_ |
| OLD | NEW |