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 25 matching lines...) Expand all Loading... |
36 For non-debug builds, everything is disabled by default, except for the | 36 For non-debug builds, everything is disabled by default, except for the |
37 RELEASE_ASSERT family of macros. | 37 RELEASE_ASSERT family of macros. |
38 | 38 |
39 Defining any of the symbols explicitly prevents this from having any effect. | 39 Defining any of the symbols explicitly prevents this from having any effect. |
40 | 40 |
41 */ | 41 */ |
42 | 42 |
43 #include "wtf/Compiler.h" | 43 #include "wtf/Compiler.h" |
44 #include "wtf/WTFExport.h" | 44 #include "wtf/WTFExport.h" |
45 | 45 |
| 46 #ifndef ASSERTIONS_DISABLED_DEFAULT |
46 #ifdef NDEBUG | 47 #ifdef NDEBUG |
47 /* Disable ASSERT* macros in release mode. */ | 48 /* Disable ASSERT* macros in release mode. */ |
48 #define ASSERTIONS_DISABLED_DEFAULT 1 | 49 #define ASSERTIONS_DISABLED_DEFAULT 1 |
49 #else | 50 #else |
50 #define ASSERTIONS_DISABLED_DEFAULT 0 | 51 #define ASSERTIONS_DISABLED_DEFAULT 0 |
51 #endif | 52 #endif |
| 53 #endif |
52 | 54 |
53 #ifndef BACKTRACE_DISABLED | 55 #ifndef BACKTRACE_DISABLED |
54 #define BACKTRACE_DISABLED ASSERTIONS_DISABLED_DEFAULT | 56 #define BACKTRACE_DISABLED ASSERTIONS_DISABLED_DEFAULT |
55 #endif | 57 #endif |
56 | 58 |
57 #ifndef ASSERT_DISABLED | 59 #ifndef ASSERT_DISABLED |
58 #define ASSERT_DISABLED ASSERTIONS_DISABLED_DEFAULT | 60 #define ASSERT_DISABLED ASSERTIONS_DISABLED_DEFAULT |
59 #endif | 61 #endif |
60 | 62 |
61 #ifndef ASSERT_MSG_DISABLED | 63 #ifndef ASSERT_MSG_DISABLED |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 } \ | 393 } \ |
392 inline const thisType& to##thisType(const argumentType& argumentName) \ | 394 inline const thisType& to##thisType(const argumentType& argumentName) \ |
393 { \ | 395 { \ |
394 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ | 396 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ |
395 return static_cast<const thisType&>(argumentName); \ | 397 return static_cast<const thisType&>(argumentName); \ |
396 } \ | 398 } \ |
397 void to##thisType(const thisType*); \ | 399 void to##thisType(const thisType*); \ |
398 void to##thisType(const thisType&) | 400 void to##thisType(const thisType&) |
399 | 401 |
400 #endif /* WTF_Assertions_h */ | 402 #endif /* WTF_Assertions_h */ |
OLD | NEW |