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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 #ifdef SK_DEBUG | 147 #ifdef SK_DEBUG |
148 #define SkASSERT(cond) \ | 148 #define SkASSERT(cond) \ |
149 SkREQUIRE_SEMICOLON_AFTER(if (!(cond)) { SK_ABORT("assert(" #cond ")");
}) | 149 SkREQUIRE_SEMICOLON_AFTER(if (!(cond)) { SK_ABORT("assert(" #cond ")");
}) |
150 #define SkASSERTF(cond, fmt, ...) \ | 150 #define SkASSERTF(cond, fmt, ...) \ |
151 SkREQUIRE_SEMICOLON_AFTER(if (!(cond)) { \ | 151 SkREQUIRE_SEMICOLON_AFTER(if (!(cond)) { \ |
152 SkDebugf(fmt"\n", __VA_ARGS__); \ | 152 SkDebugf(fmt"\n", __VA_ARGS__); \ |
153 SK_ABORT("assert(" #cond ")"); \ | 153 SK_ABORT("assert(" #cond ")"); \ |
154 }) | 154 }) |
155 #define SkDEBUGFAIL(message) SK_ABORT(message) | 155 #define SkDEBUGFAIL(message) SK_ABORT(message) |
156 #define SkDEBUGFAILF(fmt, ...) SkASSERTF(false, fmt, ##__VA_ARGS__) | 156 #define SkDEBUGFAILF(fmt, ...) SkASSERTF(false, fmt, ##__VA_ARGS__) |
157 #define SkDEBUGCODE(code) code | 157 #define SkDEBUGCODE(...) __VA_ARGS__ |
158 #define SkDECLAREPARAM(type, var) , type var | 158 #define SkDECLAREPARAM(type, var) , type var |
159 #define SkPARAM(var) , var | 159 #define SkPARAM(var) , var |
160 #define SkDEBUGF(args ) SkDebugf args | 160 #define SkDEBUGF(args ) SkDebugf args |
161 #define SkAssertResult(cond) SkASSERT(cond) | 161 #define SkAssertResult(cond) SkASSERT(cond) |
162 #else | 162 #else |
163 #define SkASSERT(cond) | 163 #define SkASSERT(cond) |
164 #define SkASSERTF(cond, fmt, ...) | 164 #define SkASSERTF(cond, fmt, ...) |
165 #define SkDEBUGFAIL(message) | 165 #define SkDEBUGFAIL(message) |
166 #define SkDEBUGCODE(code) | 166 #define SkDEBUGCODE(...) |
167 #define SkDEBUGF(args) | 167 #define SkDEBUGF(args) |
168 #define SkDECLAREPARAM(type, var) | 168 #define SkDECLAREPARAM(type, var) |
169 #define SkPARAM(var) | 169 #define SkPARAM(var) |
170 | 170 |
171 // unlike SkASSERT, this guy executes its condition in the non-debug build. | 171 // unlike SkASSERT, this guy executes its condition in the non-debug build. |
172 // The if is present so that this can be used with functions marked SK_WARN_
UNUSED_RESULT. | 172 // The if is present so that this can be used with functions marked SK_WARN_
UNUSED_RESULT. |
173 #define SkAssertResult(cond) if (cond) {} do {} while(false) | 173 #define SkAssertResult(cond) if (cond) {} do {} while(false) |
174 #endif | 174 #endif |
175 | 175 |
176 // Legacy macro names for SK_ABORT | 176 // Legacy macro names for SK_ABORT |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 | 720 |
721 void* fPtr; | 721 void* fPtr; |
722 size_t fSize; // can be larger than the requested size (see kReuse) | 722 size_t fSize; // can be larger than the requested size (see kReuse) |
723 uint32_t fStorage[kSize >> 2]; | 723 uint32_t fStorage[kSize >> 2]; |
724 }; | 724 }; |
725 // Can't guard the constructor because it's a template class. | 725 // Can't guard the constructor because it's a template class. |
726 | 726 |
727 #endif /* C++ */ | 727 #endif /* C++ */ |
728 | 728 |
729 #endif | 729 #endif |
OLD | NEW |