2 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
34 #if !defined(BLINK_IMPLEMENTATION)
35 #define BLINK_IMPLEMENTATION 0
38 #if !defined(BLINK_PLATFORM_IMPLEMENTATION)
39 #define BLINK_PLATFORM_IMPLEMENTATION 0
42 #if !defined(BLINK_COMMON_IMPLEMENTATION)
43 #define BLINK_COMMON_IMPLEMENTATION 0
46 #if defined(COMPONENT_BUILD)
48 #if BLINK_IMPLEMENTATION
49 #define BLINK_EXPORT __declspec(dllexport)
50 #else // BLINK_IMPLEMENTATION
51 #define BLINK_EXPORT __declspec(dllimport)
53 #if BLINK_PLATFORM_IMPLEMENTATION
54 #define BLINK_PLATFORM_EXPORT __declspec(dllexport)
55 #else // BLINK_PLATFORM_IMPLEMENTATION
56 #define BLINK_PLATFORM_EXPORT __declspec(dllimport)
58 #if BLINK_COMMON_IMPLEMENTATION
59 #define BLINK_COMMON_EXPORT __declspec(dllexport)
60 #else // BLINK_COMMON_IMPLEMENTATION
61 #define BLINK_COMMON_EXPORT __declspec(dllimport)
63 #else // defined(WIN32)
64 #define BLINK_EXPORT __attribute__((visibility("default")))
65 #define BLINK_PLATFORM_EXPORT __attribute__((visibility("default")))
66 #define BLINK_COMMON_EXPORT __attribute__((visibility("default")))
69 #if BLINK_IMPLEMENTATION && !BLINK_CORE_IMPLEMENTATION && !BLINK_MODULES_IMPLEMENTATION
70 #define BLINK_WEB_IMPLEMENTATION 1
72 #define BLINK_WEB_IMPLEMENTATION 0
74 #else // defined(COMPONENT_BUILD)
76 #define BLINK_PLATFORM_EXPORT
77 #define BLINK_COMMON_EXPORT
79 #define BLINK_WEB_IMPLEMENTATION 0
83 // -----------------------------------------------------------------------------
86 #include <stddef.h> // For size_t
87 #include <stdint.h> // For int32_t
91 // UTF-32 character type
92 typedef int32_t WebUChar32
;
94 // UTF-16 character type
96 typedef wchar_t WebUChar
;
98 typedef unsigned short WebUChar
;
101 // Latin-1 character type
102 typedef unsigned char WebLChar
;
104 // -----------------------------------------------------------------------------
107 BLINK_COMMON_EXPORT
void failedAssertion(const char* file
, int line
, const char* function
, const char* assertion
);
111 // Ideally, only use inside the public directory but outside of INSIDE_BLINK blocks. (Otherwise use WTF's ASSERT.)
113 #define BLINK_ASSERT(assertion) ((void)0)
115 #define BLINK_ASSERT(assertion) do { \
117 failedAssertion(__FILE__, __LINE__, __FUNCTION__, #assertion); \
121 #define BLINK_ASSERT_NOT_REACHED() BLINK_ASSERT(0)