blob: 2fb36a3676a852f06125356edeb58272c082d1ce [file] [log] [blame]
initial.commitf5b16fe2008-07-27 00:20:511/*
[email protected]de56f3782008-10-01 22:31:352 * Copyright (C) 2004, 2005, 2006 Apple Inc.
initial.commitf5b16fe2008-07-27 00:20:513 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 *
19 */
20
[email protected]de56f3782008-10-01 22:31:3521#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
22#include "autotoolsconfig.h"
23#endif
24
initial.commitf5b16fe2008-07-27 00:20:5125#include <wtf/Platform.h>
26
27#define MOBILE 0
28
[email protected]de56f3782008-10-01 22:31:3529#ifdef __APPLE__
initial.commitf5b16fe2008-07-27 00:20:5130#define HAVE_FUNC_USLEEP 1
31#endif /* __APPLE__ */
32
initial.commitf5b16fe2008-07-27 00:20:5133#if PLATFORM(WIN_OS)
34
35#ifndef _WIN32_WINNT
36#define _WIN32_WINNT 0x0500
37#endif
38
39#ifndef WINVER
40#define WINVER 0x0500
41#endif
42
[email protected]de56f3782008-10-01 22:31:3543// If we don't define these, they get defined in windef.h.
44// We want to use std::min and std::max.
initial.commitf5b16fe2008-07-27 00:20:5145#ifndef max
46#define max max
47#endif
48#ifndef min
49#define min min
50#endif
51
[email protected]de56f3782008-10-01 22:31:3552// CURL needs winsock, so don't prevent inclusion of it
53#if !USE(CURL)
initial.commitf5b16fe2008-07-27 00:20:5154#ifndef _WINSOCKAPI_
55#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
56#endif
[email protected]de56f3782008-10-01 22:31:3557#endif
initial.commitf5b16fe2008-07-27 00:20:5158
59#endif /* PLATFORM(WIN_OS) */
60
[email protected]de56f3782008-10-01 22:31:3561// On MSW, wx headers need to be included before windows.h is.
62// The only way we can always ensure this is if we include wx here.
63#if PLATFORM(WX)
64// The defines in KeyboardCodes.h conflict with Windows as well, and the only way I've found
65// to address the problem is include KeyboarddCodes.h before windows.h, so do it here.
66#include "KeyboardCodes.h"
67#include <wx/defs.h>
68#endif
69
initial.commitf5b16fe2008-07-27 00:20:5170#if !PLATFORM(SYMBIAN)
71#define IMPORT_C
72#define EXPORT_C
73#endif
74
[email protected]42179c2e2009-02-20 16:36:0775#define WTF_CHANGES 1
76
initial.commitf5b16fe2008-07-27 00:20:5177#ifdef __cplusplus
78
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".
81#undef new
82#undef delete
83#include <wtf/FastMalloc.h>
84
85#endif
86
87// this breaks compilation of <QFontDatabase>, at least, so turn it off for now
88// Also generates errors on wx on Windows, presumably because these functions
89// are used from wx headers.
[email protected]de56f3782008-10-01 22:31:3590#if !PLATFORM(QT) && !PLATFORM(WX) && !PLATFORM(CHROMIUM)
91#include <wtf/DisallowCType.h>
initial.commitf5b16fe2008-07-27 00:20:5192#endif
93
[email protected]de56f3782008-10-01 22:31:3594#if COMPILER(MSVC)
95#define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
96#else
97#define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
initial.commitf5b16fe2008-07-27 00:20:5198#endif
99
100#if PLATFORM(WIN)
[email protected]de56f3782008-10-01 22:31:35101#define WTF_PLATFORM_CG 1
102#undef WTF_PLATFORM_CAIRO
103#define WTF_USE_CFNETWORK 1
initial.commitf5b16fe2008-07-27 00:20:51104#undef WTF_USE_WININET
[email protected]de56f3782008-10-01 22:31:35105#define WTF_PLATFORM_CF 1
106#define WTF_USE_PTHREADS 0
initial.commitf5b16fe2008-07-27 00:20:51107#endif
108
109#if PLATFORM(SYMBIAN)
initial.commitf5b16fe2008-07-27 00:20:51110#undef WIN32
111#undef _WIN32
[email protected]de56f3782008-10-01 22:31:35112#undef SKIP_STATIC_CONSTRUCTORS_ON_GCC
initial.commitf5b16fe2008-07-27 00:20:51113#define USE_SYSTEM_MALLOC 1
114#define U_HAVE_INT8_T 0
115#define U_HAVE_INT16_T 0
116#define U_HAVE_INT32_T 0
117#define U_HAVE_INT64_T 0
118#define U_HAVE_INTTYPES_H 0
119
120#include <stdio.h>
121#include <snprintf.h>
122#include <limits.h>
123#include <wtf/MathExtras.h>
124#endif
125
[email protected]de56f3782008-10-01 22:31:35126#if PLATFORM(CHROMIUM)
[email protected]433902232008-12-18 18:46:40127
128#define WTF_USE_GOOGLEURL 1
129
[email protected]36975472009-03-13 14:53:02130#if PLATFORM(DARWIN)
131
132// Chromium's version of WebCore includes the following Objective-C classes.
133// The system-provided WebCore framework may also provide these classes.
134// Because of the nature of Objective-C binding (dynamically at runtime),
135// it's possible for the Chromium-provided versions to interfere with the
136// system-provided versions. This may happen when a system framework attempts
137// to use WebCore.framework, such as when converting an HTML-flavored string
138// to an NSAttributedString. The solution is to force Objective-C class names
139// that would conflict to use alternate names.
140//
141// TODO(mark): This list will hopefully shrink but may also grow. Periodically
142// run "nm libwebcore.a | grep -E '[atsATS] ([+-]\[|\.objc_class_name)'" and
143// make sure that everything listed there has the alternate ChromiumWebCoreObjC
144// name, and that nothing extraneous is listed here. If all Objective-C can
145// be eliminated from Chromium's WebCore library, these defines should be
146// removed entirely.
147
148#define ScrollbarPrefsObserver \
149 ChromiumWebCoreObjCScrollbarPrefsObserver
150#define WebCoreControlTintObserver \
151 ChromiumWebCoreObjCWebCoreControlTintObserver
152#define WebCoreRenderThemeNotificationObserver \
153 ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver
154#define WebFontCache \
155 ChromiumWebCoreObjCWebFontCache
156
157#else // !PLATFORM(DARWIN)
158
[email protected]c91996ae2008-10-22 17:23:24159// Don't define SKIA on Mac. Undefine other things as well that might get set
160// as side-effects.
[email protected]de56f3782008-10-01 22:31:35161#define WTF_PLATFORM_SKIA 1
[email protected]c91996ae2008-10-22 17:23:24162#undef WTF_PLATFORM_CG
163#undef WTF_PLATFORM_CF
[email protected]36975472009-03-13 14:53:02164
165#endif // !PLATFORM(DARWIN)
[email protected]f42cd7e2008-10-03 19:26:23166
[email protected]34024b382008-10-04 00:43:28167#if !defined(WTF_USE_V8)
168#define WTF_USE_V8 1
169#endif
170
[email protected]de56f3782008-10-01 22:31:35171#undef WTF_USE_CFNETWORK
[email protected]d03218c82008-10-02 00:29:35172// Upstream Platform.h's #ifdef check for other graphics libraries doesn't
173// check SKIA, so it falls back on defining CAIRO. Undo that here.
174// TODO(evanm): clean this up.
175#undef WTF_PLATFORM_CAIRO
[email protected]f42cd7e2008-10-03 19:26:23176#endif // if PLATFORM(CHROMIUM)
[email protected]de56f3782008-10-01 22:31:35177
178#if !defined(WTF_USE_V8)
179#define WTF_USE_V8 0
180#endif
181
182/* Using V8 implies not using JSC and vice versa */
183#define WTF_USE_JSC !WTF_USE_V8
184
initial.commitf5b16fe2008-07-27 00:20:51185#if PLATFORM(CG)
186#ifndef CGFLOAT_DEFINED
187#ifdef __LP64__
188typedef double CGFloat;
189#else
190typedef float CGFloat;
191#endif
192#define CGFLOAT_DEFINED 1
193#endif
194#endif /* PLATFORM(CG) */
195
[email protected]de56f3782008-10-01 22:31:35196#ifdef BUILDING_ON_TIGER
initial.commitf5b16fe2008-07-27 00:20:51197#undef ENABLE_FTPDIR
198#define ENABLE_FTPDIR 0
[email protected]de56f3782008-10-01 22:31:35199#endif
200
201#if PLATFORM(WIN) && PLATFORM(CG)
202#define WTF_USE_SAFARI_THEME 1
203#endif
[email protected]9cbe1c4c2008-09-08 23:20:27204
205#ifndef WEBCORE_NAVIGATOR_VENDOR
206#ifdef GOOGLE_CHROME_BUILD
207#define WEBCORE_NAVIGATOR_VENDOR "Google Inc."
208#else
209#define WEBCORE_NAVIGATOR_VENDOR ""
210#endif // ifdef GOOGLE_CHROME_BUILD
211#endif // ifndef WEBCORE_NAVIGATOR_VENDOR