| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 if (!(assertion)) { \ | 275 if (!(assertion)) { \ |
| 276 WTFReportArgumentAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTIO
N, #argName, #assertion); \ | 276 WTFReportArgumentAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTIO
N, #argName, #assertion); \ |
| 277 CRASH(); \ | 277 CRASH(); \ |
| 278 } \ | 278 } \ |
| 279 while (0) | 279 while (0) |
| 280 | 280 |
| 281 #endif | 281 #endif |
| 282 | 282 |
| 283 /* COMPILE_ASSERT */ | 283 /* COMPILE_ASSERT */ |
| 284 #ifndef COMPILE_ASSERT | 284 #ifndef COMPILE_ASSERT |
| 285 #if COMPILER_SUPPORTS(C_STATIC_ASSERT) | |
| 286 /* Unlike static_assert below, this also works in plain C code. */ | |
| 287 #define COMPILE_ASSERT(exp, name) _Static_assert((exp), #name) | |
| 288 #elif COMPILER_SUPPORTS(CXX_STATIC_ASSERT) | |
| 289 #define COMPILE_ASSERT(exp, name) static_assert((exp), #name) | 285 #define COMPILE_ASSERT(exp, name) static_assert((exp), #name) |
| 290 #else | |
| 291 #define COMPILE_ASSERT(exp, name) typedef int dummy##name [(exp) ? 1 : -1] | |
| 292 #endif | |
| 293 #endif | 286 #endif |
| 294 | 287 |
| 295 /* FATAL */ | 288 /* FATAL */ |
| 296 | 289 |
| 297 #if FATAL_DISABLED | 290 #if FATAL_DISABLED |
| 298 #define FATAL(...) ((void)0) | 291 #define FATAL(...) ((void)0) |
| 299 #else | 292 #else |
| 300 #define FATAL(...) do { \ | 293 #define FATAL(...) do { \ |
| 301 WTFReportFatalError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__); \ | 294 WTFReportFatalError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__); \ |
| 302 CRASH(); \ | 295 CRASH(); \ |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 } \ | 387 } \ |
| 395 inline const thisType& to##thisType(const argumentType& argumentName) \ | 388 inline const thisType& to##thisType(const argumentType& argumentName) \ |
| 396 { \ | 389 { \ |
| 397 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ | 390 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ |
| 398 return static_cast<const thisType&>(argumentName); \ | 391 return static_cast<const thisType&>(argumentName); \ |
| 399 } \ | 392 } \ |
| 400 void to##thisType(const thisType*); \ | 393 void to##thisType(const thisType*); \ |
| 401 void to##thisType(const thisType&) | 394 void to##thisType(const thisType&) |
| 402 | 395 |
| 403 #endif /* WTF_Assertions_h */ | 396 #endif /* WTF_Assertions_h */ |
| OLD | NEW |