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 |
11 * notice, this list of conditions and the following disclaimer in the | 11 * notice, this list of conditions and the following disclaimer in the |
12 * documentation and/or other materials provided with the distribution. | 12 * documentation and/or other materials provided with the distribution. |
13 * | 13 * |
14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #ifndef WTF_Assertions_h | 27 #ifndef WTF_Assertions_h |
28 #define WTF_Assertions_h | 28 #define WTF_Assertions_h |
29 | 29 |
30 /* | 30 /* |
31 No namespaces because this file has to be includable from C and Objective-C. | 31 No namespaces because this file has to be includable from C and Objective-C. |
32 | 32 |
33 Note, this file uses many GCC extensions, but it should be compatible with | 33 Note, this file uses many GCC extensions, but it should be compatible with |
34 C, Objective C, C++, and Objective C++. | 34 C, Objective C, C++, and Objective C++. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 #else | 90 #else |
91 #define WTF_PRETTY_FUNCTION __FUNCTION__ | 91 #define WTF_PRETTY_FUNCTION __FUNCTION__ |
92 #endif | 92 #endif |
93 | 93 |
94 /* WTF logging functions can process %@ in the format string to log a NSObject*
but the printf format attribute | 94 /* WTF logging functions can process %@ in the format string to log a NSObject*
but the printf format attribute |
95 emits a warning when %@ is used in the format string. Until <rdar://problem/
5195437> is resolved we can't include | 95 emits a warning when %@ is used in the format string. Until <rdar://problem/
5195437> is resolved we can't include |
96 the attribute when being used from Objective-C code in case it decides to use
%@. */ | 96 the attribute when being used from Objective-C code in case it decides to use
%@. */ |
97 #if COMPILER(GCC) && !defined(__OBJC__) | 97 #if COMPILER(GCC) && !defined(__OBJC__) |
98 #define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments) __attribute__
((__format__(printf, formatStringArgument, extraArguments))) | 98 #define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments) __attribute__
((__format__(printf, formatStringArgument, extraArguments))) |
99 #else | 99 #else |
100 #define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments) | 100 #define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments) |
101 #endif | 101 #endif |
102 | 102 |
103 /* These helper functions are always declared, but not necessarily always define
d if the corresponding function is disabled. */ | 103 /* These helper functions are always declared, but not necessarily always define
d if the corresponding function is disabled. */ |
104 | 104 |
105 #ifdef __cplusplus | 105 #ifdef __cplusplus |
106 extern "C" { | 106 extern "C" { |
107 #endif | 107 #endif |
108 | 108 |
109 typedef enum { WTFLogChannelOff, WTFLogChannelOn } WTFLogChannelState; | 109 typedef enum { WTFLogChannelOff, WTFLogChannelOn } WTFLogChannelState; |
110 | 110 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 #define RELEASE_ASSERT(assertion) (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH())
: (void)0) | 372 #define RELEASE_ASSERT(assertion) (UNLIKELY(!(assertion)) ? (IMMEDIATE_CRASH())
: (void)0) |
373 #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) RELEASE_ASSERT(assertion) | 373 #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) RELEASE_ASSERT(assertion) |
374 #define RELEASE_ASSERT_NOT_REACHED() IMMEDIATE_CRASH() | 374 #define RELEASE_ASSERT_NOT_REACHED() IMMEDIATE_CRASH() |
375 #else | 375 #else |
376 #define RELEASE_ASSERT(assertion) ASSERT(assertion) | 376 #define RELEASE_ASSERT(assertion) ASSERT(assertion) |
377 #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) ASSERT_WITH_MESSAGE(assertio
n, __VA_ARGS__) | 377 #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) ASSERT_WITH_MESSAGE(assertio
n, __VA_ARGS__) |
378 #define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED() | 378 #define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED() |
379 #endif | 379 #endif |
380 | 380 |
381 #endif /* WTF_Assertions_h */ | 381 #endif /* WTF_Assertions_h */ |
OLD | NEW |