blob: 2805a898d4894971eaa4fa62456680cbf58bb27d [file] [log] [blame]
darin707988e2006-01-16 01:29:54 +00001/*
aroben@apple.com259fc312008-01-08 17:43:23 +00002 * Copyright (C) 2004, 2005, 2006 Apple Inc.
eric@webkit.org8b2edd02009-09-09 22:35:57 +00003 * Copyright (C) 2009 Google Inc. All rights reserved.
4 *
darin707988e2006-01-16 01:29:54 +00005 * 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
ddkilzerc8eccec2007-09-26 02:29:57 +000017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
darin707988e2006-01-16 01:29:54 +000019 *
20 */
21
mrowe@apple.com12b7c2d2008-09-04 21:00:02 +000022#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
jmalonzo@webkit.org6afc5d42008-09-04 20:26:16 +000023#include "autotoolsconfig.h"
24#endif
25
mjsbb863512006-05-09 09:27:55 +000026#include <wtf/Platform.h>
mjs3bfb61b2006-03-02 09:12:06 +000027
mjs@apple.comacbcc282010-01-05 08:58:28 +000028#if OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC)
sfalken@apple.com46fc85a2009-04-20 21:25:37 +000029#if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF)
30#define JS_EXPORTDATA __declspec(dllexport)
31#else
32#define JS_EXPORTDATA __declspec(dllimport)
33#endif
34#if defined(BUILDING_WebCore) || defined(BUILDING_WebKit)
35#define WEBKIT_EXPORTDATA __declspec(dllexport)
36#else
37#define WEBKIT_EXPORTDATA __declspec(dllimport)
38#endif
ap@apple.com1348bdf2010-01-08 00:15:05 +000039#define JS_EXPORTCLASS JS_EXPORTDATA
sfalken@apple.com46fc85a2009-04-20 21:25:37 +000040#else
41#define JS_EXPORTDATA
ap@apple.com1348bdf2010-01-08 00:15:05 +000042#define JS_EXPORTCLASS
sfalken@apple.combcff7fb2009-04-20 21:47:02 +000043#define WEBKIT_EXPORTDATA
sfalken@apple.com46fc85a2009-04-20 21:25:37 +000044#endif
45
bdash49e28762006-10-05 21:40:04 +000046#define MOBILE 0
weinigf18aae32006-08-03 21:55:57 +000047
mrowe@apple.com4d7e81e2007-11-20 16:06:23 +000048#ifdef __APPLE__
darin71e27492006-01-25 03:35:00 +000049#define HAVE_FUNC_USLEEP 1
weinigf18aae32006-08-03 21:55:57 +000050#endif /* __APPLE__ */
darin71e27492006-01-25 03:35:00 +000051
mjs@apple.comacbcc282010-01-05 08:58:28 +000052#if OS(WINDOWS)
darin707988e2006-01-16 01:29:54 +000053
sfalkenc3cff1c2006-05-26 00:36:30 +000054#ifndef _WIN32_WINNT
hyatt89166da2006-05-21 06:58:12 +000055#define _WIN32_WINNT 0x0500
sfalkenc3cff1c2006-05-26 00:36:30 +000056#endif
57
58#ifndef WINVER
59#define WINVER 0x0500
60#endif
61
aroben@apple.com06d35b92008-03-27 01:43:54 +000062// If we don't define these, they get defined in windef.h.
aroben@apple.com1840f962007-11-12 11:02:47 +000063// We want to use std::min and std::max.
arobenfee2e822007-06-12 21:50:34 +000064#ifndef max
arobena6c43b92006-12-08 22:34:07 +000065#define max max
arobenfee2e822007-06-12 21:50:34 +000066#endif
67#ifndef min
arobena6c43b92006-12-08 22:34:07 +000068#define min min
arobenfee2e822007-06-12 21:50:34 +000069#endif
70
kevino@webkit.org79fbef92007-11-24 00:52:18 +000071// CURL needs winsock, so don't prevent inclusion of it
bfulgham@webkit.org147773f2009-06-12 21:36:08 +000072#if !USE(CURL)
arobenfee2e822007-06-12 21:50:34 +000073#ifndef _WINSOCKAPI_
74#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
75#endif
bfulgham@webkit.org147773f2009-06-12 21:36:08 +000076#endif
bdashdb309122006-11-20 12:59:36 +000077
mjs@apple.comacbcc282010-01-05 08:58:28 +000078#endif /* OS(WINDOWS) */
weinigf18aae32006-08-03 21:55:57 +000079
eric@webkit.orgb8ec05a2009-11-20 06:03:15 +000080#if PLATFORM(ANDROID)
81#define WEBCORE_NAVIGATOR_VENDOR "Google Inc."
82// This must be defined before we include FastMalloc.h, below.
83#define USE_SYSTEM_MALLOC 1
84#define LOG_DISABLED 1
85#include <wtf/Assertions.h>
86// Central place to set which optional features Android uses.
87#define ENABLE_CHANNEL_MESSAGING 1
88#define ENABLE_DOM_STORAGE 1
89#undef ENABLE_FTPDIR // Enabled by default in Platform.h
90#define ENABLE_FTPDIR 0
91#ifndef ENABLE_SVG
92#define ENABLE_SVG 0
93#endif
94#define ENABLE_VIDEO 1
95#define ENABLE_WORKERS 1
96#define ENABLE_XBL 0
dbates@webkit.orga8f3d6a2010-01-08 06:16:22 +000097#define ENABLE_XHTMLMP 0
eric@webkit.orgb8ec05a2009-11-20 06:03:15 +000098#define ENABLE_XPATH 0
99#define ENABLE_XSLT 0
100#define ENABLE_ARCHIVE 0
101#define ENABLE_OFFLINE_WEB_APPLICATIONS 1
102#undef ENABLE_GEOLOCATION // Disabled by default in Platform.h
103#define ENABLE_GEOLOCATION 1
104#undef ENABLE_INSPECTOR // Enabled by default in Platform.h
105#define ENABLE_INSPECTOR 0
106#define ENABLE_EVENT_SOURCE 0
107#endif /* PLATFORM(ANDROID) */
108
darin707988e2006-01-16 01:29:54 +0000109#ifdef __cplusplus
110
111// These undefs match up with defines in WebCorePrefix.h for Mac OS X.
112// Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h".
113#undef new
114#undef delete
mjsbb863512006-05-09 09:27:55 +0000115#include <wtf/FastMalloc.h>
darin707988e2006-01-16 01:29:54 +0000116
117#endif
eseidel864b4dd2006-02-24 01:11:00 +0000118
kevino@webkit.orgb7dc1ba2009-09-07 17:53:09 +0000119// On MSW, wx headers need to be included before windows.h is.
120// The only way we can always ensure this is if we include wx here.
121#if PLATFORM(WX)
122// The defines in KeyboardCodes.h conflict with Windows as well, and the only way I've found
123// to address the problem is include KeyboarddCodes.h before windows.h, so do it here.
124#include "KeyboardCodes.h"
125#include <wx/defs.h>
126#endif
127
kevinob9b68c92007-10-28 19:18:04 +0000128// this breaks compilation of <QFontDatabase>, at least, so turn it off for now
129// Also generates errors on wx on Windows, presumably because these functions
beidson@apple.comb3c7b2b2008-04-08 21:28:08 +0000130// are used from wx headers.
eric@webkit.org8b2edd02009-09-09 22:35:57 +0000131#if !PLATFORM(QT) && !PLATFORM(WX) && !PLATFORM(CHROMIUM)
darineb0d86d2007-10-16 20:13:24 +0000132#include <wtf/DisallowCType.h>
darin84ee4822007-10-16 22:02:41 +0000133#endif
darineb0d86d2007-10-16 20:13:24 +0000134
mrowe@apple.comfbe724c2008-09-03 23:46:54 +0000135#if COMPILER(MSVC)
136#define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
137#else
138#define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
eseidel864b4dd2006-02-24 01:11:00 +0000139#endif
anderscacd71fdd2006-09-14 01:56:44 +0000140
arobenfee2e822007-06-12 21:50:34 +0000141#if PLATFORM(WIN)
bfulgham@webkit.org5742b26b2009-07-13 18:34:44 +0000142#if defined(WIN_CAIRO)
143#undef WTF_PLATFORM_CG
144#define WTF_PLATFORM_CAIRO 1
145#undef WTF_USE_CFNETWORK
146#define WTF_USE_CURL 1
147#ifndef _WINSOCKAPI_
148#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
149#endif
150#else
arobenfee2e822007-06-12 21:50:34 +0000151#define WTF_PLATFORM_CG 1
152#undef WTF_PLATFORM_CAIRO
153#define WTF_USE_CFNETWORK 1
bfulgham@webkit.org5742b26b2009-07-13 18:34:44 +0000154#undef WTF_USE_CURL
155#endif
arobenfee2e822007-06-12 21:50:34 +0000156#undef WTF_USE_WININET
bfulgham@webkit.org147773f2009-06-12 21:36:08 +0000157#define WTF_PLATFORM_CF 1
158#define WTF_USE_PTHREADS 0
anderscacd71fdd2006-09-14 01:56:44 +0000159#endif
bdash880df152006-11-11 02:55:57 +0000160
mitz@apple.comc0b050b2008-09-06 22:39:34 +0000161#if PLATFORM(MAC)
simon.fraser@apple.comccf36902009-03-17 19:24:35 +0000162// ATSUI vs. CoreText
mitz@apple.comdc318202008-09-22 21:32:14 +0000163#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
164#define WTF_USE_ATSUI 0
165#define WTF_USE_CORE_TEXT 1
166#else
mitz@apple.comc0b050b2008-09-06 22:39:34 +0000167#define WTF_USE_ATSUI 1
168#define WTF_USE_CORE_TEXT 0
169#endif
simon.fraser@apple.comccf36902009-03-17 19:24:35 +0000170
171// New theme
hyatt@apple.com084394f2008-10-17 21:26:46 +0000172#define WTF_USE_NEW_THEME 1
simon.fraser@apple.comccf36902009-03-17 19:24:35 +0000173#endif // PLATFORM(MAC)
mitz@apple.comc0b050b2008-09-06 22:39:34 +0000174
mjs@apple.comacbcc282010-01-05 08:58:28 +0000175#if OS(SYMBIAN)
bdash880df152006-11-11 02:55:57 +0000176#undef WIN32
177#undef _WIN32
mrowe@apple.comfbe724c2008-09-03 23:46:54 +0000178#undef SKIP_STATIC_CONSTRUCTORS_ON_GCC
bdash880df152006-11-11 02:55:57 +0000179#define USE_SYSTEM_MALLOC 1
180#define U_HAVE_INT8_T 0
181#define U_HAVE_INT16_T 0
182#define U_HAVE_INT32_T 0
183#define U_HAVE_INT64_T 0
184#define U_HAVE_INTTYPES_H 0
185
186#include <stdio.h>
bdash880df152006-11-11 02:55:57 +0000187#include <limits.h>
188#include <wtf/MathExtras.h>
189#endif
arobenfee2e822007-06-12 21:50:34 +0000190
eric@webkit.org3eefe672008-09-04 01:32:26 +0000191#if PLATFORM(CHROMIUM)
eric@webkit.org8b2edd02009-09-09 22:35:57 +0000192
mjs@apple.comacbcc282010-01-05 08:58:28 +0000193#if !OS(DARWIN)
eric@webkit.org8b2edd02009-09-09 22:35:57 +0000194// Define SKIA on non-Mac.
195#define WTF_PLATFORM_SKIA 1
mjs@apple.comacbcc282010-01-05 08:58:28 +0000196#endif /* !OS(DARWIN) */
eric@webkit.org8b2edd02009-09-09 22:35:57 +0000197
198// Chromium uses this file instead of JavaScriptCore/config.h to compile
199// JavaScriptCore/wtf (chromium doesn't compile the rest of JSC). Therefore,
200// this define is required.
201#define WTF_CHANGES 1
202
203#define WTF_USE_GOOGLEURL 1
204
205#if !defined(WTF_USE_V8)
eric@webkit.org3eefe672008-09-04 01:32:26 +0000206#define WTF_USE_V8 1
eric@webkit.org8b2edd02009-09-09 22:35:57 +0000207#endif
208
209#undef WTF_USE_CFNETWORK
210
eric@webkit.org3eefe672008-09-04 01:32:26 +0000211#endif /* PLATFORM(CHROMIUM) */
eric@webkit.org8b2edd02009-09-09 22:35:57 +0000212
213#if !defined(WTF_USE_V8)
214#define WTF_USE_V8 0
eric@webkit.org3eefe672008-09-04 01:32:26 +0000215#endif /* !defined(WTF_USE_V8) */
216
217/* Using V8 implies not using JSC and vice versa */
218#define WTF_USE_JSC !WTF_USE_V8
219
arobenfee2e822007-06-12 21:50:34 +0000220#if PLATFORM(CG)
221#ifndef CGFLOAT_DEFINED
222#ifdef __LP64__
223typedef double CGFloat;
224#else
225typedef float CGFloat;
226#endif
227#define CGFLOAT_DEFINED 1
228#endif
229#endif /* PLATFORM(CG) */
aroben808a0022007-06-27 04:07:35 +0000230
beidson7a243282007-07-14 22:25:31 +0000231#ifdef BUILDING_ON_TIGER
weinig951fc8d2007-07-14 22:59:57 +0000232#undef ENABLE_FTPDIR
beidson7a243282007-07-14 22:25:31 +0000233#define ENABLE_FTPDIR 0
234#endif
mrowe@apple.com02a10022008-03-05 22:44:12 +0000235
236#if PLATFORM(WIN) && PLATFORM(CG)
237#define WTF_USE_SAFARI_THEME 1
238#endif