initial import
[vuplus_webkit] / Source / WebCore / config.h
1 /*
2  * Copyright (C) 2004, 2005, 2006 Apple Inc.
3  * Copyright (C) 2009 Google Inc. All rights reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB.  If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  *
20  */ 
21
22 #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
23 #ifdef BUILDING_WITH_CMAKE
24 #include "cmakeconfig.h"
25 #else
26 #include "autotoolsconfig.h"
27 #endif
28 #endif
29
30 #include <wtf/Platform.h>
31
32 #if OS(WINDOWS) && !OS(WINCE) && !PLATFORM(QT) && !PLATFORM(CHROMIUM) && !PLATFORM(GTK) && !PLATFORM(WX)
33 #include <WebCore/WebCoreHeaderDetection.h>
34 #endif
35
36 /* See note in wtf/Platform.h for more info on EXPORT_MACROS. */
37 #if USE(EXPORT_MACROS)
38
39 #include <wtf/ExportMacros.h>
40
41 #if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF)
42 #define WTF_EXPORT_PRIVATE WTF_EXPORT
43 #define JS_EXPORT_PRIVATE WTF_EXPORT
44 #else
45 #define WTF_EXPORT_PRIVATE WTF_IMPORT
46 #define JS_EXPORT_PRIVATE WTF_IMPORT
47 #endif
48
49 #define JS_EXPORTDATA JS_EXPORT_PRIVATE
50 #define JS_EXPORTCLASS JS_EXPORT_PRIVATE
51
52 #if defined(BUILDING_WebCore) || defined(BUILDING_WebKit)
53 #define WEBKIT_EXPORTDATA WTF_EXPORT
54 #else
55 #define WEBKIT_EXPORTDATA WTF_IMPORT
56 #endif
57
58 #else /* !USE(EXPORT_MACROS) */
59
60 #if !PLATFORM(CHROMIUM) && OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC)
61 #if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF)
62 #define JS_EXPORTDATA __declspec(dllexport)
63 #else
64 #define JS_EXPORTDATA __declspec(dllimport)
65 #endif
66 #if defined(BUILDING_WebCore) || defined(BUILDING_WebKit)
67 #define WEBKIT_EXPORTDATA __declspec(dllexport)
68 #else
69 #define WEBKIT_EXPORTDATA __declspec(dllimport)
70 #endif
71 #define WTF_EXPORT_PRIVATE
72 #define JS_EXPORT_PRIVATE
73 #define JS_EXPORTCLASS JS_EXPORTDATA
74 #else
75 #define JS_EXPORTDATA
76 #define JS_EXPORTCLASS
77 #define WEBKIT_EXPORTDATA
78 #define WTF_EXPORT_PRIVATE
79 #define JS_EXPORT_PRIVATE
80 #endif
81
82 #endif /* USE(EXPORT_MACROS) */
83
84 #ifdef __APPLE__
85 #define HAVE_FUNC_USLEEP 1
86 #endif /* __APPLE__ */
87
88 #if OS(WINDOWS)
89
90 #ifndef _WIN32_WINNT
91 #define _WIN32_WINNT 0x0500
92 #endif
93
94 #ifndef WINVER
95 #define WINVER 0x0500
96 #endif
97
98 // If we don't define these, they get defined in windef.h.
99 // We want to use std::min and std::max.
100 #ifndef max
101 #define max max
102 #endif
103 #ifndef min
104 #define min min
105 #endif
106
107 // CURL needs winsock, so don't prevent inclusion of it
108 #if !USE(CURL)
109 #ifndef _WINSOCKAPI_
110 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
111 #endif
112 #endif
113
114 #endif /* OS(WINDOWS) */
115
116 #ifdef __cplusplus
117
118 // These undefs match up with defines in WebCorePrefix.h for Mac OS X.
119 // Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h".
120 #undef new
121 #undef delete
122 #include <wtf/FastMalloc.h>
123
124 #endif
125
126 // On MSW, wx headers need to be included before windows.h is.
127 // The only way we can always ensure this is if we include wx here.
128 #if PLATFORM(WX)
129 #include <wx/defs.h>
130 #endif
131
132 // this breaks compilation of <QFontDatabase>, at least, so turn it off for now
133 // Also generates errors on wx on Windows, presumably because these functions
134 // are used from wx headers. On GTK+ for Mac many GTK+ files include <libintl.h>
135 // or <glib/gi18n-lib.h>, which in turn include <xlocale/_ctype.h> which uses
136 // isacii(). 
137 #if !PLATFORM(QT) && !PLATFORM(WX) && !PLATFORM(CHROMIUM) && !(OS(DARWIN) && PLATFORM(GTK))
138 #include <wtf/DisallowCType.h>
139 #endif
140
141 #if COMPILER(MSVC)
142 #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
143 #elif !COMPILER(WINSCW)
144 #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
145 #endif
146
147 #if PLATFORM(WIN)
148 #if PLATFORM(WIN_CAIRO)
149 #undef WTF_USE_CG
150 #define WTF_USE_CAIRO 1
151 #define WTF_USE_CURL 1
152 #ifndef _WINSOCKAPI_
153 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
154 #endif
155 #elif !OS(WINCE)
156 #define WTF_USE_CG 1
157 #undef WTF_USE_CAIRO
158 #undef WTF_USE_CURL
159 #endif
160 #endif
161
162 #if PLATFORM(MAC)
163 // New theme
164 #define WTF_USE_NEW_THEME 1
165 #endif // PLATFORM(MAC)
166
167 #if OS(SYMBIAN)
168 #define USE_SYSTEM_MALLOC 1
169 #define ENABLE_PASSWORD_ECHO 1
170 #endif
171
172 #if OS(UNIX) || OS(WINDOWS)
173 #define WTF_USE_OS_RANDOMNESS 1
174 #endif
175
176 #if PLATFORM(CHROMIUM)
177
178 // Chromium uses this file instead of JavaScriptCore/config.h to compile
179 // JavaScriptCore/wtf (chromium doesn't compile the rest of JSC). Therefore,
180 // this define is required.
181 #define WTF_CHANGES 1
182
183 #define WTF_USE_GOOGLEURL 1
184
185 #if !defined(WTF_USE_V8)
186 #define WTF_USE_V8 1
187 #endif
188
189 #endif /* PLATFORM(CHROMIUM) */
190
191 #if !defined(WTF_USE_V8)
192 #define WTF_USE_V8 0
193 #endif /* !defined(WTF_USE_V8) */
194
195 /* Using V8 implies not using JSC and vice versa */
196 #if !defined(WTF_USE_JSC)
197 #define WTF_USE_JSC !WTF_USE_V8
198 #endif
199
200 #if USE(CG)
201 #ifndef CGFLOAT_DEFINED
202 #ifdef __LP64__
203 typedef double CGFloat;
204 #else
205 typedef float CGFloat;
206 #endif
207 #define CGFLOAT_DEFINED 1
208 #endif
209 #endif /* USE(CG) */
210
211 #if PLATFORM(WIN) && USE(CG)
212 #define WTF_USE_SAFARI_THEME 1
213 #endif
214
215 // CoreAnimation is available to IOS, Mac and Windows if using CG
216 #if PLATFORM(MAC) || PLATFORM(IOS) || (PLATFORM(WIN) && USE(CG))
217 #define WTF_USE_CA 1
218 #endif
219
220 #if PLATFORM(QT) && USE(V8) && defined(Q_WS_X11)
221 /* protect ourselves from evil X11 defines */
222 #include <bridge/npruntime_internal.h>
223 #endif
224
225 // FIXME: Move this to JavaScriptCore/wtf/Platform.h, which is where we define WTF_USE_AVFOUNDATION on the Mac.
226 // https://bugs.webkit.org/show_bug.cgi?id=67334
227 #if PLATFORM(WIN) && HAVE(AVCF)
228 #define WTF_USE_AVFOUNDATION 1
229 #endif