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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 284 |
285 #define ASSERT_ARG(argName, assertion) do \ | 285 #define ASSERT_ARG(argName, assertion) do \ |
286 if (!(assertion)) { \ | 286 if (!(assertion)) { \ |
287 WTFReportArgumentAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTIO
N, #argName, #assertion); \ | 287 WTFReportArgumentAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTIO
N, #argName, #assertion); \ |
288 CRASH(); \ | 288 CRASH(); \ |
289 } \ | 289 } \ |
290 while (0) | 290 while (0) |
291 | 291 |
292 #endif | 292 #endif |
293 | 293 |
294 /* COMPILE_ASSERT */ | |
295 #ifndef COMPILE_ASSERT // also defined in base/macros.h | |
296 #define COMPILE_ASSERT(exp, msg) static_assert((exp), #msg) | |
297 #endif | |
298 | |
299 /* FATAL */ | 294 /* FATAL */ |
300 | 295 |
301 #if FATAL_DISABLED | 296 #if FATAL_DISABLED |
302 #define FATAL(...) ((void)0) | 297 #define FATAL(...) ((void)0) |
303 #else | 298 #else |
304 #define FATAL(...) do { \ | 299 #define FATAL(...) do { \ |
305 WTFReportFatalError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__); \ | 300 WTFReportFatalError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__); \ |
306 CRASH(); \ | 301 CRASH(); \ |
307 } while (0) | 302 } while (0) |
308 #endif | 303 #endif |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 } \ | 393 } \ |
399 inline const thisType& to##thisType(const argumentType& argumentName) \ | 394 inline const thisType& to##thisType(const argumentType& argumentName) \ |
400 { \ | 395 { \ |
401 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ | 396 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ |
402 return static_cast<const thisType&>(argumentName); \ | 397 return static_cast<const thisType&>(argumentName); \ |
403 } \ | 398 } \ |
404 void to##thisType(const thisType*); \ | 399 void to##thisType(const thisType*); \ |
405 void to##thisType(const thisType&) | 400 void to##thisType(const thisType&) |
406 | 401 |
407 #endif /* WTF_Assertions_h */ | 402 #endif /* WTF_Assertions_h */ |
OLD | NEW |