OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007-2009 Torch Mobile, Inc. | 3 * Copyright (C) 2007-2009 Torch Mobile, Inc. |
4 * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. | 4 * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. |
| 5 * Copyright (C) 2013, Samsung Electronics. All rights reserved. |
5 * | 6 * |
6 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
8 * are met: | 9 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 11 * notice, this list of conditions and the following disclaimer. |
11 * 2. Redistributions in binary form must reproduce the above copyright | 12 * 2. Redistributions in binary form must reproduce the above copyright |
12 * notice, this list of conditions and the following disclaimer in the | 13 * notice, this list of conditions and the following disclaimer in the |
13 * documentation and/or other materials provided with the distribution. | 14 * documentation and/or other materials provided with the distribution. |
14 * | 15 * |
15 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 16 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
16 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 * (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 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 */ | 27 */ |
27 | 28 |
28 #ifndef WTF_Platform_h | 29 #ifndef WTF_CPU_h |
29 #define WTF_Platform_h | 30 #define WTF_CPU_h |
30 | 31 |
31 /* Include compiler specific macros */ | |
32 #include <wtf/Compiler.h> | 32 #include <wtf/Compiler.h> |
33 | 33 |
34 /* ==== Platform adaptation macros: these describe properties of the target envi
ronment. ==== */ | |
35 | |
36 /* CPU() - the target CPU architecture */ | 34 /* CPU() - the target CPU architecture */ |
37 #define CPU(WTF_FEATURE) (defined WTF_CPU_##WTF_FEATURE && WTF_CPU_##WTF_FEATUR
E) | 35 #define CPU(WTF_FEATURE) (defined WTF_CPU_##WTF_FEATURE && WTF_CPU_##WTF_FEATUR
E) |
38 /* HAVE() - specific system features (headers, functions or similar) that are pr
esent or not */ | |
39 #define HAVE(WTF_FEATURE) (defined HAVE_##WTF_FEATURE && HAVE_##WTF_FEATURE) | |
40 /* OS() - underlying operating system; only to be used for mandated low-level se
rvices like | |
41 virtual memory, not to choose a GUI toolkit */ | |
42 #define OS(WTF_FEATURE) (defined WTF_OS_##WTF_FEATURE && WTF_OS_##WTF_FEATURE) | |
43 | |
44 | |
45 /* ==== Policy decision macros: these define policy choices for a particular por
t. ==== */ | |
46 | |
47 /* USE() - use a particular third-party library or optional OS service */ | |
48 #define USE(WTF_FEATURE) (defined WTF_USE_##WTF_FEATURE && WTF_USE_##WTF_FEATUR
E) | |
49 /* ENABLE() - turn on a specific feature of WebKit */ | |
50 #define ENABLE(WTF_FEATURE) (defined ENABLE_##WTF_FEATURE && ENABLE_##WTF_FEATU
RE) | |
51 | |
52 | 36 |
53 /* ==== CPU() - the target CPU architecture ==== */ | 37 /* ==== CPU() - the target CPU architecture ==== */ |
54 | 38 |
55 /* This also defines CPU(BIG_ENDIAN) or CPU(MIDDLE_ENDIAN) or neither, as approp
riate. */ | 39 /* This also defines CPU(BIG_ENDIAN) or CPU(MIDDLE_ENDIAN) or neither, as approp
riate. */ |
56 | 40 |
57 /* CPU(ALPHA) - DEC Alpha */ | 41 /* CPU(ALPHA) - DEC Alpha */ |
58 #if defined(__alpha__) | 42 #if defined(__alpha__) |
59 #define WTF_CPU_ALPHA 1 | 43 #define WTF_CPU_ALPHA 1 |
60 #endif | 44 #endif |
61 | 45 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 // All NEON intrinsics usage can be disabled by this macro. | 244 // All NEON intrinsics usage can be disabled by this macro. |
261 #define HAVE_ARM_NEON_INTRINSICS 1 | 245 #define HAVE_ARM_NEON_INTRINSICS 1 |
262 #endif | 246 #endif |
263 | 247 |
264 #if defined(__ARM_ARCH_7S__) | 248 #if defined(__ARM_ARCH_7S__) |
265 #define WTF_CPU_APPLE_ARMV7S 1 | 249 #define WTF_CPU_APPLE_ARMV7S 1 |
266 #endif | 250 #endif |
267 | 251 |
268 #endif /* ARM */ | 252 #endif /* ARM */ |
269 | 253 |
270 /* ==== OS() - underlying operating system; only to be used for mandated low-lev
el services like | 254 #endif /* WTF_CPU_h */ |
271 virtual memory, not to choose a GUI toolkit ==== */ | |
272 | |
273 /* OS(ANDROID) - Android */ | |
274 #ifdef ANDROID | |
275 #define WTF_OS_ANDROID 1 | |
276 #endif | |
277 | |
278 /* OS(AIX) - AIX */ | |
279 #ifdef _AIX | |
280 #define WTF_OS_AIX 1 | |
281 #endif | |
282 | |
283 /* OS(DARWIN) - Any Darwin-based OS, including Mac OS X and iPhone OS */ | |
284 #ifdef __APPLE__ | |
285 #define WTF_OS_DARWIN 1 | |
286 | |
287 #include <Availability.h> | |
288 #include <AvailabilityMacros.h> | |
289 #include <TargetConditionals.h> | |
290 #endif | |
291 | |
292 /* OS(FREEBSD) - FreeBSD */ | |
293 #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__
) | |
294 #define WTF_OS_FREEBSD 1 | |
295 #endif | |
296 | |
297 /* OS(HURD) - GNU/Hurd */ | |
298 #ifdef __GNU__ | |
299 #define WTF_OS_HURD 1 | |
300 #endif | |
301 | |
302 /* OS(LINUX) - Linux */ | |
303 #ifdef __linux__ | |
304 #define WTF_OS_LINUX 1 | |
305 #endif | |
306 | |
307 /* OS(NETBSD) - NetBSD */ | |
308 #if defined(__NetBSD__) | |
309 #define WTF_OS_NETBSD 1 | |
310 #endif | |
311 | |
312 /* OS(OPENBSD) - OpenBSD */ | |
313 #ifdef __OpenBSD__ | |
314 #define WTF_OS_OPENBSD 1 | |
315 #endif | |
316 | |
317 /* OS(SOLARIS) - Solaris */ | |
318 #if defined(sun) || defined(__sun) | |
319 #define WTF_OS_SOLARIS 1 | |
320 #endif | |
321 | |
322 /* OS(WINDOWS) - Any version of Windows */ | |
323 #if defined(WIN32) || defined(_WIN32) | |
324 #define WTF_OS_WINDOWS 1 | |
325 #endif | |
326 | |
327 /* OS(UNIX) - Any Unix-like system */ | |
328 #if OS(AIX) \ | |
329 || OS(ANDROID) \ | |
330 || OS(DARWIN) \ | |
331 || OS(FREEBSD) \ | |
332 || OS(HURD) \ | |
333 || OS(LINUX) \ | |
334 || OS(NETBSD) \ | |
335 || OS(OPENBSD) \ | |
336 || OS(SOLARIS) \ | |
337 || defined(unix) \ | |
338 || defined(__unix) \ | |
339 || defined(__unix__) | |
340 #define WTF_OS_UNIX 1 | |
341 #endif | |
342 | |
343 /* Operating environments */ | |
344 | |
345 #if OS(ANDROID) | |
346 #define WTF_USE_LOW_QUALITY_IMAGE_INTERPOLATION 1 | |
347 #define WTF_USE_LOW_QUALITY_IMAGE_NO_JPEG_DITHERING 1 | |
348 #define WTF_USE_LOW_QUALITY_IMAGE_NO_JPEG_FANCY_UPSAMPLING 1 | |
349 #else | |
350 #define WTF_USE_ICCJPEG 1 | |
351 #define WTF_USE_QCMSLIB 1 | |
352 #endif | |
353 | |
354 #if OS(DARWIN) | |
355 #define WTF_USE_CF 1 | |
356 | |
357 /* We can't override the global operator new and delete on OS(DARWIN) because | |
358 * some object are allocated by WebKit and deallocated by the embedder. */ | |
359 #else /* !OS(DARWIN) */ | |
360 /* On non-OS(DARWIN), the "system malloc" is actually TCMalloc anyway, so there'
s | |
361 * no need to use WebKit's copy of TCMalloc. */ | |
362 #define WTF_USE_SYSTEM_MALLOC 1 | |
363 #endif /* OS(DARWIN) */ | |
364 | |
365 #if OS(DARWIN) | |
366 #define ENABLE_PURGEABLE_MEMORY 1 | |
367 #endif /* OS(DARWIN) */ | |
368 | |
369 #if !defined(HAVE_ACCESSIBILITY) | |
370 #if !OS(ANDROID) | |
371 #define HAVE_ACCESSIBILITY 1 | |
372 #endif | |
373 #endif /* !defined(HAVE_ACCESSIBILITY) */ | |
374 | |
375 #if OS(UNIX) | |
376 #define HAVE_ERRNO_H 1 | |
377 #define HAVE_MMAP 1 | |
378 #define HAVE_SIGNAL_H 1 | |
379 #define HAVE_STRINGS_H 1 | |
380 #define HAVE_SYS_TIME_H 1 | |
381 #define WTF_USE_PTHREADS 1 | |
382 #endif /* OS(UNIX) */ | |
383 | |
384 #if (OS(FREEBSD) || OS(OPENBSD)) && !defined(__GLIBC__) | |
385 #define HAVE_PTHREAD_NP_H 1 | |
386 #endif | |
387 | |
388 #if !defined(HAVE_VASPRINTF) | |
389 #if !COMPILER(MSVC) && !COMPILER(MINGW) | |
390 #define HAVE_VASPRINTF 1 | |
391 #endif | |
392 #endif | |
393 | |
394 #if !defined(HAVE_STRNSTR) | |
395 #if OS(DARWIN) || (OS(FREEBSD) && !defined(__GLIBC__)) | |
396 #define HAVE_STRNSTR 1 | |
397 #endif | |
398 #endif | |
399 | |
400 #if !OS(WINDOWS) && !OS(SOLARIS) && !OS(ANDROID) | |
401 #define HAVE_TM_GMTOFF 1 | |
402 #define HAVE_TM_ZONE 1 | |
403 #define HAVE_TIMEGM 1 | |
404 #endif | |
405 | |
406 #if OS(DARWIN) | |
407 #define HAVE_SYS_TIMEB_H 1 | |
408 #define HAVE_DISPATCH_H 1 | |
409 #define HAVE_MADV_FREE 1 | |
410 #define HAVE_PTHREAD_SETNAME_NP 1 | |
411 #define HAVE_MADV_FREE_REUSE 1 | |
412 #endif /* OS(DARWIN) */ | |
413 | |
414 #if OS(WINDOWS) | |
415 #define HAVE_SYS_TIMEB_H 1 | |
416 #define HAVE_ALIGNED_MALLOC 1 | |
417 #define HAVE_ISDEBUGGERPRESENT 1 | |
418 #define HAVE_VIRTUALALLOC 1 | |
419 #endif | |
420 | |
421 #if !defined(ENABLE_THREADING_LIBDISPATCH) && HAVE(DISPATCH_H) | |
422 #define ENABLE_THREADING_LIBDISPATCH 1 | |
423 #elif !defined(ENABLE_THREADING_OPENMP) && defined(_OPENMP) | |
424 #define ENABLE_THREADING_OPENMP 1 | |
425 #elif !defined(THREADING_GENERIC) | |
426 #define ENABLE_THREADING_GENERIC 1 | |
427 #endif | |
428 | |
429 #endif /* WTF_Platform_h */ | |
OLD | NEW |