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 #include <wtf/ExportMacros.h>
37 #include "PlatformExportMacros.h"
39 #if PLATFORM(QT) && USE(V8)
40 #include <JavaScriptCore/runtime/JSExportMacros.h>
42 #include <runtime/JSExportMacros.h>
46 #define HAVE_FUNC_USLEEP 1
47 #endif /* __APPLE__ */
52 #define _WIN32_WINNT 0x0500
59 // If we don't define these, they get defined in windef.h.
60 // We want to use std::min and std::max.
68 // CURL needs winsock, so don't prevent inclusion of it
71 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
75 #endif /* OS(WINDOWS) */
79 // These undefs match up with defines in WebCorePrefix.h for Mac OS X.
80 // Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h".
83 #include <wtf/FastMalloc.h>
89 // On MSW, wx headers need to be included before windows.h is.
90 // The only way we can always ensure this is if we include wx here.
95 // this breaks compilation of <QFontDatabase>, at least, so turn it off for now
96 // Also generates errors on wx on Windows, presumably because these functions
97 // are used from wx headers. On GTK+ for Mac many GTK+ files include <libintl.h>
98 // or <glib/gi18n-lib.h>, which in turn include <xlocale/_ctype.h> which uses
100 #if !PLATFORM(QT) && !PLATFORM(WX) && !PLATFORM(CHROMIUM) && !(OS(DARWIN) && PLATFORM(GTK)) && !OS(QNX) && !defined(_LIBCPP_VERSION)
101 #include <wtf/DisallowCType.h>
105 #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
107 #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
111 #if PLATFORM(WIN_CAIRO)
113 #define WTF_USE_CAIRO 1
114 #define WTF_USE_CURL 1
116 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
127 #define WTF_USE_NEW_THEME 1
128 #endif // PLATFORM(MAC)
130 #if PLATFORM(CHROMIUM)
132 // Chromium uses this file instead of JavaScriptCore/config.h to compile
133 // JavaScriptCore/wtf (chromium doesn't compile the rest of JSC). Therefore,
134 // this define is required.
135 #define WTF_CHANGES 1
137 #define WTF_USE_GOOGLEURL 1
139 #endif /* PLATFORM(CHROMIUM) */
142 #ifndef CGFLOAT_DEFINED
144 typedef double CGFloat;
146 typedef float CGFloat;
148 #define CGFLOAT_DEFINED 1
152 #if PLATFORM(WIN) && USE(CG)
153 #define WTF_USE_SAFARI_THEME 1
156 // CoreAnimation is available to IOS, Mac and Windows if using CG
157 #if PLATFORM(MAC) || PLATFORM(IOS) || (PLATFORM(WIN) && USE(CG))
161 #if PLATFORM(QT) && USE(V8) && defined(Q_WS_X11)
162 /* protect ourselves from evil X11 defines */
163 #include <bridge/npruntime_internal.h>
166 // FIXME: Move this to JavaScriptCore/wtf/Platform.h, which is where we define WTF_USE_AVFOUNDATION on the Mac.
167 // https://bugs.webkit.org/show_bug.cgi?id=67334
168 #if PLATFORM(WIN) && HAVE(AVCF)
169 #define WTF_USE_AVFOUNDATION 1