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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "base/logging.h" | 44 #include "base/logging.h" |
45 #include "wtf/Compiler.h" | 45 #include "wtf/Compiler.h" |
46 #include "wtf/Noncopyable.h" | 46 #include "wtf/Noncopyable.h" |
47 #include "wtf/WTFExport.h" | 47 #include "wtf/WTFExport.h" |
48 #include "wtf/build_config.h" | 48 #include "wtf/build_config.h" |
49 #include <stdarg.h> | 49 #include <stdarg.h> |
50 | 50 |
51 // Users must test "#if ENABLE(ASSERT)", which helps ensure that code | 51 // Users must test "#if ENABLE(ASSERT)", which helps ensure that code |
52 // testing this macro has included this header. | 52 // testing this macro has included this header. |
53 #ifndef ENABLE_ASSERT | 53 #ifndef ENABLE_ASSERT |
54 #if DCHECK_IS_ON() && !defined(DCHECK_IS_DUMP_WITHOUT_CRASH) | 54 #if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON) |
55 /* ASSERT* will currently crash the process if enabled, so which is not | |
56 the desired behaviour if DCHECK_IS_DUMP_WITHOUT_CRASH. */ | |
57 #define ENABLE_ASSERT 1 | |
58 #else | |
59 /* Disable ASSERT* macros in release mode by default. */ | 55 /* Disable ASSERT* macros in release mode by default. */ |
60 #define ENABLE_ASSERT 0 | 56 #define ENABLE_ASSERT 0 |
61 #endif /* DCHECK_IS_ON() */ | 57 #else |
| 58 #define ENABLE_ASSERT 1 |
| 59 #endif /* defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON) */ |
62 #endif | 60 #endif |
63 | 61 |
64 #ifndef ASSERT_MSG_DISABLED | 62 #ifndef ASSERT_MSG_DISABLED |
65 #define ASSERT_MSG_DISABLED !ENABLE(ASSERT) | 63 #define ASSERT_MSG_DISABLED !ENABLE(ASSERT) |
66 #endif | 64 #endif |
67 | 65 |
68 #ifndef LOG_DISABLED | 66 #ifndef LOG_DISABLED |
69 #define LOG_DISABLED !ENABLE(ASSERT) | 67 #define LOG_DISABLED !ENABLE(ASSERT) |
70 #endif | 68 #endif |
71 | 69 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 } \ | 322 } \ |
325 inline const thisType& to##thisType(const argumentType& argumentName) \ | 323 inline const thisType& to##thisType(const argumentType& argumentName) \ |
326 { \ | 324 { \ |
327 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ | 325 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ |
328 return static_cast<const thisType&>(argumentName); \ | 326 return static_cast<const thisType&>(argumentName); \ |
329 } \ | 327 } \ |
330 void to##thisType(const thisType*); \ | 328 void to##thisType(const thisType*); \ |
331 void to##thisType(const thisType&) | 329 void to##thisType(const thisType&) |
332 | 330 |
333 #endif /* WTF_Assertions_h */ | 331 #endif /* WTF_Assertions_h */ |
OLD | NEW |