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
115 #if PLATFORM(WIN)&& PLATFORM(CG)
116 #define WTF_USE_SAFARI_THEME 1
120 // we are cross-compiling, it is not really windows
121 #undef WTF_PLATFORM_WIN_OS
122 #undef WTF_PLATFORM_WIN
123 #undef WTF_PLATFORM_CAIRO
124 #define WTF_PLATFORM_S60 1
125 #define WTF_PLATFORM_SYMBIAN 1
131 #if defined(__ppc__) \
132 || defined(__PPC__) \
133 || defined(__powerpc__) \
134 || defined(__powerpc) \
135 || defined(__POWERPC__) \
138 #define WTF_PLATFORM_PPC 1
139 #define WTF_PLATFORM_BIG_ENDIAN 1
142 /* PLATFORM(PPC64) */
143 #if defined(__ppc64__) \
144 || defined(__PPC64__)
145 #define WTF_PLATFORM_PPC64 1
146 #define WTF_PLATFORM_BIG_ENDIAN 1
151 #define WTF_PLATFORM_ARM 1
152 #if defined(__ARMEB__)
153 #define WTF_PLATFORM_BIG_ENDIAN 1
154 #elif !defined(__ARM_EABI__) && !defined(__ARMEB__)
155 #define WTF_PLATFORM_MIDDLE_ENDIAN 1
157 #if !defined(__ARM_EABI__)
158 #define WTF_PLATFORM_FORCE_PACK 1
163 #if defined(__i386__) \
165 || defined(_M_IX86) \
167 || defined(__THW_INTEL)
168 #define WTF_PLATFORM_X86 1
171 /* PLATFORM(X86_64) */
172 #if defined(__x86_64__) \
173 || defined(__ia64__) \
175 #define WTF_PLATFORM_X86_64 1
181 #if defined(_MSC_VER)
182 #define WTF_COMPILER_MSVC 1
184 #define WTF_COMPILER_MSVC7 1
189 #if defined(__GNUC__)
190 #define WTF_COMPILER_GCC 1
193 /* COMPILER(BORLAND) */
194 /* not really fully supported - is this relevant any more? */
195 #if defined(__BORLANDC__)
196 #define WTF_COMPILER_BORLAND 1
199 /* COMPILER(CYGWIN) */
200 /* not really fully supported - is this relevant any more? */
201 #if defined(__CYGWIN__)
202 #define WTF_COMPILER_CYGWIN 1
205 /* multiple threads only supported on Mac for now */
206 #if PLATFORM(MAC) || PLATFORM(WIN)
207 #define WTF_USE_MULTIPLE_THREADS 1
210 /* for Unicode, KDE uses Qt, everything else uses ICU */
211 #if PLATFORM(KDE) || PLATFORM(QT)
212 #define WTF_USE_QT4_UNICODE 1
213 #elif PLATFORM(SYMBIAN)
214 #define WTF_USE_SYMBIAN_UNICODE 1
216 #define WTF_USE_ICU_UNICODE 1
220 #define WTF_PLATFORM_CF 1
221 #define WTF_USE_PTHREADS 1
225 #define WTF_USE_WININET 1
229 #define WTF_USE_CURL 1
230 #define WTF_USE_PTHREADS 1
234 #define USE_SYSTEM_MALLOC 1
237 #if !defined(ENABLE_ICONDATABASE)
238 #define ENABLE_ICONDATABASE 1
241 #if !defined(ENABLE_DATABASE)
242 #define ENABLE_DATABASE 1
245 #if !defined(ENABLE_FTPDIR)
246 #define ENABLE_FTPDIR 1
249 #endif /* WTF_Platform_h */