From dcc8cf2e65d1aa555cce12431a16547e66b469ee Mon Sep 17 00:00:00 2001 From: Steve Block Date: Tue, 27 Apr 2010 16:31:00 +0100 Subject: Merge webkit.org at r58033 : Initial merge by git Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1 --- WebKit/chromium/public/WebCommon.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'WebKit/chromium/public/WebCommon.h') 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 -- cgit v1.1