OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkTypes_DEFINED | 8 #ifndef SkTypes_DEFINED |
9 #define SkTypes_DEFINED | 9 #define SkTypes_DEFINED |
10 | 10 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 #define SK_DEVELOPER_TO_STRING() virtual void toString(SkString* str) con
st SK_OVERRIDE; | 120 #define SK_DEVELOPER_TO_STRING() virtual void toString(SkString* str) con
st SK_OVERRIDE; |
121 #else | 121 #else |
122 #define SkDEVCODE(code) | 122 #define SkDEVCODE(code) |
123 #define SK_DEVELOPER_TO_STRING() | 123 #define SK_DEVELOPER_TO_STRING() |
124 #endif | 124 #endif |
125 | 125 |
126 template <bool> | 126 template <bool> |
127 struct SkCompileAssert { | 127 struct SkCompileAssert { |
128 }; | 128 }; |
129 | 129 |
| 130 // Uses static_cast<bool>(expr) instead of bool(expr) due to |
| 131 // https://connect.microsoft.com/VisualStudio/feedback/details/832915 |
130 #define SK_COMPILE_ASSERT(expr, msg) \ | 132 #define SK_COMPILE_ASSERT(expr, msg) \ |
131 typedef SkCompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] SK_UNUSED | 133 typedef SkCompileAssert<static_cast<bool>(expr)> \ |
| 134 msg[static_cast<bool>(expr) ? 1 : -1] SK_UNUSED |
132 | 135 |
133 /* | 136 /* |
134 * Usage: SK_MACRO_CONCAT(a, b) to construct the symbol ab | 137 * Usage: SK_MACRO_CONCAT(a, b) to construct the symbol ab |
135 * | 138 * |
136 * SK_MACRO_CONCAT_IMPL_PRIV just exists to make this work. Do not use directly | 139 * SK_MACRO_CONCAT_IMPL_PRIV just exists to make this work. Do not use directly |
137 * | 140 * |
138 */ | 141 */ |
139 #define SK_MACRO_CONCAT(X, Y) SK_MACRO_CONCAT_IMPL_PRIV(X, Y) | 142 #define SK_MACRO_CONCAT(X, Y) SK_MACRO_CONCAT_IMPL_PRIV(X, Y) |
140 #define SK_MACRO_CONCAT_IMPL_PRIV(X, Y) X ## Y | 143 #define SK_MACRO_CONCAT_IMPL_PRIV(X, Y) X ## Y |
141 | 144 |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 private: | 637 private: |
635 void* fPtr; | 638 void* fPtr; |
636 size_t fSize; // can be larger than the requested size (see kReuse) | 639 size_t fSize; // can be larger than the requested size (see kReuse) |
637 uint32_t fStorage[(kSize + 3) >> 2]; | 640 uint32_t fStorage[(kSize + 3) >> 2]; |
638 }; | 641 }; |
639 // Can't guard the constructor because it's a template class. | 642 // Can't guard the constructor because it's a template class. |
640 | 643 |
641 #endif /* C++ */ | 644 #endif /* C++ */ |
642 | 645 |
643 #endif | 646 #endif |
OLD | NEW |