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 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 void WTFSetCrashHook(WTFCrashHookFunction); | 129 void WTFSetCrashHook(WTFCrashHookFunction); |
130 void WTFInvokeCrashHook(); | 130 void WTFInvokeCrashHook(); |
131 void WTFInstallReportBacktraceOnCrashHook(); | 131 void WTFInstallReportBacktraceOnCrashHook(); |
132 | 132 |
133 #ifdef __cplusplus | 133 #ifdef __cplusplus |
134 } | 134 } |
135 #endif | 135 #endif |
136 | 136 |
137 /* IMMEDIATE_CRASH() - Like CRASH() below but crashes in the fastest, simplest p
ossible way with no attempt at logging. */ | 137 /* IMMEDIATE_CRASH() - Like CRASH() below but crashes in the fastest, simplest p
ossible way with no attempt at logging. */ |
138 #ifndef IMMEDIATE_CRASH | 138 #ifndef IMMEDIATE_CRASH |
139 #if COMPILER(CLANG) | 139 #if COMPILER(GCC) |
140 #define IMMEDIATE_CRASH() __builtin_trap() | 140 #define IMMEDIATE_CRASH() __builtin_trap() |
141 #else | 141 #else |
142 #define IMMEDIATE_CRASH() ((void(*)())0)() | 142 #define IMMEDIATE_CRASH() ((void(*)())0)() |
143 #endif | 143 #endif |
144 #endif | 144 #endif |
145 | 145 |
146 /* CRASH() - Raises a fatal error resulting in program termination and triggerin
g either the debugger or the crash reporter. | 146 /* CRASH() - Raises a fatal error resulting in program termination and triggerin
g either the debugger or the crash reporter. |
147 | 147 |
148 Use CRASH() in response to known, unrecoverable errors like out-of-memory. | 148 Use CRASH() in response to known, unrecoverable errors like out-of-memory. |
149 Macro is enabled in both debug and release mode. | 149 Macro is enabled in both debug and release mode. |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 #define RELEASE_ASSERT(assertion) (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH())
: (void)0) | 367 #define RELEASE_ASSERT(assertion) (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH())
: (void)0) |
368 #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) RELEASE_ASSERT(assertion) | 368 #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) RELEASE_ASSERT(assertion) |
369 #define RELEASE_ASSERT_NOT_REACHED() IMMEDIATE_CRASH() | 369 #define RELEASE_ASSERT_NOT_REACHED() IMMEDIATE_CRASH() |
370 #else | 370 #else |
371 #define RELEASE_ASSERT(assertion) ASSERT(assertion) | 371 #define RELEASE_ASSERT(assertion) ASSERT(assertion) |
372 #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) ASSERT_WITH_MESSAGE(assertio
n, __VA_ARGS__) | 372 #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) ASSERT_WITH_MESSAGE(assertio
n, __VA_ARGS__) |
373 #define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED() | 373 #define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED() |
374 #endif | 374 #endif |
375 | 375 |
376 #endif /* WTF_Assertions_h */ | 376 #endif /* WTF_Assertions_h */ |
OLD | NEW |