OSDN Git Service

1fb55eb8e837a8085252314bb05168c2ac3c36d4
[android-x86/external-webkit.git] / WebCore / config.h
1 /*
2  * Copyright (C) 2004, 2005, 2006 Apple Inc.
3  * 
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
21 #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
22 #include "autotoolsconfig.h"
23 #endif
24
25 #include <wtf/Platform.h>
26
27 #define MOBILE 0
28
29 #ifdef __APPLE__
30 #define HAVE_FUNC_USLEEP 1
31 #endif /* __APPLE__ */
32
33 #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
43 // If we don't define these, they get defined in windef.h.
44 // We want to use std::min and std::max.
45 #ifndef max
46 #define max max
47 #endif
48 #ifndef min
49 #define min min
50 #endif
51
52 // CURL needs winsock, so don't prevent inclusion of it
53 #if !USE(CURL)
54 #ifndef _WINSOCKAPI_
55 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
56 #endif
57 #endif
58
59 #endif /* PLATFORM(WIN_OS) */
60
61 // 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
70 // ANDROID def should be after all PLATFORM to avoid override.
71 // USE_SYSTEM_MALLOC needs to be defined before include FastMalloc.h
72 #ifdef ANDROID
73 #define USE_SYSTEM_MALLOC 1
74 #define ANDROID_MOBILE      // change can be merged back to WebKit.org for MOBILE
75 #ifdef ANDROID_PLUGINS
76 #define WTF_USE_JAVASCRIPTCORE_BINDINGS 1
77 #define WTF_USE_NPOBJECT 1
78 #endif
79 #define WTF_USE_LOW_BANDWIDTH_DISPLAY 1
80 #define LOG_DISABLED 1
81 #include <wtf/Assertions.h>
82 // center place to handle which option feature ANDROID will enable
83 #undef ENABLE_DATABASE
84 #define ENABLE_DATABASE 0
85 #undef ENABLE_FTPDIR
86 #define ENABLE_FTPDIR 0
87 #define ENABLE_SVG 0
88 #define ENABLE_SVG_EXPERIMENTAL_FEATURES 0
89 #define ENABLE_XBL 0
90 #define ENABLE_XPATH 0
91 #define ENABLE_XSLT 0
92 #define ENABLE_VIDEO 0
93 #undef ENABLE_ARCHIVE
94 #define ENABLE_ARCHIVE 0 // ANDROID addition: allow web archive to be disabled
95 #define ENABLE_OFFLINE_WEB_APPLICATIONS 0
96 #define ENABLE_TOUCH_EVENTS 1
97 #endif
98
99 #ifdef __cplusplus
100
101 // These undefs match up with defines in WebCorePrefix.h for Mac OS X.
102 // Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h".
103 #undef new
104 #undef delete
105 #include <wtf/FastMalloc.h>
106
107 #endif
108
109 // this breaks compilation of <QFontDatabase>, at least, so turn it off for now
110 // Also generates errors on wx on Windows, presumably because these functions
111 // are used from wx headers.
112 #if !PLATFORM(QT) && !PLATFORM(WX)
113 #include <wtf/DisallowCType.h>
114 #endif
115
116 #if COMPILER(MSVC)
117 #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
118 #else
119 #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
120 #endif
121
122 #if PLATFORM(WIN)
123 #define WTF_PLATFORM_CG 1
124 #undef WTF_PLATFORM_CAIRO
125 #define WTF_USE_CFNETWORK 1
126 #undef WTF_USE_WININET
127 #define WTF_PLATFORM_CF 1
128 #define WTF_USE_PTHREADS 0
129 #endif
130
131 #if PLATFORM(MAC)
132 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
133 #define WTF_USE_ATSUI 0
134 #define WTF_USE_CORE_TEXT 1
135 #else
136 #define WTF_USE_ATSUI 1
137 #define WTF_USE_CORE_TEXT 0
138 #endif
139 #define WTF_USE_NEW_THEME 1
140 #endif
141
142 #if PLATFORM(SYMBIAN)
143 #undef WIN32
144 #undef _WIN32
145 #undef SKIP_STATIC_CONSTRUCTORS_ON_GCC
146 #define USE_SYSTEM_MALLOC 1
147 #define U_HAVE_INT8_T 0
148 #define U_HAVE_INT16_T 0
149 #define U_HAVE_INT32_T 0
150 #define U_HAVE_INT64_T 0
151 #define U_HAVE_INTTYPES_H 0
152
153 #include <stdio.h>
154 #include <limits.h>
155 #include <wtf/MathExtras.h>
156 #endif
157
158 #if !defined(WTF_USE_V8)
159 /* Currently Chromium is the only platform which uses V8 by default */
160 #if PLATFORM(CHROMIUM)
161 #define WTF_USE_V8 1
162 #else
163 #define WTF_USE_V8 0
164 #endif /* PLATFORM(CHROMIUM) */
165 #endif /* !defined(WTF_USE_V8) */
166
167 /* Using V8 implies not using JSC and vice versa */
168 #define WTF_USE_JSC !WTF_USE_V8
169
170 #if PLATFORM(CG)
171 #ifndef CGFLOAT_DEFINED
172 #ifdef __LP64__
173 typedef double CGFloat;
174 #else
175 typedef float CGFloat;
176 #endif
177 #define CGFLOAT_DEFINED 1
178 #endif
179 #endif /* PLATFORM(CG) */
180
181 #ifdef BUILDING_ON_TIGER
182 #undef ENABLE_FTPDIR
183 #define ENABLE_FTPDIR 0
184 #endif
185
186 #if PLATFORM(WIN) && PLATFORM(CG)
187 #define WTF_USE_SAFARI_THEME 1
188 #endif