Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebCommon_h | 31 #ifndef WebCommon_h |
| 32 #define WebCommon_h | 32 #define WebCommon_h |
| 33 | 33 |
| 34 #include "../common/WebAssertion.h" | |
|
jamesr
2013/06/06 21:47:56
i could also make all API headers that want to use
| |
| 35 | |
| 34 // ----------------------------------------------------------------------------- | 36 // ----------------------------------------------------------------------------- |
| 35 // Default configuration | 37 // Default configuration |
| 36 | 38 |
| 37 #if !defined(WEBKIT_IMPLEMENTATION) | 39 #if !defined(WEBKIT_IMPLEMENTATION) |
| 38 #define WEBKIT_IMPLEMENTATION 0 | 40 #define WEBKIT_IMPLEMENTATION 0 |
| 39 #endif | 41 #endif |
| 40 | 42 |
| 41 // ----------------------------------------------------------------------------- | 43 // ----------------------------------------------------------------------------- |
| 42 // Exported symbols need to be annotated with WEBKIT_EXPORT | 44 // Exported symbols need to be annotated with WEBKIT_EXPORT |
| 43 | 45 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 73 // UTF-16 character type | 75 // UTF-16 character type |
| 74 #if defined(WIN32) | 76 #if defined(WIN32) |
| 75 typedef wchar_t WebUChar; | 77 typedef wchar_t WebUChar; |
| 76 #else | 78 #else |
| 77 typedef unsigned short WebUChar; | 79 typedef unsigned short WebUChar; |
| 78 #endif | 80 #endif |
| 79 | 81 |
| 80 // Latin-1 character type | 82 // Latin-1 character type |
| 81 typedef unsigned char WebLChar; | 83 typedef unsigned char WebLChar; |
| 82 | 84 |
| 83 // ----------------------------------------------------------------------------- | |
| 84 // Assertions | |
| 85 | |
| 86 WEBKIT_EXPORT void failedAssertion(const char* file, int line, const char* funct ion, const char* assertion); | |
| 87 | |
| 88 } // namespace WebKit | 85 } // namespace WebKit |
| 89 | 86 |
| 90 // Ideally, only use inside the public directory but outside of WEBKIT_IMPLEMENT ATION blocks. (Otherwise use WTF's ASSERT.) | |
| 91 #if defined(NDEBUG) | |
| 92 #define WEBKIT_ASSERT(assertion) ((void)0) | |
| 93 #else | |
| 94 #define WEBKIT_ASSERT(assertion) do { \ | |
| 95 if (!(assertion)) \ | |
| 96 failedAssertion(__FILE__, __LINE__, __FUNCTION__, #assertion); \ | |
| 97 } while (0) | |
| 98 #endif | 87 #endif |
| 99 | |
| 100 #define WEBKIT_ASSERT_NOT_REACHED() WEBKIT_ASSERT(0) | |
| 101 | |
| 102 #endif | |
| OLD | NEW |