OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. | |
3 * Copyright (C) 2007-2009 Torch Mobile, Inc. | |
4 * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. | |
5 * | |
6 * Redistribution and use in source and binary forms, with or without | |
7 * modification, are permitted provided that the following conditions | |
8 * are met: | |
9 * 1. Redistributions of source code must retain the above copyright | |
10 * notice, this list of conditions and the following disclaimer. | |
11 * 2. Redistributions in binary form must reproduce the above copyright | |
12 * notice, this list of conditions and the following disclaimer in the | |
13 * documentation and/or other materials provided with the distribution. | |
14 * | |
15 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | |
16 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | |
19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | |
22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | |
23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
26 */ | |
27 | |
28 #ifndef WTF_Platform_h | |
29 #define WTF_Platform_h | |
30 | |
31 /* Include compiler specific macros */ | |
32 #include <wtf/Compiler.h> | |
33 | |
34 /* ==== PLATFORM handles OS, operating environment, graphics API, and | |
35 CPU. This macro will be phased out in favor of platform adaptation | |
36 macros, policy decision macros, and top-level port definitions. ==== */ | |
37 #define PLATFORM(WTF_FEATURE) (defined WTF_PLATFORM_##WTF_FEATURE && WTF_PLATFO
RM_##WTF_FEATURE) | |
38 | |
39 | |
40 /* ==== Platform adaptation macros: these describe properties of the target envi
ronment. ==== */ | |
41 | |
42 /* CPU() - the target CPU architecture */ | |
43 #define CPU(WTF_FEATURE) (defined WTF_CPU_##WTF_FEATURE && WTF_CPU_##WTF_FEATUR
E) | |
44 /* HAVE() - specific system features (headers, functions or similar) that are pr
esent or not */ | |
45 #define HAVE(WTF_FEATURE) (defined HAVE_##WTF_FEATURE && HAVE_##WTF_FEATURE) | |
46 /* OS() - underlying operating system; only to be used for mandated low-level se
rvices like | |
47 virtual memory, not to choose a GUI toolkit */ | |
48 #define OS(WTF_FEATURE) (defined WTF_OS_##WTF_FEATURE && WTF_OS_##WTF_FEATURE) | |
49 | |
50 | |
51 /* ==== Policy decision macros: these define policy choices for a particular por
t. ==== */ | |
52 | |
53 /* USE() - use a particular third-party library or optional OS service */ | |
54 #define USE(WTF_FEATURE) (defined WTF_USE_##WTF_FEATURE && WTF_USE_##WTF_FEATUR
E) | |
55 /* ENABLE() - turn on a specific feature of WebKit */ | |
56 #define ENABLE(WTF_FEATURE) (defined ENABLE_##WTF_FEATURE && ENABLE_##WTF_FEATU
RE) | |
57 | |
58 | |
59 /* ==== CPU() - the target CPU architecture ==== */ | |
60 | |
61 /* This also defines CPU(BIG_ENDIAN) or CPU(MIDDLE_ENDIAN) or neither, as approp
riate. */ | |
62 | |
63 /* CPU(ALPHA) - DEC Alpha */ | |
64 #if defined(__alpha__) | |
65 #define WTF_CPU_ALPHA 1 | |
66 #endif | |
67 | |
68 /* CPU(IA64) - Itanium / IA-64 */ | |
69 #if defined(__ia64__) | |
70 #define WTF_CPU_IA64 1 | |
71 /* 32-bit mode on Itanium */ | |
72 #if !defined(__LP64__) | |
73 #define WTF_CPU_IA64_32 1 | |
74 #endif | |
75 #endif | |
76 | |
77 /* CPU(MIPS) - MIPS 32-bit */ | |
78 /* Note: Only O32 ABI is tested, so we enable it for O32 ABI for now. */ | |
79 #if (defined(mips) || defined(__mips__) || defined(MIPS) || defined(_MIPS_)) \ | |
80 && defined(_ABIO32) | |
81 #define WTF_CPU_MIPS 1 | |
82 #if defined(__MIPSEB__) | |
83 #define WTF_CPU_BIG_ENDIAN 1 | |
84 #endif | |
85 #define WTF_MIPS_PIC (defined __PIC__) | |
86 #define WTF_MIPS_ARCH __mips | |
87 #define WTF_MIPS_ISA(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH == v) | |
88 #define WTF_MIPS_ISA_AT_LEAST(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH >= v) | |
89 #define WTF_MIPS_ARCH_REV __mips_isa_rev | |
90 #define WTF_MIPS_ISA_REV(v) (defined WTF_MIPS_ARCH_REV && WTF_MIPS_ARCH_REV == v
) | |
91 #define WTF_MIPS_DOUBLE_FLOAT (defined __mips_hard_float && !defined __mips_sing
le_float) | |
92 #define WTF_MIPS_FP64 (defined __mips_fpr && __mips_fpr == 64) | |
93 /* MIPS requires allocators to use aligned memory */ | |
94 #define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 | |
95 #endif /* MIPS */ | |
96 | |
97 /* CPU(PPC) - PowerPC 32-bit */ | |
98 #if defined(__ppc__) \ | |
99 || defined(__PPC__) \ | |
100 || defined(__powerpc__) \ | |
101 || defined(__powerpc) \ | |
102 || defined(__POWERPC__) \ | |
103 || defined(_M_PPC) \ | |
104 || defined(__PPC) | |
105 #define WTF_CPU_PPC 1 | |
106 #define WTF_CPU_BIG_ENDIAN 1 | |
107 #endif | |
108 | |
109 /* CPU(PPC64) - PowerPC 64-bit */ | |
110 #if defined(__ppc64__) \ | |
111 || defined(__PPC64__) | |
112 #define WTF_CPU_PPC64 1 | |
113 #define WTF_CPU_BIG_ENDIAN 1 | |
114 #endif | |
115 | |
116 /* CPU(SH4) - SuperH SH-4 */ | |
117 #if defined(__SH4__) | |
118 #define WTF_CPU_SH4 1 | |
119 #endif | |
120 | |
121 /* CPU(SPARC32) - SPARC 32-bit */ | |
122 #if defined(__sparc) && !defined(__arch64__) || defined(__sparcv8) | |
123 #define WTF_CPU_SPARC32 1 | |
124 #define WTF_CPU_BIG_ENDIAN 1 | |
125 #endif | |
126 | |
127 /* CPU(SPARC64) - SPARC 64-bit */ | |
128 #if defined(__sparc__) && defined(__arch64__) || defined (__sparcv9) | |
129 #define WTF_CPU_SPARC64 1 | |
130 #define WTF_CPU_BIG_ENDIAN 1 | |
131 #endif | |
132 | |
133 /* CPU(SPARC) - any SPARC, true for CPU(SPARC32) and CPU(SPARC64) */ | |
134 #if CPU(SPARC32) || CPU(SPARC64) | |
135 #define WTF_CPU_SPARC 1 | |
136 #endif | |
137 | |
138 /* CPU(S390X) - S390 64-bit */ | |
139 #if defined(__s390x__) | |
140 #define WTF_CPU_S390X 1 | |
141 #define WTF_CPU_BIG_ENDIAN 1 | |
142 #endif | |
143 | |
144 /* CPU(S390) - S390 32-bit */ | |
145 #if defined(__s390__) | |
146 #define WTF_CPU_S390 1 | |
147 #define WTF_CPU_BIG_ENDIAN 1 | |
148 #endif | |
149 | |
150 /* CPU(X86) - i386 / x86 32-bit */ | |
151 #if defined(__i386__) \ | |
152 || defined(i386) \ | |
153 || defined(_M_IX86) \ | |
154 || defined(_X86_) \ | |
155 || defined(__THW_INTEL) | |
156 #define WTF_CPU_X86 1 | |
157 #endif | |
158 | |
159 /* CPU(X86_64) - AMD64 / Intel64 / x86_64 64-bit */ | |
160 #if defined(__x86_64__) \ | |
161 || defined(_M_X64) | |
162 #define WTF_CPU_X86_64 1 | |
163 #endif | |
164 | |
165 /* CPU(ARM) - ARM, any version*/ | |
166 #define WTF_ARM_ARCH_AT_LEAST(N) (CPU(ARM) && defined(WTF_ARM_ARCH_VERSION) && W
TF_ARM_ARCH_VERSION >= N) | |
167 | |
168 #if defined(arm) \ | |
169 || defined(__arm__) \ | |
170 || defined(ARM) \ | |
171 || defined(_ARM_) | |
172 #define WTF_CPU_ARM 1 | |
173 | |
174 #if defined(__ARM_PCS_VFP) | |
175 #define WTF_CPU_ARM_HARDFP 1 | |
176 #endif | |
177 | |
178 #if defined(__ARMEB__) || (COMPILER(RVCT) && defined(__BIG_ENDIAN)) | |
179 #define WTF_CPU_BIG_ENDIAN 1 | |
180 | |
181 #elif !defined(__ARM_EABI__) \ | |
182 && !defined(__EABI__) \ | |
183 && !defined(__VFP_FP__) \ | |
184 && !defined(_WIN32_WCE) \ | |
185 && !defined(ANDROID) | |
186 #define WTF_CPU_MIDDLE_ENDIAN 1 | |
187 | |
188 #endif | |
189 | |
190 /* Set WTF_ARM_ARCH_VERSION */ | |
191 #if defined(__ARM_ARCH_4__) \ | |
192 || defined(__ARM_ARCH_4T__) \ | |
193 || defined(__MARM_ARMV4__) | |
194 #define WTF_ARM_ARCH_VERSION 4 | |
195 | |
196 #elif defined(__ARM_ARCH_5__) \ | |
197 || defined(__ARM_ARCH_5T__) \ | |
198 || defined(__MARM_ARMV5__) | |
199 #define WTF_ARM_ARCH_VERSION 5 | |
200 | |
201 #elif defined(__ARM_ARCH_5E__) \ | |
202 || defined(__ARM_ARCH_5TE__) \ | |
203 || defined(__ARM_ARCH_5TEJ__) | |
204 #define WTF_ARM_ARCH_VERSION 5 | |
205 /*ARMv5TE requires allocators to use aligned memory*/ | |
206 #define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 | |
207 | |
208 #elif defined(__ARM_ARCH_6__) \ | |
209 || defined(__ARM_ARCH_6J__) \ | |
210 || defined(__ARM_ARCH_6K__) \ | |
211 || defined(__ARM_ARCH_6Z__) \ | |
212 || defined(__ARM_ARCH_6ZK__) \ | |
213 || defined(__ARM_ARCH_6T2__) \ | |
214 || defined(__ARMV6__) | |
215 #define WTF_ARM_ARCH_VERSION 6 | |
216 | |
217 #elif defined(__ARM_ARCH_7A__) \ | |
218 || defined(__ARM_ARCH_7R__) \ | |
219 || defined(__ARM_ARCH_7S__) | |
220 #define WTF_ARM_ARCH_VERSION 7 | |
221 | |
222 /* MSVC sets _M_ARM */ | |
223 #elif defined(_M_ARM) | |
224 #define WTF_ARM_ARCH_VERSION _M_ARM | |
225 | |
226 /* RVCT sets _TARGET_ARCH_ARM */ | |
227 #elif defined(__TARGET_ARCH_ARM) | |
228 #define WTF_ARM_ARCH_VERSION __TARGET_ARCH_ARM | |
229 | |
230 #if defined(__TARGET_ARCH_5E) \ | |
231 || defined(__TARGET_ARCH_5TE) \ | |
232 || defined(__TARGET_ARCH_5TEJ) | |
233 /*ARMv5TE requires allocators to use aligned memory*/ | |
234 #define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 | |
235 #endif | |
236 | |
237 #else | |
238 #define WTF_ARM_ARCH_VERSION 0 | |
239 | |
240 #endif | |
241 | |
242 /* Set WTF_THUMB_ARCH_VERSION */ | |
243 #if defined(__ARM_ARCH_4T__) | |
244 #define WTF_THUMB_ARCH_VERSION 1 | |
245 | |
246 #elif defined(__ARM_ARCH_5T__) \ | |
247 || defined(__ARM_ARCH_5TE__) \ | |
248 || defined(__ARM_ARCH_5TEJ__) | |
249 #define WTF_THUMB_ARCH_VERSION 2 | |
250 | |
251 #elif defined(__ARM_ARCH_6J__) \ | |
252 || defined(__ARM_ARCH_6K__) \ | |
253 || defined(__ARM_ARCH_6Z__) \ | |
254 || defined(__ARM_ARCH_6ZK__) \ | |
255 || defined(__ARM_ARCH_6M__) | |
256 #define WTF_THUMB_ARCH_VERSION 3 | |
257 | |
258 #elif defined(__ARM_ARCH_6T2__) \ | |
259 || defined(__ARM_ARCH_7__) \ | |
260 || defined(__ARM_ARCH_7A__) \ | |
261 || defined(__ARM_ARCH_7M__) \ | |
262 || defined(__ARM_ARCH_7R__) \ | |
263 || defined(__ARM_ARCH_7S__) | |
264 #define WTF_THUMB_ARCH_VERSION 4 | |
265 | |
266 /* RVCT sets __TARGET_ARCH_THUMB */ | |
267 #elif defined(__TARGET_ARCH_THUMB) | |
268 #define WTF_THUMB_ARCH_VERSION __TARGET_ARCH_THUMB | |
269 | |
270 #else | |
271 #define WTF_THUMB_ARCH_VERSION 0 | |
272 #endif | |
273 | |
274 | |
275 /* CPU(ARMV5_OR_LOWER) - ARM instruction set v5 or earlier */ | |
276 /* On ARMv5 and below the natural alignment is required. | |
277 And there are some other differences for v5 or earlier. */ | |
278 #if !defined(ARMV5_OR_LOWER) && !WTF_ARM_ARCH_AT_LEAST(6) | |
279 #define WTF_CPU_ARMV5_OR_LOWER 1 | |
280 #endif | |
281 | |
282 | |
283 /* CPU(ARM_TRADITIONAL) - Thumb2 is not available, only traditional ARM (v4 or g
reater) */ | |
284 /* CPU(ARM_THUMB2) - Thumb2 instruction set is available */ | |
285 /* Only one of these will be defined. */ | |
286 #if !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2) | |
287 # if defined(thumb2) || defined(__thumb2__) \ | |
288 || ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4) | |
289 # define WTF_CPU_ARM_TRADITIONAL 0 | |
290 # define WTF_CPU_ARM_THUMB2 1 | |
291 # elif WTF_ARM_ARCH_AT_LEAST(4) | |
292 # define WTF_CPU_ARM_TRADITIONAL 1 | |
293 # define WTF_CPU_ARM_THUMB2 0 | |
294 # else | |
295 # error "Not supported ARM architecture" | |
296 # endif | |
297 #elif CPU(ARM_TRADITIONAL) && CPU(ARM_THUMB2) /* Sanity Check */ | |
298 # error "Cannot use both of WTF_CPU_ARM_TRADITIONAL and WTF_CPU_ARM_THUMB2 plat
forms" | |
299 #endif /* !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2) */ | |
300 | |
301 #if defined(__ARM_NEON__) && !defined(WTF_CPU_ARM_NEON) | |
302 #define WTF_CPU_ARM_NEON 1 | |
303 #endif | |
304 | |
305 #if CPU(ARM_NEON) && (!COMPILER(GCC) || GCC_VERSION_AT_LEAST(4, 7, 0)) | |
306 // All NEON intrinsics usage can be disabled by this macro. | |
307 #define HAVE_ARM_NEON_INTRINSICS 1 | |
308 #endif | |
309 | |
310 #if (defined(__VFP_FP__) && !defined(__SOFTFP__)) | |
311 #define WTF_CPU_ARM_VFP 1 | |
312 #endif | |
313 | |
314 #if defined(__ARM_ARCH_7S__) | |
315 #define WTF_CPU_APPLE_ARMV7S 1 | |
316 #endif | |
317 | |
318 #endif /* ARM */ | |
319 | |
320 #if CPU(ARM) || CPU(MIPS) || CPU(SH4) || CPU(SPARC) | |
321 #define WTF_CPU_NEEDS_ALIGNED_ACCESS 1 | |
322 #endif | |
323 | |
324 /* ==== OS() - underlying operating system; only to be used for mandated low-lev
el services like | |
325 virtual memory, not to choose a GUI toolkit ==== */ | |
326 | |
327 /* OS(ANDROID) - Android */ | |
328 #ifdef ANDROID | |
329 #define WTF_OS_ANDROID 1 | |
330 #endif | |
331 | |
332 /* OS(AIX) - AIX */ | |
333 #ifdef _AIX | |
334 #define WTF_OS_AIX 1 | |
335 #endif | |
336 | |
337 /* OS(DARWIN) - Any Darwin-based OS, including Mac OS X and iPhone OS */ | |
338 #ifdef __APPLE__ | |
339 #define WTF_OS_DARWIN 1 | |
340 | |
341 #include <Availability.h> | |
342 #include <AvailabilityMacros.h> | |
343 #include <TargetConditionals.h> | |
344 #endif | |
345 | |
346 /* OS(IOS) - iOS */ | |
347 /* OS(MAC_OS_X) - Mac OS X (not including iOS) */ | |
348 #if OS(DARWIN) && ((defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) \ | |
349 || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) \ | |
350 || (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR)) | |
351 #define WTF_OS_IOS 1 | |
352 #elif OS(DARWIN) && defined(TARGET_OS_MAC) && TARGET_OS_MAC | |
353 #define WTF_OS_MAC_OS_X 1 | |
354 | |
355 /* FIXME: These can be removed after sufficient time has passed since the remova
l of BUILDING_ON / TARGETING macros. */ | |
356 | |
357 #define ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MIN_REQUIRED 0 / 0 | |
358 #define ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MAX_ALLOWED 0 / 0 | |
359 | |
360 #define BUILDING_ON_LEOPARD ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MIN_REQUI
RED | |
361 #define BUILDING_ON_SNOW_LEOPARD ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MIN_
REQUIRED | |
362 #define BUILDING_ON_LION ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MIN_REQUIRED | |
363 | |
364 #define TARGETING_LEOPARD ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MAX_ALLOWED | |
365 #define TARGETING_SNOW_LEOPARD ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MAX_AL
LOWED | |
366 #define TARGETING_LION ERROR_PLEASE_COMPARE_WITH_MAC_OS_X_VERSION_MAX_ALLOWED | |
367 #endif | |
368 | |
369 /* OS(FREEBSD) - FreeBSD */ | |
370 #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__
) | |
371 #define WTF_OS_FREEBSD 1 | |
372 #endif | |
373 | |
374 /* OS(HURD) - GNU/Hurd */ | |
375 #ifdef __GNU__ | |
376 #define WTF_OS_HURD 1 | |
377 #endif | |
378 | |
379 /* OS(LINUX) - Linux */ | |
380 #ifdef __linux__ | |
381 #define WTF_OS_LINUX 1 | |
382 #endif | |
383 | |
384 /* OS(NETBSD) - NetBSD */ | |
385 #if defined(__NetBSD__) | |
386 #define WTF_OS_NETBSD 1 | |
387 #endif | |
388 | |
389 /* OS(OPENBSD) - OpenBSD */ | |
390 #ifdef __OpenBSD__ | |
391 #define WTF_OS_OPENBSD 1 | |
392 #endif | |
393 | |
394 /* OS(QNX) - QNX */ | |
395 #if defined(__QNXNTO__) | |
396 #define WTF_OS_QNX 1 | |
397 #endif | |
398 | |
399 /* OS(SOLARIS) - Solaris */ | |
400 #if defined(sun) || defined(__sun) | |
401 #define WTF_OS_SOLARIS 1 | |
402 #endif | |
403 | |
404 /* OS(WINCE) - Windows CE; note that for this platform OS(WINDOWS) is also defin
ed */ | |
405 #if defined(_WIN32_WCE) | |
406 #define WTF_OS_WINCE 1 | |
407 #endif | |
408 | |
409 /* OS(WINDOWS) - Any version of Windows */ | |
410 #if defined(WIN32) || defined(_WIN32) | |
411 #define WTF_OS_WINDOWS 1 | |
412 #endif | |
413 | |
414 #define WTF_OS_WIN ERROR "USE WINDOWS WITH OS NOT WIN" | |
415 #define WTF_OS_MAC ERROR "USE MAC_OS_X WITH OS NOT MAC" | |
416 | |
417 /* OS(UNIX) - Any Unix-like system */ | |
418 #if OS(AIX) \ | |
419 || OS(ANDROID) \ | |
420 || OS(DARWIN) \ | |
421 || OS(FREEBSD) \ | |
422 || OS(HURD) \ | |
423 || OS(LINUX) \ | |
424 || OS(NETBSD) \ | |
425 || OS(OPENBSD) \ | |
426 || OS(QNX) \ | |
427 || OS(SOLARIS) \ | |
428 || defined(unix) \ | |
429 || defined(__unix) \ | |
430 || defined(__unix__) | |
431 #define WTF_OS_UNIX 1 | |
432 #endif | |
433 | |
434 /* Operating environments */ | |
435 | |
436 /* FIXME: This should go away since we're only building chromium now */ | |
437 #define WTF_PLATFORM_CHROMIUM 1 | |
438 | |
439 /* Graphics engines */ | |
440 | |
441 /* USE(SKIA) for Win/Linux/Mac/Android */ | |
442 #if OS(DARWIN) | |
443 #define WTF_USE_SKIA 1 | |
444 #define WTF_USE_ICCJPEG 1 | |
445 #define WTF_USE_QCMSLIB 1 | |
446 #elif OS(ANDROID) | |
447 #define WTF_USE_SKIA 1 | |
448 #define WTF_USE_LOW_QUALITY_IMAGE_INTERPOLATION 1 | |
449 #define WTF_USE_LOW_QUALITY_IMAGE_NO_JPEG_DITHERING 1 | |
450 #define WTF_USE_LOW_QUALITY_IMAGE_NO_JPEG_FANCY_UPSAMPLING 1 | |
451 #else | |
452 #define WTF_USE_SKIA 1 | |
453 #define WTF_USE_ICCJPEG 1 | |
454 #define WTF_USE_QCMSLIB 1 | |
455 #endif | |
456 | |
457 /* On Windows, use QueryPerformanceCounter by default */ | |
458 #if OS(WINDOWS) | |
459 #define WTF_USE_QUERY_PERFORMANCE_COUNTER 1 | |
460 #endif | |
461 | |
462 #define WTF_USE_ICU_UNICODE 1 | |
463 | |
464 #if OS(DARWIN) | |
465 #define WTF_USE_CF 1 | |
466 #define WTF_USE_WK_SCROLLBAR_PAINTER 1 | |
467 | |
468 /* We can't override the global operator new and delete on OS(DARWIN) because | |
469 * some object are allocated by WebKit and deallocated by the embedder. */ | |
470 #else /* !OS(DARWIN) */ | |
471 /* On non-OS(DARWIN), the "system malloc" is actually TCMalloc anyway, so there'
s | |
472 * no need to use WebKit's copy of TCMalloc. */ | |
473 #define WTF_USE_SYSTEM_MALLOC 1 | |
474 #endif /* OS(DARWIN) */ | |
475 | |
476 #if OS(DARWIN) | |
477 #define ENABLE_PURGEABLE_MEMORY 1 | |
478 #endif /* OS(DARWIN) */ | |
479 | |
480 #if !defined(HAVE_ACCESSIBILITY) | |
481 #if !OS(ANDROID) | |
482 #define HAVE_ACCESSIBILITY 1 | |
483 #endif | |
484 #endif /* !defined(HAVE_ACCESSIBILITY) */ | |
485 | |
486 #if OS(UNIX) | |
487 #define HAVE_ERRNO_H 1 | |
488 #define HAVE_MMAP 1 | |
489 #define HAVE_SIGNAL_H 1 | |
490 #define HAVE_STRINGS_H 1 | |
491 #define HAVE_SYS_PARAM_H 1 | |
492 #define HAVE_SYS_TIME_H 1 | |
493 #define WTF_USE_OS_RANDOMNESS 1 | |
494 #define WTF_USE_PTHREADS 1 | |
495 #endif /* OS(UNIX) */ | |
496 | |
497 #if OS(UNIX) && !OS(ANDROID) | |
498 #define HAVE_LANGINFO_H 1 | |
499 #endif | |
500 | |
501 #if (OS(FREEBSD) || OS(OPENBSD)) && !defined(__GLIBC__) | |
502 #define HAVE_PTHREAD_NP_H 1 | |
503 #endif | |
504 | |
505 #if !defined(HAVE_VASPRINTF) | |
506 #if !COMPILER(MSVC) && !COMPILER(RVCT) && !COMPILER(MINGW) && !(COMPILER(GCC) &&
OS(QNX)) | |
507 #define HAVE_VASPRINTF 1 | |
508 #endif | |
509 #endif | |
510 | |
511 #if !defined(HAVE_STRNSTR) | |
512 #if OS(DARWIN) || (OS(FREEBSD) && !defined(__GLIBC__)) | |
513 #define HAVE_STRNSTR 1 | |
514 #endif | |
515 #endif | |
516 | |
517 #if !OS(WINDOWS) && !OS(SOLARIS) && !OS(ANDROID) | |
518 #define HAVE_TM_GMTOFF 1 | |
519 #define HAVE_TM_ZONE 1 | |
520 #define HAVE_TIMEGM 1 | |
521 #endif | |
522 | |
523 #if OS(DARWIN) | |
524 | |
525 #define HAVE_MERGESORT 1 | |
526 #define HAVE_SYS_TIMEB_H 1 | |
527 #define WTF_USE_ACCELERATE 1 | |
528 | |
529 #define HAVE_DISPATCH_H 1 | |
530 #define HAVE_MADV_FREE 1 | |
531 #define HAVE_PTHREAD_SETNAME_NP 1 | |
532 | |
533 #define HAVE_HOSTED_CORE_ANIMATION 1 | |
534 #define HAVE_MADV_FREE_REUSE 1 | |
535 | |
536 #endif /* OS(DARWIN) */ | |
537 | |
538 #if OS(WINDOWS) | |
539 #define HAVE_SYS_TIMEB_H 1 | |
540 #define HAVE_ALIGNED_MALLOC 1 | |
541 #define HAVE_ISDEBUGGERPRESENT 1 | |
542 #define HAVE_VIRTUALALLOC 1 | |
543 #define WTF_USE_OS_RANDOMNESS 1 | |
544 #endif | |
545 | |
546 /* ENABLE macro defaults */ | |
547 | |
548 /* FIXME: move out all ENABLE() defines from here to FeatureDefines.h */ | |
549 | |
550 /* Include feature macros */ | |
551 #include <wtf/FeatureDefines.h> | |
552 | |
553 /* FIXME: When all platforms' compositors can compute their own filter outsets,
we should remove this define. | |
554 https://bugs.webkit.org/show_bug.cgi?id=112830 */ | |
555 #if USE(CG) | |
556 #define HAVE_COMPOSITOR_FILTER_OUTSETS 1 | |
557 #endif | |
558 | |
559 #if !defined(WTF_USE_3D_GRAPHICS) | |
560 #define WTF_USE_3D_GRAPHICS 1 | |
561 #endif | |
562 | |
563 #if CPU(ARM_THUMB2) | |
564 #define ENABLE_BRANCH_COMPACTION 1 | |
565 #endif | |
566 | |
567 #if !defined(ENABLE_THREADING_LIBDISPATCH) && HAVE(DISPATCH_H) | |
568 #define ENABLE_THREADING_LIBDISPATCH 1 | |
569 #elif !defined(ENABLE_THREADING_OPENMP) && defined(_OPENMP) | |
570 #define ENABLE_THREADING_OPENMP 1 | |
571 #elif !defined(THREADING_GENERIC) | |
572 #define ENABLE_THREADING_GENERIC 1 | |
573 #endif | |
574 | |
575 #if !defined(WTF_USE_ZLIB) | |
576 #define WTF_USE_ZLIB 1 | |
577 #endif | |
578 | |
579 #endif /* WTF_Platform_h */ | |
OLD | NEW |