2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 #ifndef WTF_Platform_h
27 #define WTF_Platform_h
29 /* PLATFORM handles OS, operating environment, graphics API, and CPU */
30 #define PLATFORM(WTF_FEATURE) (defined( WTF_PLATFORM_##WTF_FEATURE ) && WTF_PLATFORM_##WTF_FEATURE)
31 #define COMPILER(WTF_FEATURE) (defined( WTF_COMPILER_##WTF_FEATURE ) && WTF_COMPILER_##WTF_FEATURE)
32 #define HAVE(WTF_FEATURE) (defined( HAVE_##WTF_FEATURE ) && HAVE_##WTF_FEATURE)
33 #define USE(WTF_FEATURE) (defined( WTF_USE_##WTF_FEATURE ) && WTF_USE_##WTF_FEATURE)
34 #define ENABLE(WTF_FEATURE) (defined( ENABLE_##WTF_FEATURE ) && ENABLE_##WTF_FEATURE)
36 /* Operating systems - low-level dependencies */
38 /* PLATFORM(DARWIN) */
39 /* Operating system level dependencies for Mac OS X / Darwin that should */
40 /* be used regardless of operating environment */
42 #define WTF_PLATFORM_DARWIN 1
45 /* PLATFORM(WIN_OS) */
46 /* Operating system level dependencies for Windows that should be used */
47 /* regardless of operating environment */
48 #if defined(WIN32) || defined(_WIN32)
49 #define WTF_PLATFORM_WIN_OS 1
52 /* PLATFORM(WIN_CE) */
53 /* Operating system level dependencies for Windows CE that should be used */
54 /* regardless of operating environment */
55 /* Note that for this platform PLATFORM(WIN_OS) is also defined. */
56 #if defined(_WIN32_WCE)
57 #define WTF_PLATFORM_WIN_CE 1
60 /* PLATFORM(FREEBSD) */
61 /* Operating system level dependencies for FreeBSD-like systems that */
62 /* should be used regardless of operating environment */
64 #define WTF_PLATFORM_FREEBSD 1
67 /* PLATFORM(OPENBSD) */
68 /* Operating system level dependencies for OpenBSD systems that */
69 /* should be used regardless of operating environment */
71 #define WTF_PLATFORM_OPENBSD 1
74 /* PLATFORM(SOLARIS) */
75 /* Operating system level dependencies for Solaris that should be used */
76 /* regardless of operating environment */
77 #if defined(sun) || defined(__sun)
78 #define WTF_PLATFORM_SOLARIS 1
82 /* Operating system level dependencies for Unix-like systems that */
83 /* should be used regardless of operating environment */
84 #if PLATFORM(DARWIN) \
85 || PLATFORM(FREEBSD) \
88 || defined(__unix__) \
89 || defined (__NetBSD__) \
91 #define WTF_PLATFORM_UNIX 1
94 /* PLATFORM(CHROMIUM) */
95 #if defined(BUILDING_CHROMIUM__)
96 #define WTF_PLATFORM_CHROMIUM 1
99 /* Operating environments */
105 #if defined(BUILDING_QT__)
106 #define WTF_PLATFORM_QT 1
109 #if defined(BUILDING_KDE__)
110 #define WTF_PLATFORM_KDE 1
113 #elif defined(BUILDING_WX__)
114 #define WTF_PLATFORM_WX 1
115 #elif defined(BUILDING_GTK__)
116 #define WTF_PLATFORM_GTK 1
117 #elif PLATFORM(DARWIN)
118 #define WTF_PLATFORM_MAC 1
119 #elif PLATFORM(WIN_OS)
120 #define WTF_PLATFORM_WIN 1
123 /* Graphics engines */
125 /* PLATFORM(CG) and PLATFORM(CI) */
127 #define WTF_PLATFORM_CG 1
128 #define WTF_PLATFORM_CI 1
132 #if PLATFORM(CHROMIUM)
133 #define WTF_PLATFORM_SKIA 1
136 /* Makes PLATFORM(WIN) default to PLATFORM(CAIRO) */
137 #if !PLATFORM(MAC) && !PLATFORM(QT) && !PLATFORM(WX)
138 #define WTF_PLATFORM_CAIRO 1
142 // we are cross-compiling, it is not really windows
143 #undef WTF_PLATFORM_WIN_OS
144 #undef WTF_PLATFORM_WIN
145 #undef WTF_PLATFORM_CAIRO
146 #define WTF_PLATFORM_S60 1
147 #define WTF_PLATFORM_SYMBIAN 1
153 #if defined(__ppc__) \
154 || defined(__PPC__) \
155 || defined(__powerpc__) \
156 || defined(__powerpc) \
157 || defined(__POWERPC__) \
160 #define WTF_PLATFORM_PPC 1
161 #define WTF_PLATFORM_BIG_ENDIAN 1
164 /* PLATFORM(PPC64) */
165 #if defined(__ppc64__) \
166 || defined(__PPC64__)
167 #define WTF_PLATFORM_PPC64 1
168 #define WTF_PLATFORM_BIG_ENDIAN 1
174 #define WTF_PLATFORM_ARM 1
175 #if defined(__ARMEB__)
176 #define WTF_PLATFORM_BIG_ENDIAN 1
177 #elif !defined(__ARM_EABI__) && !defined(__ARMEB__) && !defined(__VFP_FP__)
178 #define WTF_PLATFORM_MIDDLE_ENDIAN 1
180 #if !defined(__ARM_EABI__)
181 #define WTF_PLATFORM_FORCE_PACK 1
186 #if defined(__i386__) \
188 || defined(_M_IX86) \
190 || defined(__THW_INTEL)
191 #define WTF_PLATFORM_X86 1
194 /* PLATFORM(X86_64) */
195 #if defined(__x86_64__) \
196 || defined(__ia64__) \
198 #define WTF_PLATFORM_X86_64 1
201 /* PLATFORM(SPARC64) */
202 #if defined(__sparc64__)
203 #define WTF_PLATFORM_SPARC64 1
204 #define WTF_PLATFORM_BIG_ENDIAN 1
210 #if defined(_MSC_VER)
211 #define WTF_COMPILER_MSVC 1
213 #define WTF_COMPILER_MSVC7 1
218 #if defined(__GNUC__)
219 #define WTF_COMPILER_GCC 1
222 /* COMPILER(MINGW) */
223 #if defined(MINGW) || defined(__MINGW32__)
224 #define WTF_COMPILER_MINGW 1
227 /* COMPILER(BORLAND) */
228 /* not really fully supported - is this relevant any more? */
229 #if defined(__BORLANDC__)
230 #define WTF_COMPILER_BORLAND 1
233 /* COMPILER(CYGWIN) */
234 /* not really fully supported - is this relevant any more? */
235 #if defined(__CYGWIN__)
236 #define WTF_COMPILER_CYGWIN 1
239 #if (PLATFORM(MAC) || PLATFORM(WIN)) && !defined(ENABLE_JSC_MULTIPLE_THREADS)
240 #define ENABLE_JSC_MULTIPLE_THREADS 1
243 /* for Unicode, KDE uses Qt */
244 #if PLATFORM(KDE) || PLATFORM(QT)
245 #define WTF_USE_QT4_UNICODE 1
246 #elif PLATFORM(SYMBIAN)
247 #define WTF_USE_SYMBIAN_UNICODE 1
249 /* The GTK+ Unicode backend is configurable */
251 #define WTF_USE_ICU_UNICODE 1
255 #define WTF_PLATFORM_CF 1
256 #define WTF_USE_PTHREADS 1
257 #if !defined(ENABLE_MAC_JAVA_BRIDGE)
258 #define ENABLE_MAC_JAVA_BRIDGE 1
260 #if !defined(ENABLE_DASHBOARD_SUPPORT)
261 #define ENABLE_DASHBOARD_SUPPORT 1
263 #define HAVE_READLINE 1
264 #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
265 #define HAVE_DTRACE 1
270 #define WTF_USE_WININET 1
274 #define WTF_USE_CURL 1
275 #define WTF_USE_PTHREADS 1
278 #if PLATFORM(MAC) || PLATFORM(WIN) || PLATFORM(GTK)
279 #define HAVE_ACCESSIBILITY 1
283 #define HAVE_COMPUTED_GOTO 1
288 #define HAVE_ERRNO_H 1
290 #define HAVE_MERGESORT 1
292 #define HAVE_STRINGS_H 1
293 #define HAVE_SYS_PARAM_H 1
294 #define HAVE_SYS_TIME_H 1
295 #define HAVE_SYS_TIMEB_H 1
297 #elif PLATFORM(WIN_OS)
299 #define HAVE_FLOAT_H 1
300 #define HAVE_SYS_TIMEB_H 1
301 #define HAVE_VIRTUALALLOC 1
305 /* FIXME: is this actually used or do other platforms generate their own config.h? */
307 #define HAVE_ERRNO_H 1
310 #define HAVE_STRINGS_H 1
311 #define HAVE_SYS_PARAM_H 1
312 #define HAVE_SYS_TIME_H 1
316 /* ENABLE macro defaults */
318 #if !defined(ENABLE_ICONDATABASE)
319 #define ENABLE_ICONDATABASE 1
322 #if !defined(ENABLE_DATABASE)
323 #define ENABLE_DATABASE 1
326 #if !defined(ENABLE_FTPDIR)
327 #define ENABLE_FTPDIR 1
330 #if !defined(ENABLE_DASHBOARD_SUPPORT)
331 #define ENABLE_DASHBOARD_SUPPORT 0
334 #if !defined(ENABLE_MAC_JAVA_BRIDGE)
335 #define ENABLE_MAC_JAVA_BRIDGE 0
338 #if !defined(ENABLE_NETSCAPE_PLUGIN_API)
339 #define ENABLE_NETSCAPE_PLUGIN_API 1
342 #if !defined(ENABLE_SAMPLING_TOOL)
343 #define ENABLE_SAMPLING_TOOL 0
346 // CTI only supports x86 at the moment, and has only been tested on Mac and Windows.
347 #if !defined(ENABLE_CTI) && PLATFORM(X86) && (PLATFORM(MAC) || PLATFORM(WIN))
351 // WREC only supports x86 at the moment, and has only been tested on Mac and Windows.
352 #if !defined(ENABLE_WREC) && PLATFORM(X86) && (PLATFORM(MAC) || PLATFORM(WIN))
353 #define ENABLE_WREC 1
356 #if ENABLE(CTI) || ENABLE(WREC)
357 #define ENABLE_MASM 1
360 /* Use the QtXmlStreamReader implementation for XMLTokenizer */
363 #define WTF_USE_QXMLSTREAM 1
368 #define WTF_USE_CTI_ARGUMENT 1
372 #define WTF_USE_FAST_CALL_CTI_ARGUMENT 1
375 #endif /* WTF_Platform_h */