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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 #define SkAssertResult(cond) SkASSERT(cond) | 142 #define SkAssertResult(cond) SkASSERT(cond) |
143 #else | 143 #else |
144 #define SkASSERT(cond) | 144 #define SkASSERT(cond) |
145 #define SkDEBUGFAIL(message) | 145 #define SkDEBUGFAIL(message) |
146 #define SkDEBUGCODE(code) | 146 #define SkDEBUGCODE(code) |
147 #define SkDEBUGF(args) | 147 #define SkDEBUGF(args) |
148 #define SkDECLAREPARAM(type, var) | 148 #define SkDECLAREPARAM(type, var) |
149 #define SkPARAM(var) | 149 #define SkPARAM(var) |
150 | 150 |
151 // unlike SkASSERT, this guy executes its condition in the non-debug build. | 151 // unlike SkASSERT, this guy executes its condition in the non-debug build. |
152 // It casts to void to allow use with functions declared with SK_WARN_RESULT
_UNUSED. | 152 // The if is present so that this can be used with functions marked SK_WARN_
UNUSED_RESULT. |
153 #define SkAssertResult(cond) (void)(cond) | 153 #define SkAssertResult(cond) if (cond) {} do {} while(false) |
154 #endif | 154 #endif |
155 | 155 |
156 // Legacy macro names for SK_ABORT | 156 // Legacy macro names for SK_ABORT |
157 #define SkFAIL(message) SK_ABORT(message) | 157 #define SkFAIL(message) SK_ABORT(message) |
158 #define sk_throw() SK_ABORT("sk_throw") | 158 #define sk_throw() SK_ABORT("sk_throw") |
159 | 159 |
160 // We want to evaluate cond only once, and inside the SkASSERT somewhere so we s
ee its string form. | 160 // We want to evaluate cond only once, and inside the SkASSERT somewhere so we s
ee its string form. |
161 // So we use the comma operator to make an SkDebugf that always returns false: w
e'll evaluate cond, | 161 // So we use the comma operator to make an SkDebugf that always returns false: w
e'll evaluate cond, |
162 // and if it's true the assert passes; if it's false, we'll print the message an
d the assert fails. | 162 // and if it's true the assert passes; if it's false, we'll print the message an
d the assert fails. |
163 #define SkASSERTF(cond, fmt, ...) SkASSERT((cond) || (SkDebugf(fmt"\n", __
VA_ARGS__), false)) | 163 #define SkASSERTF(cond, fmt, ...) SkASSERT((cond) || (SkDebugf(fmt"\n", __
VA_ARGS__), false)) |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 | 701 |
702 void* fPtr; | 702 void* fPtr; |
703 size_t fSize; // can be larger than the requested size (see kReuse) | 703 size_t fSize; // can be larger than the requested size (see kReuse) |
704 uint32_t fStorage[kSize >> 2]; | 704 uint32_t fStorage[kSize >> 2]; |
705 }; | 705 }; |
706 // Can't guard the constructor because it's a template class. | 706 // Can't guard the constructor because it's a template class. |
707 | 707 |
708 #endif /* C++ */ | 708 #endif /* C++ */ |
709 | 709 |
710 #endif | 710 #endif |
OLD | NEW |