OLD | NEW |
(Empty) | |
| 1 #ifndef WebAssertion_h |
| 2 #define WebAssertion_h |
| 3 |
| 4 #include "WebCommonExport.h" |
| 5 |
| 6 namespace WebKit { |
| 7 |
| 8 BLINK_COMMON_EXPORT void failedAssertion(const char* file, int line, const char*
function, const char* assertion); |
| 9 |
| 10 } // namespace WebKit |
| 11 |
| 12 // Ideally, only use inside the public directory but outside of WEBKIT_IMPLEMENT
ATION blocks. (Otherwise use WTF's ASSERT.) |
| 13 #if defined(NDEBUG) |
| 14 #define WEBKIT_ASSERT(assertion) ((void)0) |
| 15 #else |
| 16 #define WEBKIT_ASSERT(assertion) do { \ |
| 17 if (!(assertion)) \ |
| 18 failedAssertion(__FILE__, __LINE__, __FUNCTION__, #assertion); \ |
| 19 } while (0) |
| 20 #endif |
| 21 |
| 22 #define WEBKIT_ASSERT_NOT_REACHED() WEBKIT_ASSERT(0) |
| 23 |
| 24 #endif // WebAssertion_h |
OLD | NEW |