diff options
| author | Steve Block <steveblock@google.com> | 2010-04-27 16:31:00 +0100 |
|---|---|---|
| committer | Steve Block <steveblock@google.com> | 2010-05-11 14:42:12 +0100 |
| commit | dcc8cf2e65d1aa555cce12431a16547e66b469ee (patch) | |
| tree | 92a8d65cd5383bca9749f5327fb5e440563926e6 /WebKit/chromium/public/WebCommon.h | |
| parent | ccac38a6b48843126402088a309597e682f40fe6 (diff) | |
| download | external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2 | |
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'WebKit/chromium/public/WebCommon.h')
| -rw-r--r-- | WebKit/chromium/public/WebCommon.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/WebKit/chromium/public/WebCommon.h b/WebKit/chromium/public/WebCommon.h index d347ea6..e7e38d3 100644 --- a/WebKit/chromium/public/WebCommon.h +++ b/WebKit/chromium/public/WebCommon.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2010 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -89,6 +89,21 @@ typedef wchar_t WebUChar; typedef unsigned short WebUChar; #endif +// ----------------------------------------------------------------------------- +// Assertions + +WEBKIT_API void failedAssertion(const char* file, int line, const char* function, const char* assertion); + } // namespace WebKit +// Ideally, only use inside the public directory but outside of WEBKIT_IMPLEMENTATION blocks. (Otherwise use WTF's ASSERT.) +#if defined(NDEBUG) +#define WEBKIT_ASSERT(assertion) ((void)0) +#else +#define WEBKIT_ASSERT(assertion) do { \ + if (!(assertion)) \ + failedAssertion(__FILE__, __LINE__, __FUNCTION__, #assertion); \ +} while (0) +#endif + #endif |
