]>
git.saurik.com Git - apple/javascriptcore.git/blob - wtf/Platform.h
1 /* -*- mode: c++; c-basic-offset: 4 -*- */
3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 #ifndef WTF_Platform_h
28 #define WTF_Platform_h
30 /* PLATFORM handles OS, operating environment, graphics API, and CPU */
31 #define PLATFORM(WTF_FEATURE) (defined( WTF_PLATFORM_##WTF_FEATURE ) && WTF_PLATFORM_##WTF_FEATURE)
32 #define COMPILER(WTF_FEATURE) (defined( WTF_COMPILER_##WTF_FEATURE ) && WTF_COMPILER_##WTF_FEATURE)
33 #define HAVE(WTF_FEATURE) (defined( HAVE_##WTF_FEATURE ) && HAVE_##WTF_FEATURE)
34 #define USE(WTF_FEATURE) (defined( WTF_USE_##WTF_FEATURE ) && WTF_USE_##WTF_FEATURE)
35 #define ENABLE(WTF_FEATURE) (defined( ENABLE_##WTF_FEATURE ) && ENABLE_##WTF_FEATURE)
37 /* Operating systems - low-level dependencies */
39 /* PLATFORM(DARWIN) */
40 /* Operating system level dependencies for Mac OS X / Darwin that should */
41 /* be used regardless of operating environment */
43 #define WTF_PLATFORM_DARWIN 1
46 /* PLATFORM(WIN_OS) */
47 /* Operating system level dependencies for Windows that should be used */
48 /* regardless of operating environment */
49 #if defined(WIN32) || defined(_WIN32)
50 #define WTF_PLATFORM_WIN_OS 1
53 /* PLATFORM(FREEBSD) */
54 /* Operating system level dependencies for FreeBSD-like systems that */
55 /* should be used regardless of operating environment */
57 #define WTF_PLATFORM_FREEBSD 1
60 /* PLATFORM(SOLARIS) */
61 /* Operating system level dependencies for Solaris that should be used */
62 /* regardless of operating environment */
63 #if defined(sun) || defined(__sun)
64 #define WTF_PLATFORM_SOLARIS 1
68 /* Operating system level dependencies for Unix-like systems that */
69 /* should be used regardless of operating environment */
70 #if PLATFORM(DARWIN) \
71 || PLATFORM(FREEBSD) \
74 || defined(__unix__) \
75 || defined (__NetBSD__) \
77 #define WTF_PLATFORM_UNIX 1
80 /* Operating environments */
86 #if defined(BUILDING_QT__)
87 #define WTF_PLATFORM_QT 1
90 #if defined(BUILDING_KDE__)
91 #define WTF_PLATFORM_KDE 1
94 #elif defined(BUILDING_WX__)
95 #define WTF_PLATFORM_WX 1
96 #elif defined(BUILDING_GTK__)
97 #define WTF_PLATFORM_GTK 1
98 #elif PLATFORM(DARWIN)
99 #define WTF_PLATFORM_MAC 1
100 #elif PLATFORM(WIN_OS)
101 #define WTF_PLATFORM_WIN 1
104 /* Graphics engines */
107 /* PLATFORM(CAIRO) */
109 #define WTF_PLATFORM_CG 1
110 #define WTF_PLATFORM_CI 1
111 #elif !PLATFORM(QT) && !PLATFORM(WX)
112 #define WTF_PLATFORM_CAIRO 1
117 // we are cross-compiling, it is not really windows
118 #undef WTF_PLATFORM_WIN_OS
119 #undef WTF_PLATFORM_WIN
120 #undef WTF_PLATFORM_CAIRO
121 #define WTF_PLATFORM_S60 1
122 #define WTF_PLATFORM_SYMBIAN 1
128 #if defined(__ppc__) \
129 || defined(__PPC__) \
130 || defined(__powerpc__) \
131 || defined(__powerpc) \
132 || defined(__POWERPC__) \
135 #define WTF_PLATFORM_PPC 1
136 #define WTF_PLATFORM_BIG_ENDIAN 1
139 /* PLATFORM(PPC64) */
140 #if defined(__ppc64__) \
141 || defined(__PPC64__)
142 #define WTF_PLATFORM_PPC64 1
143 #define WTF_PLATFORM_BIG_ENDIAN 1
149 #define WTF_PLATFORM_ARM 1
150 #if defined(__ARMEB__)
151 #define WTF_PLATFORM_BIG_ENDIAN 1
152 #elif !defined(__ARM_EABI__) && !defined(__ARMEB__) && !defined(__ARMEL__)
153 #define WTF_PLATFORM_MIDDLE_ENDIAN 1
155 #if !defined(__ARM_EABI__)
156 #define WTF_PLATFORM_FORCE_PACK 1
161 #if defined(__i386__) \
163 || defined(_M_IX86) \
165 || defined(__THW_INTEL)
166 #define WTF_PLATFORM_X86 1
169 /* PLATFORM(X86_64) */
170 #if defined(__x86_64__) \
171 || defined(__ia64__) \
173 #define WTF_PLATFORM_X86_64 1
178 #define WTF_PLATFORM_CG 1
179 #define WTF_PLATFORM_MAC 1
180 #include <TargetConditionals.h>
183 /* PLATFORM(IPHONE) */
184 #if TARGET_OS_EMBEDDED || TARGET_OS_IPHONE
185 #define WTF_PLATFORM_IPHONE 1
188 /* PLATFORM(IPHONE_SIMULATOR) */
189 #if TARGET_IPHONE_SIMULATOR
190 #define WTF_PLATFORM_IPHONE 1
191 #define WTF_PLATFORM_IPHONE_SIMULATOR 1
193 #define WTF_PLATFORM_IPHONE_SIMULATOR 0
199 #if defined(_MSC_VER)
200 #define WTF_COMPILER_MSVC 1
202 #define WTF_COMPILER_MSVC7 1
207 #if defined(__GNUC__)
208 #define WTF_COMPILER_GCC 1
211 /* COMPILER(BORLAND) */
212 /* not really fully supported - is this relevant any more? */
213 #if defined(__BORLANDC__)
214 #define WTF_COMPILER_BORLAND 1
217 /* COMPILER(CYGWIN) */
218 /* not really fully supported - is this relevant any more? */
219 #if defined(__CYGWIN__)
220 #define WTF_COMPILER_CYGWIN 1
223 /* multiple threads only supported on Mac for now */
224 #define WTF_USE_MULTIPLE_THREADS 1
226 /* for Unicode, KDE uses Qt, everything else uses ICU */
227 #if PLATFORM(KDE) || PLATFORM(QT)
228 #define WTF_USE_QT4_UNICODE 1
229 #elif PLATFORM(SYMBIAN)
230 #define WTF_USE_SYMBIAN_UNICODE 1
232 #define WTF_USE_ICU_UNICODE 1
235 #if PLATFORM(IPHONE_SIMULATOR)
236 #define ENABLE_WEB_SCRIPT_DEBUG_SERVER 1
238 #define ENABLE_WEB_SCRIPT_DEBUG_SERVER 0
241 #define WTF_PLATFORM_CF 1
242 #define WTF_USE_PTHREADS 1
244 #define ENABLE_FTPDIR 1
245 #define ENABLE_JAVA_BINDINGS 0
246 #define ENABLE_ICONDATABASE 0
247 #define ENABLE_NETSCAPE_API 0
248 #define ENABLE_TOUCH_EVENTS 1
249 #define ENABLE_DASHBOARD_SUPPORT 0
250 #define ENABLE_IPHONE_PPT 1
252 #if !defined(WTF_PLATFORM_IPHONE)
253 #define WTF_PLATFORM_IPHONE 0
256 #if PLATFORM(DARWIN) && defined(__LP64__)
257 #define ENABLE_NETSCAPE_API 0
261 #define WTF_USE_WININET 1
265 #define WTF_USE_CURL 1
266 #define WTF_USE_PTHREADS 1
270 #define USE_SYSTEM_MALLOC 1
273 #if !defined(ENABLE_FTPDIR)
274 #define ENABLE_FTPDIR 1
277 #if !defined(ENABLE_JAVA_BINDINGS)
278 #define ENABLE_JAVA_BINDINGS 1
281 #if !defined(ENABLE_ICONDATABASE)
282 #define ENABLE_ICONDATABASE 1
285 #if !defined(ENABLE_DATABASE)
286 #define ENABLE_DATABASE 1
289 #if !defined(ENABLE_FTPDIR)
290 #define ENABLE_FTPDIR 1
293 #if !defined(ENABLE_NETSCAPE_API)
294 #define ENABLE_NETSCAPE_API 1
297 #if !defined(ENABLE_TOUCH_EVENTS)
298 #define ENABLE_TOUCH_EVENTS 0
301 #if !defined(ENABLE_DASHBOARD_SUPPORT)
302 #define ENABLE_DASHBOARD_SUPPORT 1
305 #if !defined(ENABLE_IPHONE_PPT)
306 #define ENABLE_IPHONE_PPT 0
309 #endif /* WTF_Platform_h */