2 * Copyright (C) 2004, 2005, 2006 Apple Inc.
3 * Copyright (C) 2009 Google Inc. All rights reserved.
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.
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.
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.
22 #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
23 #ifdef BUILDING_WITH_CMAKE
24 #include "cmakeconfig.h"
26 #include "autotoolsconfig.h"
30 #include <wtf/Platform.h>
32 #if OS(WINDOWS) && !OS(WINCE) && !PLATFORM(QT) && !PLATFORM(CHROMIUM) && !PLATFORM(GTK) && !PLATFORM(WX)
33 #include <WebCore/WebCoreHeaderDetection.h>
36 /* See note in wtf/Platform.h for more info on EXPORT_MACROS. */
37 #if USE(EXPORT_MACROS)
39 #include <wtf/ExportMacros.h>
41 #if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF)
42 #define WTF_EXPORT_PRIVATE WTF_EXPORT
43 #define JS_EXPORT_PRIVATE WTF_EXPORT
45 #define WTF_EXPORT_PRIVATE WTF_IMPORT
46 #define JS_EXPORT_PRIVATE WTF_IMPORT
49 #define JS_EXPORTDATA JS_EXPORT_PRIVATE
50 #define JS_EXPORTCLASS JS_EXPORT_PRIVATE
52 #if defined(BUILDING_WebCore) || defined(BUILDING_WebKit)
53 #define WEBKIT_EXPORTDATA WTF_EXPORT
55 #define WEBKIT_EXPORTDATA WTF_IMPORT
58 #else /* !USE(EXPORT_MACROS) */
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)
64 #define JS_EXPORTDATA __declspec(dllimport)
66 #if defined(BUILDING_WebCore) || defined(BUILDING_WebKit)
67 #define WEBKIT_EXPORTDATA __declspec(dllexport)
69 #define WEBKIT_EXPORTDATA __declspec(dllimport)
71 #define WTF_EXPORT_PRIVATE
72 #define JS_EXPORT_PRIVATE
73 #define JS_EXPORTCLASS JS_EXPORTDATA
76 #define JS_EXPORTCLASS
77 #define WEBKIT_EXPORTDATA
78 #define WTF_EXPORT_PRIVATE
79 #define JS_EXPORT_PRIVATE
82 #endif /* USE(EXPORT_MACROS) */
85 #define HAVE_FUNC_USLEEP 1
86 #endif /* __APPLE__ */
91 #define _WIN32_WINNT 0x0500
98 // If we don't define these, they get defined in windef.h.
99 // We want to use std::min and std::max.
107 // CURL needs winsock, so don't prevent inclusion of it
110 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
114 #endif /* OS(WINDOWS) */
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".
122 #include <wtf/FastMalloc.h>
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.
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
137 #if !PLATFORM(QT) && !PLATFORM(WX) && !PLATFORM(CHROMIUM) && !(OS(DARWIN) && PLATFORM(GTK))
138 #include <wtf/DisallowCType.h>
142 #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
144 #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
148 #if PLATFORM(WIN_CAIRO)
150 #define WTF_USE_CAIRO 1
151 #define WTF_USE_CURL 1
153 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
164 #define WTF_USE_NEW_THEME 1
165 #endif // PLATFORM(MAC)
167 #if OS(UNIX) || OS(WINDOWS)
168 #define WTF_USE_OS_RANDOMNESS 1
171 #if PLATFORM(CHROMIUM)
173 // Chromium uses this file instead of JavaScriptCore/config.h to compile
174 // JavaScriptCore/wtf (chromium doesn't compile the rest of JSC). Therefore,
175 // this define is required.
176 #define WTF_CHANGES 1
178 #define WTF_USE_GOOGLEURL 1
180 #if !defined(WTF_USE_V8)
184 #endif /* PLATFORM(CHROMIUM) */
186 #if !defined(WTF_USE_V8)
188 #endif /* !defined(WTF_USE_V8) */
190 /* Using V8 implies not using JSC and vice versa */
191 #if !defined(WTF_USE_JSC)
192 #define WTF_USE_JSC !WTF_USE_V8
196 #ifndef CGFLOAT_DEFINED
198 typedef double CGFloat;
200 typedef float CGFloat;
202 #define CGFLOAT_DEFINED 1
206 #if PLATFORM(WIN) && USE(CG)
207 #define WTF_USE_SAFARI_THEME 1
210 // CoreAnimation is available to IOS, Mac and Windows if using CG
211 #if PLATFORM(MAC) || PLATFORM(IOS) || (PLATFORM(WIN) && USE(CG))
215 #if PLATFORM(QT) && USE(V8) && defined(Q_WS_X11)
216 /* protect ourselves from evil X11 defines */
217 #include <bridge/npruntime_internal.h>
220 // FIXME: Move this to JavaScriptCore/wtf/Platform.h, which is where we define WTF_USE_AVFOUNDATION on the Mac.
221 // https://bugs.webkit.org/show_bug.cgi?id=67334
222 #if PLATFORM(WIN) && HAVE(AVCF)
223 #define WTF_USE_AVFOUNDATION 1