OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 #undef ASSERT | 218 #undef ASSERT |
219 #endif | 219 #endif |
220 | 220 |
221 #if ASSERT_DISABLED | 221 #if ASSERT_DISABLED |
222 | 222 |
223 #define ASSERT(assertion) ((void)0) | 223 #define ASSERT(assertion) ((void)0) |
224 #define ASSERT_AT(assertion, file, line, function) ((void)0) | 224 #define ASSERT_AT(assertion, file, line, function) ((void)0) |
225 #define ASSERT_NOT_REACHED() ((void)0) | 225 #define ASSERT_NOT_REACHED() ((void)0) |
226 #define NO_RETURN_DUE_TO_ASSERT | 226 #define NO_RETURN_DUE_TO_ASSERT |
227 | 227 |
228 #if COMPILER(INTEL) && !OS(WINDOWS) || COMPILER(RVCT) | 228 #if COMPILER(INTEL) && !OS(WINDOWS) |
229 template<typename T> | 229 template<typename T> |
230 inline void assertUnused(T& x) { (void)x; } | 230 inline void assertUnused(T& x) { (void)x; } |
231 #define ASSERT_UNUSED(variable, assertion) (assertUnused(variable)) | 231 #define ASSERT_UNUSED(variable, assertion) (assertUnused(variable)) |
232 #else | 232 #else |
233 #define ASSERT_UNUSED(variable, assertion) ((void)variable) | 233 #define ASSERT_UNUSED(variable, assertion) ((void)variable) |
234 #endif | 234 #endif |
235 | 235 |
236 #else | 236 #else |
237 | 237 |
238 #define ASSERT(assertion) \ | 238 #define ASSERT(assertion) \ |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 CRASH(); \ | 293 CRASH(); \ |
294 } \ | 294 } \ |
295 while (0) | 295 while (0) |
296 #endif | 296 #endif |
297 | 297 |
298 /* ASSERT_WITH_MESSAGE_UNUSED */ | 298 /* ASSERT_WITH_MESSAGE_UNUSED */ |
299 | 299 |
300 #if COMPILER(MSVC7_OR_LOWER) | 300 #if COMPILER(MSVC7_OR_LOWER) |
301 #define ASSERT_WITH_MESSAGE_UNUSED(variable, assertion) ((void)0) | 301 #define ASSERT_WITH_MESSAGE_UNUSED(variable, assertion) ((void)0) |
302 #elif ASSERT_MSG_DISABLED | 302 #elif ASSERT_MSG_DISABLED |
303 #if COMPILER(INTEL) && !OS(WINDOWS) || COMPILER(RVCT) | 303 #if COMPILER(INTEL) && !OS(WINDOWS) |
304 template<typename T> | 304 template<typename T> |
305 inline void assertWithMessageUnused(T& x) { (void)x; } | 305 inline void assertWithMessageUnused(T& x) { (void)x; } |
306 #define ASSERT_WITH_MESSAGE_UNUSED(variable, assertion, ...) (assertWithMessageU
nused(variable)) | 306 #define ASSERT_WITH_MESSAGE_UNUSED(variable, assertion, ...) (assertWithMessageU
nused(variable)) |
307 #else | 307 #else |
308 #define ASSERT_WITH_MESSAGE_UNUSED(variable, assertion, ...) ((void)variable) | 308 #define ASSERT_WITH_MESSAGE_UNUSED(variable, assertion, ...) ((void)variable) |
309 #endif | 309 #endif |
310 #else | 310 #else |
311 #define ASSERT_WITH_MESSAGE_UNUSED(variable, assertion, ...) do \ | 311 #define ASSERT_WITH_MESSAGE_UNUSED(variable, assertion, ...) do \ |
312 if (!(assertion)) { \ | 312 if (!(assertion)) { \ |
313 WTFReportAssertionFailureWithMessage(__FILE__, __LINE__, WTF_PRETTY_FUNC
TION, #assertion, __VA_ARGS__); \ | 313 WTFReportAssertionFailureWithMessage(__FILE__, __LINE__, WTF_PRETTY_FUNC
TION, #assertion, __VA_ARGS__); \ |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 #define RELEASE_ASSERT(assertion) (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH())
: (void)0) | 411 #define RELEASE_ASSERT(assertion) (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH())
: (void)0) |
412 #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) RELEASE_ASSERT(assertion) | 412 #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) RELEASE_ASSERT(assertion) |
413 #define RELEASE_ASSERT_NOT_REACHED() IMMEDIATE_CRASH() | 413 #define RELEASE_ASSERT_NOT_REACHED() IMMEDIATE_CRASH() |
414 #else | 414 #else |
415 #define RELEASE_ASSERT(assertion) ASSERT(assertion) | 415 #define RELEASE_ASSERT(assertion) ASSERT(assertion) |
416 #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) ASSERT_WITH_MESSAGE(assertio
n, __VA_ARGS__) | 416 #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) ASSERT_WITH_MESSAGE(assertio
n, __VA_ARGS__) |
417 #define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED() | 417 #define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED() |
418 #endif | 418 #endif |
419 | 419 |
420 #endif /* WTF_Assertions_h */ | 420 #endif /* WTF_Assertions_h */ |
OLD | NEW |