| Index: Source/wtf/Assertions.h
|
| diff --git a/Source/wtf/Assertions.h b/Source/wtf/Assertions.h
|
| index ca91dd2bcf039897f93153a6b7e186ac617cf999..7f57c8951f51632f4d236417e06572928ea85454 100644
|
| --- a/Source/wtf/Assertions.h
|
| +++ b/Source/wtf/Assertions.h
|
| @@ -54,10 +54,10 @@
|
| #define BACKTRACE_DISABLED ASSERTIONS_DISABLED_DEFAULT
|
| #endif
|
|
|
| -#ifndef ASSERT_DISABLED
|
| -#define ASSERT_DISABLED ASSERTIONS_DISABLED_DEFAULT
|
| +#ifndef ASSERT_ENABLED
|
| +// Notice the not below:
|
| +#define ASSERT_ENABLED !ASSERTIONS_DISABLED_DEFAULT
|
| #endif
|
| -#define ASSERT_ENABLED !ASSERT_DISABLED
|
|
|
| #ifndef ASSERT_MSG_DISABLED
|
| #define ASSERT_MSG_DISABLED ASSERTIONS_DISABLED_DEFAULT
|
| @@ -179,16 +179,7 @@ WTF_EXPORT void WTFInstallReportBacktraceOnCrashHook();
|
| #undef ASSERT
|
| #endif
|
|
|
| -#if ASSERT_DISABLED
|
| -
|
| -#define ASSERT(assertion) ((void)0)
|
| -#define ASSERT_AT(assertion, file, line, function) ((void)0)
|
| -#define ASSERT_NOT_REACHED() ((void)0)
|
| -#define NO_RETURN_DUE_TO_ASSERT
|
| -
|
| -#define ASSERT_UNUSED(variable, assertion) ((void)variable)
|
| -
|
| -#else
|
| +#if ASSERT_ENABLED
|
|
|
| #define ASSERT(assertion) \
|
| (!(assertion) ? \
|
| @@ -211,6 +202,15 @@ WTF_EXPORT void WTFInstallReportBacktraceOnCrashHook();
|
|
|
| #define NO_RETURN_DUE_TO_ASSERT NO_RETURN_DUE_TO_CRASH
|
|
|
| +#else
|
| +
|
| +#define ASSERT(assertion) ((void)0)
|
| +#define ASSERT_AT(assertion, file, line, function) ((void)0)
|
| +#define ASSERT_NOT_REACHED() ((void)0)
|
| +#define NO_RETURN_DUE_TO_ASSERT
|
| +
|
| +#define ASSERT_UNUSED(variable, assertion) ((void)variable)
|
| +
|
| #endif
|
|
|
| /* ASSERT_WITH_SECURITY_IMPLICATION / RELEASE_ASSERT_WITH_SECURITY_IMPLICATION
|
| @@ -352,14 +352,14 @@ static inline void UNREACHABLE_FOR_PLATFORM()
|
| http://code.google.com/p/chromium/issues/entry?template=Security%20Bug
|
| */
|
|
|
| -#if ASSERT_DISABLED
|
| -#define RELEASE_ASSERT(assertion) (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH()) : (void)0)
|
| -#define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) RELEASE_ASSERT(assertion)
|
| -#define RELEASE_ASSERT_NOT_REACHED() IMMEDIATE_CRASH()
|
| -#else
|
| +#if ASSERT_ENABLED
|
| #define RELEASE_ASSERT(assertion) ASSERT(assertion)
|
| #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) ASSERT_WITH_MESSAGE(assertion, __VA_ARGS__)
|
| #define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED()
|
| +#else
|
| +#define RELEASE_ASSERT(assertion) (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH()) : (void)0)
|
| +#define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) RELEASE_ASSERT(assertion)
|
| +#define RELEASE_ASSERT_NOT_REACHED() IMMEDIATE_CRASH()
|
| #endif
|
|
|
| /* DEFINE_COMPARISON_OPERATORS_WITH_REFERENCES */
|
|
|