1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/assembler/wtf/Platform.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,1256 @@ 1.4 +/* 1.5 + * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 1.6 + * Copyright (C) 2007-2009 Torch Mobile, Inc. 1.7 + * Copyright (C) Research In Motion Limited 2010. All rights reserved. 1.8 + * 1.9 + * Redistribution and use in source and binary forms, with or without 1.10 + * modification, are permitted provided that the following conditions 1.11 + * are met: 1.12 + * 1. Redistributions of source code must retain the above copyright 1.13 + * notice, this list of conditions and the following disclaimer. 1.14 + * 2. Redistributions in binary form must reproduce the above copyright 1.15 + * notice, this list of conditions and the following disclaimer in the 1.16 + * documentation and/or other materials provided with the distribution. 1.17 + * 1.18 + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 1.19 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1.20 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 1.21 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 1.22 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 1.23 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 1.24 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 1.25 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 1.26 + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1.27 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1.28 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1.29 + */ 1.30 + 1.31 +#ifndef assembler_wtf_Platform_h 1.32 +#define assembler_wtf_Platform_h 1.33 + 1.34 +/* ==== PLATFORM handles OS, operating environment, graphics API, and 1.35 + CPU. This macro will be phased out in favor of platform adaptation 1.36 + macros, policy decision macros, and top-level port definitions. ==== */ 1.37 +#define PLATFORM(WTF_FEATURE) (defined WTF_PLATFORM_##WTF_FEATURE && WTF_PLATFORM_##WTF_FEATURE) 1.38 + 1.39 + 1.40 +/* ==== Platform adaptation macros: these describe properties of the target environment. ==== */ 1.41 + 1.42 +/* COMPILER() - the compiler being used to build the project */ 1.43 +#define COMPILER(WTF_FEATURE) (defined WTF_COMPILER_##WTF_FEATURE && WTF_COMPILER_##WTF_FEATURE) 1.44 +/* CPU() - the target CPU architecture */ 1.45 +#define CPU(WTF_FEATURE) (defined WTF_CPU_##WTF_FEATURE && WTF_CPU_##WTF_FEATURE) 1.46 +/* HAVE() - specific system features (headers, functions or similar) that are present or not */ 1.47 +#define HAVE(WTF_FEATURE) (defined HAVE_##WTF_FEATURE && HAVE_##WTF_FEATURE) 1.48 +/* OS() - underlying operating system; only to be used for mandated low-level services like 1.49 + virtual memory, not to choose a GUI toolkit */ 1.50 +#define OS(WTF_FEATURE) (defined WTF_OS_##WTF_FEATURE && WTF_OS_##WTF_FEATURE) 1.51 + 1.52 + 1.53 +/* ==== Policy decision macros: these define policy choices for a particular port. ==== */ 1.54 + 1.55 +/* USE() - use a particular third-party library or optional OS service */ 1.56 +#define USE(WTF_FEATURE) (defined WTF_USE_##WTF_FEATURE && WTF_USE_##WTF_FEATURE) 1.57 +/* ENABLE() - turn on a specific feature of WebKit */ 1.58 +#define ENABLE(WTF_FEATURE) (defined ENABLE_##WTF_FEATURE && ENABLE_##WTF_FEATURE) 1.59 + 1.60 + 1.61 + 1.62 +/* ==== COMPILER() - the compiler being used to build the project ==== */ 1.63 + 1.64 +/* WTF_COMPILER_MSVC Microsoft Visual C++ */ 1.65 +/* WTF_COMPILER_MSVC7_OR_LOWER Microsoft Visual C++ 2003 or lower*/ 1.66 +/* WTF_COMPILER_MSVC9_OR_LOWER Microsoft Visual C++ 2008 or lower*/ 1.67 +#if defined(_MSC_VER) 1.68 +#define WTF_COMPILER_MSVC 1 1.69 +#if _MSC_VER < 1400 1.70 +#define WTF_COMPILER_MSVC7_OR_LOWER 1 1.71 +#elif _MSC_VER < 1600 1.72 +#define WTF_COMPILER_MSVC9_OR_LOWER 1 1.73 +#endif 1.74 +#endif 1.75 + 1.76 +/* WTF_COMPILER_RVCT - ARM RealView Compilation Tools */ 1.77 +/* WTF_COMPILER_RVCT4_OR_GREATER - ARM RealView Compilation Tools 4.0 or greater */ 1.78 +#if defined(__CC_ARM) || defined(__ARMCC__) 1.79 +#define WTF_COMPILER_RVCT 1 1.80 +#define RVCT_VERSION_AT_LEAST(major, minor, patch, build) (__ARMCC_VERSION >= (major * 100000 + minor * 10000 + patch * 1000 + build)) 1.81 +#else 1.82 +/* Define this for !RVCT compilers, just so we can write things like RVCT_VERSION_AT_LEAST(3, 0, 0, 0). */ 1.83 +#define RVCT_VERSION_AT_LEAST(major, minor, patch, build) 0 1.84 +#endif 1.85 + 1.86 +/* WTF_COMPILER_GCC - GNU Compiler Collection */ 1.87 +/* --gnu option of the RVCT compiler also defines __GNUC__ */ 1.88 +#if defined(__GNUC__) && !WTF_COMPILER_RVCT 1.89 +#define WTF_COMPILER_GCC 1 1.90 +#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) 1.91 +#define GCC_VERSION_AT_LEAST(major, minor, patch) (GCC_VERSION >= (major * 10000 + minor * 100 + patch)) 1.92 +#else 1.93 +/* Define this for !GCC compilers, just so we can write things like GCC_VERSION_AT_LEAST(4, 1, 0). */ 1.94 +#define GCC_VERSION_AT_LEAST(major, minor, patch) 0 1.95 +#endif 1.96 + 1.97 +/* WTF_COMPILER_MINGW - MinGW GCC */ 1.98 +/* WTF_COMPILER_MINGW64 - mingw-w64 GCC - only used as additional check to exclude mingw.org specific functions */ 1.99 +#if defined(__MINGW32__) 1.100 +#define WTF_COMPILER_MINGW 1 1.101 +#include <_mingw.h> /* private MinGW header */ 1.102 + #if defined(__MINGW64_VERSION_MAJOR) /* best way to check for mingw-w64 vs mingw.org */ 1.103 + #define WTF_COMPILER_MINGW64 1 1.104 + #endif /* __MINGW64_VERSION_MAJOR */ 1.105 +#endif /* __MINGW32__ */ 1.106 + 1.107 +/* WTF_COMPILER_WINSCW - CodeWarrior for Symbian emulator */ 1.108 +#if defined(__WINSCW__) 1.109 +#define WTF_COMPILER_WINSCW 1 1.110 +/* cross-compiling, it is not really windows */ 1.111 +#undef WIN32 1.112 +#undef _WIN32 1.113 +#endif 1.114 + 1.115 +/* WTF_COMPILER_INTEL - Intel C++ Compiler */ 1.116 +#if defined(__INTEL_COMPILER) 1.117 +#define WTF_COMPILER_INTEL 1 1.118 +#endif 1.119 + 1.120 +/* WTF_COMPILER_SUNCC */ 1.121 +#if defined(__SUNPRO_CC) || defined(__SUNPRO_C) 1.122 +#define WTF_COMPILER_SUNCC 1 1.123 +#endif 1.124 + 1.125 +/* ==== CPU() - the target CPU architecture ==== */ 1.126 + 1.127 +/* This also defines WTF_CPU_BIG_ENDIAN or WTF_CPU_MIDDLE_ENDIAN or neither, as appropriate. */ 1.128 + 1.129 +/* WTF_CPU_ALPHA - DEC Alpha */ 1.130 +#if defined(__alpha__) 1.131 +#define WTF_CPU_ALPHA 1 1.132 +#endif 1.133 + 1.134 +/* WTF_CPU_IA64 - Itanium / IA-64 */ 1.135 +#if defined(__ia64__) 1.136 +#define WTF_CPU_IA64 1 1.137 +/* 32-bit mode on Itanium */ 1.138 +#if !defined(__LP64__) 1.139 +#define WTF_CPU_IA64_32 1 1.140 +#endif 1.141 +#endif 1.142 + 1.143 +/* WTF_CPU_MIPS - MIPS 32-bit */ 1.144 +/* Note: Only O32 ABI is tested, so we enable it for O32 ABI for now. */ 1.145 +#if (defined(mips) || defined(__mips__) || defined(MIPS) || defined(_MIPS_)) \ 1.146 + && defined(_ABIO32) 1.147 +#define WTF_CPU_MIPS 1 1.148 +#if defined(__MIPSEB__) 1.149 +#define WTF_CPU_BIG_ENDIAN 1 1.150 +#endif 1.151 +#define WTF_MIPS_PIC (defined __PIC__) 1.152 +#define WTF_MIPS_ARCH __mips 1.153 +#define WTF_MIPS_ISA(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH == v) 1.154 +#define WTF_MIPS_ISA_AT_LEAST(v) (defined WTF_MIPS_ARCH && WTF_MIPS_ARCH >= v) 1.155 +#define WTF_MIPS_ARCH_REV __mips_isa_rev 1.156 +#define WTF_MIPS_ISA_REV(v) (defined WTF_MIPS_ARCH_REV && WTF_MIPS_ARCH_REV == v) 1.157 +#define WTF_MIPS_DOUBLE_FLOAT (defined __mips_hard_float && !defined __mips_single_float) 1.158 +#define WTF_MIPS_FP64 (defined __mips_fpr && __mips_fpr == 64) 1.159 +/* MIPS requires allocators to use aligned memory */ 1.160 +#define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 1.161 +#endif /* MIPS */ 1.162 + 1.163 +/* WTF_CPU_PPC - PowerPC 32-bit */ 1.164 +#if defined(__ppc__) \ 1.165 + || defined(__PPC__) \ 1.166 + || defined(__powerpc__) \ 1.167 + || defined(__powerpc) \ 1.168 + || defined(__POWERPC__) \ 1.169 + || defined(_M_PPC) \ 1.170 + || defined(__PPC) 1.171 +#if !defined(__ppc64__) && !defined(__PPC64__) 1.172 +#define WTF_CPU_PPC 1 1.173 +#endif 1.174 +#if !defined(__LITTLE_ENDIAN__) 1.175 +#define WTF_CPU_BIG_ENDIAN 1 1.176 +#endif 1.177 +#endif 1.178 + 1.179 +/* WTF_CPU_PPC64 - PowerPC 64-bit */ 1.180 +#if defined(__ppc64__) \ 1.181 + || defined(__PPC64__) 1.182 +#define WTF_CPU_PPC64 1 1.183 +#if !defined(__LITTLE_ENDIAN__) 1.184 +#define WTF_CPU_BIG_ENDIAN 1 1.185 +#endif 1.186 +#endif 1.187 + 1.188 +/* WTF_CPU_SH4 - SuperH SH-4 */ 1.189 +#if defined(__SH4__) 1.190 +#define WTF_CPU_SH4 1 1.191 +#endif 1.192 + 1.193 +/* WTF_CPU_SPARC32 - SPARC 32-bit */ 1.194 +#if defined(__sparc) && !defined(__arch64__) || defined(__sparcv8) 1.195 +#define WTF_CPU_SPARC32 1 1.196 +#define WTF_CPU_BIG_ENDIAN 1 1.197 +#endif 1.198 + 1.199 +/* WTF_CPU_SPARC64 - SPARC 64-bit */ 1.200 +#if defined(__sparc__) && defined(__arch64__) || defined (__sparcv9) 1.201 +#define WTF_CPU_SPARC64 1 1.202 +#define WTF_CPU_BIG_ENDIAN 1 1.203 +#endif 1.204 + 1.205 +/* WTF_CPU_SPARC - any SPARC, true for WTF_CPU_SPARC32 and WTF_CPU_SPARC64 */ 1.206 +#if WTF_CPU_SPARC32 || WTF_CPU_SPARC64 1.207 +#define WTF_CPU_SPARC 1 1.208 +#endif 1.209 + 1.210 +/* WTF_CPU_S390X - S390 64-bit */ 1.211 +#if defined(__s390x__) 1.212 +#define WTF_CPU_S390X 1 1.213 +#define WTF_CPU_BIG_ENDIAN 1 1.214 +#endif 1.215 + 1.216 +/* WTF_CPU_S390 - S390 32-bit */ 1.217 +#if defined(__s390__) 1.218 +#define WTF_CPU_S390 1 1.219 +#define WTF_CPU_BIG_ENDIAN 1 1.220 +#endif 1.221 + 1.222 +#if defined(__aarch64__) 1.223 +#define WTF_CPU_AARCH64 1 1.224 +#if defined(__AARCH64EB__) 1.225 +#define WTF_CPU_BIG_ENDIAN 1 1.226 +#endif 1.227 +#endif 1.228 + 1.229 +/* WTF_CPU_X86 - i386 / x86 32-bit */ 1.230 +#if defined(__i386__) \ 1.231 + || defined(i386) \ 1.232 + || defined(_M_IX86) \ 1.233 + || defined(_X86_) \ 1.234 + || defined(__THW_INTEL) 1.235 +#define WTF_CPU_X86 1 1.236 +#endif 1.237 + 1.238 +/* WTF_CPU_X86_64 - AMD64 / Intel64 / x86_64 64-bit */ 1.239 +#if defined(__x86_64__) \ 1.240 + || defined(_M_X64) 1.241 +#define WTF_CPU_X86_64 1 1.242 +#endif 1.243 + 1.244 +/* WTF_CPU_ARM - ARM, any version*/ 1.245 +#if defined(arm) \ 1.246 + || defined(__arm__) \ 1.247 + || defined(ARM) \ 1.248 + || defined(_ARM_) 1.249 +#define WTF_CPU_ARM 1 1.250 + 1.251 +#if defined(__ARMEB__) || (WTF_COMPILER_RVCT && defined(__BIG_ENDIAN)) 1.252 +#define WTF_CPU_BIG_ENDIAN 1 1.253 + 1.254 +#elif !defined(__ARM_EABI__) \ 1.255 + && !defined(__EABI__) \ 1.256 + && !defined(__VFP_FP__) \ 1.257 + && !defined(_WIN32_WCE) \ 1.258 + && !defined(ANDROID) 1.259 +#define WTF_CPU_MIDDLE_ENDIAN 1 1.260 + 1.261 +#endif 1.262 + 1.263 +#define WTF_ARM_ARCH_AT_LEAST(N) (CPU(ARM) && WTF_ARM_ARCH_VERSION >= N) 1.264 +#define WTF_ARM_ARCH_AT_LEAST_5 (WTF_CPU_ARM && WTF_ARM_ARCH_VERSION >= 5) 1.265 + 1.266 +/* Set WTF_ARM_ARCH_VERSION */ 1.267 +#if defined(__ARM_ARCH_4__) \ 1.268 + || defined(__ARM_ARCH_4T__) \ 1.269 + || defined(__MARM_ARMV4__) \ 1.270 + || defined(_ARMV4I_) 1.271 +#define WTF_ARM_ARCH_VERSION 4 1.272 + 1.273 +#elif defined(__ARM_ARCH_5__) \ 1.274 + || defined(__ARM_ARCH_5T__) \ 1.275 + || defined(__MARM_ARMV5__) 1.276 +#define WTF_ARM_ARCH_VERSION 5 1.277 + 1.278 +#elif defined(__ARM_ARCH_5E__) \ 1.279 + || defined(__ARM_ARCH_5TE__) \ 1.280 + || defined(__ARM_ARCH_5TEJ__) 1.281 +#define WTF_ARM_ARCH_VERSION 5 1.282 +/*ARMv5TE requires allocators to use aligned memory*/ 1.283 +#define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 1.284 + 1.285 +#elif defined(__ARM_ARCH_6__) \ 1.286 + || defined(__ARM_ARCH_6J__) \ 1.287 + || defined(__ARM_ARCH_6K__) \ 1.288 + || defined(__ARM_ARCH_6Z__) \ 1.289 + || defined(__ARM_ARCH_6ZK__) \ 1.290 + || defined(__ARM_ARCH_6T2__) \ 1.291 + || defined(__ARMV6__) 1.292 +#define WTF_ARM_ARCH_VERSION 6 1.293 + 1.294 +#elif defined(__ARM_ARCH_7A__) \ 1.295 + || defined(__ARM_ARCH_7R__) 1.296 +#define WTF_ARM_ARCH_VERSION 7 1.297 + 1.298 +/* RVCT sets _TARGET_ARCH_ARM */ 1.299 +#elif defined(__TARGET_ARCH_ARM) 1.300 +#define WTF_ARM_ARCH_VERSION __TARGET_ARCH_ARM 1.301 + 1.302 +#if defined(__TARGET_ARCH_5E) \ 1.303 + || defined(__TARGET_ARCH_5TE) \ 1.304 + || defined(__TARGET_ARCH_5TEJ) 1.305 +/*ARMv5TE requires allocators to use aligned memory*/ 1.306 +#define WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER 1 1.307 +#endif 1.308 + 1.309 +#else 1.310 +#define WTF_ARM_ARCH_VERSION 0 1.311 + 1.312 +#endif 1.313 + 1.314 +/* Set WTF_THUMB_ARCH_VERSION */ 1.315 +#if defined(__ARM_ARCH_4T__) 1.316 +#define WTF_THUMB_ARCH_VERSION 1 1.317 + 1.318 +#elif defined(__ARM_ARCH_5T__) \ 1.319 + || defined(__ARM_ARCH_5TE__) \ 1.320 + || defined(__ARM_ARCH_5TEJ__) 1.321 +#define WTF_THUMB_ARCH_VERSION 2 1.322 + 1.323 +#elif defined(__ARM_ARCH_6J__) \ 1.324 + || defined(__ARM_ARCH_6K__) \ 1.325 + || defined(__ARM_ARCH_6Z__) \ 1.326 + || defined(__ARM_ARCH_6ZK__) \ 1.327 + || defined(__ARM_ARCH_6M__) 1.328 +#define WTF_THUMB_ARCH_VERSION 3 1.329 + 1.330 +#elif defined(__ARM_ARCH_6T2__) \ 1.331 + || defined(__ARM_ARCH_7__) \ 1.332 + || defined(__ARM_ARCH_7A__) \ 1.333 + || defined(__ARM_ARCH_7R__) \ 1.334 + || defined(__ARM_ARCH_7M__) 1.335 +#define WTF_THUMB_ARCH_VERSION 4 1.336 + 1.337 +/* RVCT sets __TARGET_ARCH_THUMB */ 1.338 +#elif defined(__TARGET_ARCH_THUMB) 1.339 +#define WTF_THUMB_ARCH_VERSION __TARGET_ARCH_THUMB 1.340 + 1.341 +#else 1.342 +#define WTF_THUMB_ARCH_VERSION 0 1.343 +#endif 1.344 + 1.345 + 1.346 +/* WTF_CPU_ARMV5_OR_LOWER - ARM instruction set v5 or earlier */ 1.347 +/* On ARMv5 and below the natural alignment is required. 1.348 + And there are some other differences for v5 or earlier. */ 1.349 +#if !defined(ARMV5_OR_LOWER) && WTF_CPU_ARM && !(WTF_ARM_ARCH_VERSION >= 6) 1.350 +#define WTF_CPU_ARMV5_OR_LOWER 1 1.351 +#endif 1.352 + 1.353 + 1.354 +/* WTF_CPU_ARM_TRADITIONAL - Thumb2 is not available, only traditional ARM (v4 or greater) */ 1.355 +/* WTF_CPU_ARM_THUMB2 - Thumb2 instruction set is available */ 1.356 +/* Only one of these will be defined. */ 1.357 +#if !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2) 1.358 +# if defined(thumb2) || defined(__thumb2__) \ 1.359 + || ((defined(__thumb) || defined(__thumb__)) && WTF_THUMB_ARCH_VERSION == 4) 1.360 +# define WTF_CPU_ARM_TRADITIONAL 1 1.361 +# define WTF_CPU_ARM_THUMB2 0 1.362 +# elif WTF_CPU_ARM && WTF_ARM_ARCH_VERSION >= 4 1.363 +# define WTF_CPU_ARM_TRADITIONAL 1 1.364 +# define WTF_CPU_ARM_THUMB2 0 1.365 +# else 1.366 +# error "Not supported ARM architecture" 1.367 +# endif 1.368 +#elif WTF_CPU_ARM_TRADITIONAL && WTF_CPU_ARM_THUMB2 /* Sanity Check */ 1.369 +# error "Cannot use both of WTF_CPU_ARM_TRADITIONAL and WTF_CPU_ARM_THUMB2 platforms" 1.370 +#endif /* !defined(WTF_CPU_ARM_TRADITIONAL) && !defined(WTF_CPU_ARM_THUMB2) */ 1.371 + 1.372 +#if defined(__ARM_NEON__) && !defined(WTF_CPU_ARM_NEON) 1.373 +#define WTF_CPU_ARM_NEON 1 1.374 +#endif 1.375 + 1.376 +#endif /* ARM */ 1.377 + 1.378 +#if defined(JS_ARM_SIMULATOR) 1.379 +# undef WTF_CPU_X86 1.380 +# undef WTF_CPU_X64 1.381 +# define WTF_CPU_ARM_TRADITIONAL 1 1.382 +# define WTF_CPU_ARM 1 1.383 +#endif 1.384 + 1.385 +#if WTF_CPU_ARM || WTF_CPU_MIPS 1.386 +#define WTF_CPU_NEEDS_ALIGNED_ACCESS 1 1.387 +#endif 1.388 + 1.389 +/* ==== OS() - underlying operating system; only to be used for mandated low-level services like 1.390 + virtual memory, not to choose a GUI toolkit ==== */ 1.391 + 1.392 +/* WTF_OS_ANDROID - Android */ 1.393 +#ifdef ANDROID 1.394 +#define WTF_OS_ANDROID 1 1.395 +#endif 1.396 + 1.397 +/* WTF_OS_AIX - AIX */ 1.398 +#ifdef _AIX 1.399 +#define WTF_OS_AIX 1 1.400 +#endif 1.401 + 1.402 +/* WTF_OS_DARWIN - Any Darwin-based OS, including Mac OS X and iPhone OS */ 1.403 +#ifdef __APPLE__ 1.404 +#define WTF_OS_DARWIN 1 1.405 + 1.406 +/* FIXME: BUILDING_ON_.., and TARGETING... macros should be folded into the OS() system */ 1.407 +#include <AvailabilityMacros.h> 1.408 +#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 1.409 +#define BUILDING_ON_TIGER 1 1.410 +#elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 1.411 +#define BUILDING_ON_LEOPARD 1 1.412 +#elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 1.413 +#define BUILDING_ON_SNOW_LEOPARD 1 1.414 +#endif 1.415 +#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 1.416 +#define TARGETING_TIGER 1 1.417 +#elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6 1.418 +#define TARGETING_LEOPARD 1 1.419 +#elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 1.420 +#define TARGETING_SNOW_LEOPARD 1 1.421 +#endif 1.422 +#include <TargetConditionals.h> 1.423 + 1.424 +#endif 1.425 + 1.426 +/* WTF_OS_IOS - iOS */ 1.427 +/* WTF_OS_MAC_OS_X - Mac OS X (not including iOS) */ 1.428 +#if WTF_OS_DARWIN && ((defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) \ 1.429 + || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) \ 1.430 + || (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR)) 1.431 +#define WTF_OS_IOS 1 1.432 +#elif WTF_OS_DARWIN && defined(TARGET_OS_MAC) && TARGET_OS_MAC 1.433 +#define WTF_OS_MAC_OS_X 1 1.434 +#endif 1.435 + 1.436 + 1.437 +/* WTF_OS_FREEBSD - FreeBSD */ 1.438 +#if defined(__FreeBSD__) || defined(__DragonFly__) 1.439 +#define WTF_OS_FREEBSD 1 1.440 +#endif 1.441 + 1.442 +/* WTF_OS_HAIKU - Haiku */ 1.443 +#ifdef __HAIKU__ 1.444 +#define WTF_OS_HAIKU 1 1.445 +#endif 1.446 + 1.447 +/* WTF_OS_LINUX - Linux */ 1.448 +#if defined(__linux__) && !defined(ANDROID) 1.449 +#define WTF_OS_LINUX 1 1.450 +#endif 1.451 + 1.452 +/* WTF_OS_NETBSD - NetBSD */ 1.453 +#if defined(__NetBSD__) 1.454 +#define WTF_OS_NETBSD 1 1.455 +#endif 1.456 + 1.457 +/* WTF_OS_OPENBSD - OpenBSD */ 1.458 +#ifdef __OpenBSD__ 1.459 +#define WTF_OS_OPENBSD 1 1.460 +#endif 1.461 + 1.462 +/* WTF_OS_QNX - QNX */ 1.463 +#if defined(__QNXNTO__) 1.464 +#define WTF_OS_QNX 1 1.465 +#endif 1.466 + 1.467 +/* WTF_OS_SOLARIS - Solaris */ 1.468 +#if defined(sun) || defined(__sun) 1.469 +#define WTF_OS_SOLARIS 1 1.470 +#endif 1.471 + 1.472 +/* WTF_OS_WINCE - Windows CE; note that for this platform WTF_OS_WINDOWS is also defined */ 1.473 +#if defined(_WIN32_WCE) 1.474 +#define WTF_OS_WINCE 1 1.475 +#endif 1.476 + 1.477 +/* WTF_OS_WINDOWS - Any version of Windows */ 1.478 +#if defined(WIN32) || defined(_WIN32) 1.479 +#define WTF_OS_WINDOWS 1 1.480 +#endif 1.481 + 1.482 +/* WTF_OS_SYMBIAN - Symbian */ 1.483 +#if defined (__SYMBIAN32__) 1.484 +#define WTF_OS_SYMBIAN 1 1.485 +#endif 1.486 + 1.487 +/* WTF_OS_UNIX - Any Unix-like system */ 1.488 +#if WTF_OS_AIX \ 1.489 + || WTF_OS_ANDROID \ 1.490 + || WTF_OS_DARWIN \ 1.491 + || WTF_OS_FREEBSD \ 1.492 + || WTF_OS_HAIKU \ 1.493 + || WTF_OS_LINUX \ 1.494 + || WTF_OS_NETBSD \ 1.495 + || WTF_OS_OPENBSD \ 1.496 + || WTF_OS_QNX \ 1.497 + || WTF_OS_SOLARIS \ 1.498 + || WTF_OS_SYMBIAN \ 1.499 + || defined(unix) \ 1.500 + || defined(__unix) \ 1.501 + || defined(__unix__) 1.502 +#define WTF_OS_UNIX 1 1.503 +#endif 1.504 + 1.505 +/* WTF_OS_OS2 - OS/2 */ 1.506 +#if defined (__OS2__) 1.507 +#define WTF_OS_OS2 1 1.508 +#endif 1.509 + 1.510 +/* Operating environments */ 1.511 + 1.512 +/* FIXME: these are all mixes of OS, operating environment and policy choices. */ 1.513 +/* WTF_PLATFORM_CHROMIUM */ 1.514 +/* WTF_PLATFORM_QT */ 1.515 +/* WTF_PLATFORM_WX */ 1.516 +/* WTF_PLATFORM_GTK */ 1.517 +/* WTF_PLATFORM_HAIKU */ 1.518 +/* WTF_PLATFORM_MAC */ 1.519 +/* WTF_PLATFORM_WIN */ 1.520 +#if defined(BUILDING_CHROMIUM__) 1.521 +#define WTF_PLATFORM_CHROMIUM 1 1.522 +#elif defined(BUILDING_QT__) 1.523 +#define WTF_PLATFORM_QT 1 1.524 +#elif defined(BUILDING_WX__) 1.525 +#define WTF_PLATFORM_WX 1 1.526 +#elif defined(BUILDING_GTK__) 1.527 +#define WTF_PLATFORM_GTK 1 1.528 +#elif defined(BUILDING_HAIKU__) 1.529 +#define WTF_PLATFORM_HAIKU 1 1.530 +#elif defined(BUILDING_BREWMP__) 1.531 +#define WTF_PLATFORM_BREWMP 1 1.532 +#if defined(AEE_SIMULATOR) 1.533 +#define WTF_PLATFORM_BREWMP_SIMULATOR 1 1.534 +#else 1.535 +#define WTF_PLATFORM_BREWMP_SIMULATOR 0 1.536 +#endif 1.537 +#undef WTF_OS_WINDOWS 1.538 +#undef WTF_PLATFORM_WIN 1.539 +#elif WTF_OS_DARWIN 1.540 +#define WTF_PLATFORM_MAC 1 1.541 +#elif WTF_OS_WINDOWS 1.542 +#define WTF_PLATFORM_WIN 1 1.543 +#endif 1.544 + 1.545 +/* WTF_PLATFORM_IOS */ 1.546 +/* FIXME: this is sometimes used as an OS switch and sometimes for higher-level things */ 1.547 +#if (defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) || (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) 1.548 +#define WTF_PLATFORM_IOS 1 1.549 +#endif 1.550 + 1.551 +/* WTF_PLATFORM_IOS_SIMULATOR */ 1.552 +#if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR 1.553 +#define WTF_PLATFORM_IOS 1 1.554 +#define WTF_PLATFORM_IOS_SIMULATOR 1 1.555 +#else 1.556 +#define WTF_PLATFORM_IOS_SIMULATOR 0 1.557 +#endif 1.558 + 1.559 +#if !defined(WTF_PLATFORM_IOS) 1.560 +#define WTF_PLATFORM_IOS 0 1.561 +#endif 1.562 + 1.563 +/* WTF_PLATFORM_ANDROID */ 1.564 +/* FIXME: this is sometimes used as an OS() switch, and other times to drive 1.565 + policy choices */ 1.566 +#if defined(ANDROID) 1.567 +#define WTF_PLATFORM_ANDROID 1 1.568 +#endif 1.569 + 1.570 +/* Graphics engines */ 1.571 + 1.572 +/* WTF_USE_CG and WTF_PLATFORM_CI */ 1.573 +#if WTF_PLATFORM_MAC || WTF_PLATFORM_IOS 1.574 +#define WTF_USE_CG 1 1.575 +#endif 1.576 +#if WTF_PLATFORM_MAC || WTF_PLATFORM_IOS || (WTF_PLATFORM_WIN && WTF_USE_CG) 1.577 +#define WTF_USE_CA 1 1.578 +#endif 1.579 + 1.580 +/* WTF_USE_SKIA for Win/Linux, CG for Mac */ 1.581 +#if WTF_PLATFORM_CHROMIUM 1.582 +#if WTF_OS_DARWIN 1.583 +#define WTF_USE_CG 1 1.584 +#define WTF_USE_ATSUI 1 1.585 +#define WTF_USE_CORE_TEXT 1 1.586 +#define WTF_USE_ICCJPEG 1 1.587 +#else 1.588 +#define WTF_USE_SKIA 1 1.589 +#define WTF_USE_CHROMIUM_NET 1 1.590 +#endif 1.591 +#endif 1.592 + 1.593 +#if WTF_PLATFORM_BREWMP 1.594 +#define WTF_USE_SKIA 1 1.595 +#endif 1.596 + 1.597 +#if WTF_PLATFORM_GTK 1.598 +#define WTF_USE_CAIRO 1 1.599 +#endif 1.600 + 1.601 + 1.602 +#if WTF_OS_WINCE 1.603 +#include <ce_time.h> 1.604 +#define WTF_USE_MERSENNE_TWISTER_19937 1 1.605 +#endif 1.606 + 1.607 +#if WTF_PLATFORM_QT && WTF_OS_UNIX && !WTF_OS_SYMBIAN && !WTF_OS_DARWIN 1.608 +#define WTF_USE_PTHREAD_BASED_QT 1 1.609 +#endif 1.610 + 1.611 +#if (WTF_PLATFORM_GTK || WTF_PLATFORM_IOS || WTF_PLATFORM_MAC || WTF_PLATFORM_WIN || (WTF_PLATFORM_QT && (WTF_OS_DARWIN || WTF_USE_PTHREAD_BASED_QT) && !ENABLE_SINGLE_THREADED)) && !defined(ENABLE_JSC_MULTIPLE_THREADS) 1.612 +#define ENABLE_JSC_MULTIPLE_THREADS 1 1.613 +#endif 1.614 + 1.615 +#if ENABLE_JSC_MULTIPLE_THREADS 1.616 +#define ENABLE_WTF_MULTIPLE_THREADS 1 1.617 +#endif 1.618 + 1.619 +/* On Windows, use QueryPerformanceCounter by default */ 1.620 +#if WTF_OS_WINDOWS 1.621 +#define WTF_USE_QUERY_PERFORMANCE_COUNTER 1 1.622 +#endif 1.623 + 1.624 +#if WTF_OS_WINCE && !WTF_PLATFORM_QT 1.625 +#define NOMINMAX /* Windows min and max conflict with standard macros */ 1.626 +#define NOSHLWAPI /* shlwapi.h not available on WinCe */ 1.627 + 1.628 +/* MSDN documentation says these functions are provided with uspce.lib. But we cannot find this file. */ 1.629 +#define __usp10__ /* disable "usp10.h" */ 1.630 + 1.631 +#define _INC_ASSERT /* disable "assert.h" */ 1.632 +#define assert(x) 1.633 + 1.634 +#endif /* WTF_OS_WINCE && !WTF_PLATFORM_QT */ 1.635 + 1.636 +#if WTF_PLATFORM_QT 1.637 +#define WTF_USE_QT4_UNICODE 1 1.638 +#elif WTF_OS_WINCE 1.639 +#define WTF_USE_WINCE_UNICODE 1 1.640 +#elif WTF_PLATFORM_BREWMP 1.641 +#define WTF_USE_BREWMP_UNICODE 1 1.642 +#elif WTF_PLATFORM_GTK 1.643 +/* The GTK+ Unicode backend is configurable */ 1.644 +#else 1.645 +#define WTF_USE_ICU_UNICODE 1 1.646 +#endif 1.647 + 1.648 +#if WTF_PLATFORM_MAC && !WTF_PLATFORM_IOS 1.649 +#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER) && WTF_CPU_X86_64 1.650 +#define WTF_USE_PLUGIN_HOST_PROCESS 1 1.651 +#endif 1.652 +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 1.653 +#define ENABLE_GESTURE_EVENTS 1 1.654 +#define ENABLE_RUBBER_BANDING 1 1.655 +#define WTF_USE_WK_SCROLLBAR_PAINTER 1 1.656 +#endif 1.657 +#if !defined(ENABLE_JAVA_BRIDGE) 1.658 +#define ENABLE_JAVA_BRIDGE 1 1.659 +#endif 1.660 +#if !defined(ENABLE_DASHBOARD_SUPPORT) 1.661 +#define ENABLE_DASHBOARD_SUPPORT 1 1.662 +#endif 1.663 +#define WTF_USE_CF 1 1.664 +#define WTF_USE_PTHREADS 1 1.665 +#define HAVE_PTHREAD_RWLOCK 1 1.666 +#define HAVE_READLINE 1 1.667 +#define HAVE_RUNLOOP_TIMER 1 1.668 +#define ENABLE_FULLSCREEN_API 1 1.669 +#define ENABLE_SMOOTH_SCROLLING 1 1.670 +#define ENABLE_WEB_ARCHIVE 1 1.671 +#endif /* WTF_PLATFORM_MAC && !WTF_PLATFORM_IOS */ 1.672 + 1.673 +#if WTF_PLATFORM_CHROMIUM && WTF_OS_DARWIN 1.674 +#define WTF_USE_CF 1 1.675 +#define WTF_USE_PTHREADS 1 1.676 +#define HAVE_PTHREAD_RWLOCK 1 1.677 +#endif 1.678 + 1.679 +#if WTF_PLATFORM_BREWMP 1.680 +#define ENABLE_SINGLE_THREADED 1 1.681 +#endif 1.682 + 1.683 +#if WTF_PLATFORM_QT && WTF_OS_DARWIN 1.684 +#define WTF_USE_CF 1 1.685 +#endif 1.686 + 1.687 +#if WTF_OS_DARWIN && !defined(BUILDING_ON_TIGER) && !WTF_PLATFORM_GTK && !WTF_PLATFORM_QT 1.688 +#define ENABLE_PURGEABLE_MEMORY 1 1.689 +#endif 1.690 + 1.691 +#if WTF_PLATFORM_IOS 1.692 +#define ENABLE_CONTEXT_MENUS 0 1.693 +#define ENABLE_DRAG_SUPPORT 0 1.694 +#define ENABLE_DATA_TRANSFER_ITEMS 0 1.695 +#define ENABLE_FTPDIR 1 1.696 +#define ENABLE_GEOLOCATION 1 1.697 +#define ENABLE_ICONDATABASE 0 1.698 +#define ENABLE_INSPECTOR 0 1.699 +#define ENABLE_JAVA_BRIDGE 0 1.700 +#define ENABLE_NETSCAPE_PLUGIN_API 0 1.701 +#define ENABLE_ORIENTATION_EVENTS 1 1.702 +#define ENABLE_REPAINT_THROTTLING 1 1.703 +#define HAVE_READLINE 1 1.704 +#define WTF_USE_CF 1 1.705 +#define WTF_USE_PTHREADS 1 1.706 +#define HAVE_PTHREAD_RWLOCK 1 1.707 +#define ENABLE_WEB_ARCHIVE 1 1.708 +#endif 1.709 + 1.710 +#if WTF_PLATFORM_ANDROID 1.711 +#define WTF_USE_PTHREADS 1 1.712 +#define USE_SYSTEM_MALLOC 1 1.713 +#define ENABLE_JAVA_BRIDGE 1 1.714 +#define LOG_DISABLED 1 1.715 +/* Prevents Webkit from drawing the caret in textfields and textareas 1.716 + This prevents unnecessary invals. */ 1.717 +#define ENABLE_TEXT_CARET 1 1.718 +#define ENABLE_JAVASCRIPT_DEBUGGER 0 1.719 +#endif 1.720 + 1.721 +#if WTF_PLATFORM_WIN && !WTF_OS_WINCE 1.722 +#define WTF_USE_CF 1 1.723 +#define WTF_USE_PTHREADS 0 1.724 +#endif 1.725 + 1.726 +#if WTF_PLATFORM_WIN && !WTF_OS_WINCE && !WTF_PLATFORM_CHROMIUM && !defined(WIN_CAIRO) 1.727 +#define WTF_USE_CFNETWORK 1 1.728 +#endif 1.729 + 1.730 +#if WTF_USE_CFNETWORK || WTF_PLATFORM_MAC 1.731 +#define WTF_USE_CFURLCACHE 1 1.732 +#define WTF_USE_CFURLSTORAGESESSIONS 1 1.733 +#endif 1.734 + 1.735 +#if WTF_PLATFORM_WIN && !WTF_OS_WINCE && !WTF_PLATFORM_CHROMIUM && !WTF_PLATFORM_QT 1.736 +#define ENABLE_WEB_ARCHIVE 1 1.737 +#endif 1.738 + 1.739 +#if WTF_PLATFORM_WX 1.740 +#define ENABLE_ASSEMBLER 1 1.741 +#define ENABLE_GLOBAL_FASTMALLOC_NEW 0 1.742 +#if WTF_OS_DARWIN 1.743 +#define WTF_USE_CF 1 1.744 +#ifndef BUILDING_ON_TIGER 1.745 +#define WTF_USE_CORE_TEXT 1 1.746 +#define ENABLE_WEB_ARCHIVE 1 1.747 +#else 1.748 +#define WTF_USE_ATSUI 1 1.749 +#endif 1.750 +#endif 1.751 +#endif 1.752 + 1.753 +#if WTF_PLATFORM_GTK 1.754 +#if HAVE_PTHREAD_H 1.755 +#define WTF_USE_PTHREADS 1 1.756 +#define HAVE_PTHREAD_RWLOCK 1 1.757 +#endif 1.758 +#endif 1.759 + 1.760 +#if WTF_PLATFORM_HAIKU 1.761 +#define HAVE_POSIX_MEMALIGN 1 1.762 +#define WTF_USE_CURL 1 1.763 +#define WTF_USE_PTHREADS 1 1.764 +#define HAVE_PTHREAD_RWLOCK 1 1.765 +#define USE_SYSTEM_MALLOC 1 1.766 +#define ENABLE_NETSCAPE_PLUGIN_API 0 1.767 +#endif 1.768 + 1.769 +#if WTF_PLATFORM_BREWMP 1.770 +#define USE_SYSTEM_MALLOC 1 1.771 +#endif 1.772 + 1.773 +#if WTF_PLATFORM_BREWMP_SIMULATOR 1.774 +#define ENABLE_JIT 0 1.775 +#endif 1.776 + 1.777 +#if !defined(HAVE_ACCESSIBILITY) 1.778 +#if WTF_PLATFORM_IOS || WTF_PLATFORM_MAC || WTF_PLATFORM_WIN || WTF_PLATFORM_GTK || WTF_PLATFORM_CHROMIUM 1.779 +#define HAVE_ACCESSIBILITY 1 1.780 +#endif 1.781 +#endif /* !defined(HAVE_ACCESSIBILITY) */ 1.782 + 1.783 +#if WTF_OS_UNIX && !WTF_OS_SYMBIAN 1.784 +#define HAVE_SIGNAL_H 1 1.785 +#endif 1.786 + 1.787 +#if !defined(HAVE_STRNSTR) 1.788 +#if WTF_OS_DARWIN || WTF_OS_FREEBSD 1.789 +#define HAVE_STRNSTR 1 1.790 +#endif 1.791 +#endif 1.792 + 1.793 +#if !WTF_OS_WINDOWS && !WTF_OS_SOLARIS && !WTF_OS_QNX \ 1.794 + && !WTF_OS_SYMBIAN && !WTF_OS_HAIKU && !WTF_OS_RVCT \ 1.795 + && !WTF_OS_ANDROID && !WTF_PLATFORM_BREWMP 1.796 +#define HAVE_TM_GMTOFF 1 1.797 +#define HAVE_TM_ZONE 1 1.798 +#define HAVE_TIMEGM 1 1.799 +#endif 1.800 + 1.801 +#if WTF_OS_DARWIN 1.802 + 1.803 +#define HAVE_ERRNO_H 1 1.804 +#define HAVE_LANGINFO_H 1 1.805 +#define HAVE_MMAP 1 1.806 +#define HAVE_MERGESORT 1 1.807 +#define HAVE_SBRK 1 1.808 +#define HAVE_STRINGS_H 1 1.809 +#define HAVE_SYS_PARAM_H 1 1.810 +#define HAVE_SYS_TIME_H 1 1.811 +#define HAVE_SYS_TIMEB_H 1 1.812 +#define WTF_USE_ACCELERATE 1 1.813 + 1.814 +#if !defined(TARGETING_TIGER) && !defined(TARGETING_LEOPARD) 1.815 + 1.816 +#define HAVE_DISPATCH_H 1 1.817 +#define HAVE_HOSTED_CORE_ANIMATION 1 1.818 + 1.819 +#if !WTF_PLATFORM_IOS 1.820 +#define HAVE_MADV_FREE_REUSE 1 1.821 +#define HAVE_MADV_FREE 1 1.822 +#define HAVE_PTHREAD_SETNAME_NP 1 1.823 +#endif 1.824 + 1.825 +#endif 1.826 + 1.827 +#if WTF_PLATFORM_IOS 1.828 +#define HAVE_MADV_FREE 1 1.829 +#endif 1.830 + 1.831 +#elif WTF_OS_WINDOWS 1.832 + 1.833 +#if WTF_OS_WINCE 1.834 +#define HAVE_ERRNO_H 0 1.835 +#else 1.836 +#define HAVE_SYS_TIMEB_H 1 1.837 +#define HAVE_ALIGNED_MALLOC 1 1.838 +#define HAVE_ISDEBUGGERPRESENT 1 1.839 +#endif 1.840 +#define HAVE_VIRTUALALLOC 1 1.841 + 1.842 +#elif WTF_OS_SYMBIAN 1.843 + 1.844 +#define HAVE_ERRNO_H 1 1.845 +#define HAVE_MMAP 0 1.846 +#define HAVE_SBRK 1 1.847 + 1.848 +#define HAVE_SYS_TIME_H 1 1.849 +#define HAVE_STRINGS_H 1 1.850 + 1.851 +#if !WTF_COMPILER_RVCT 1.852 +#define HAVE_SYS_PARAM_H 1 1.853 +#endif 1.854 + 1.855 +#elif WTF_PLATFORM_BREWMP 1.856 + 1.857 +#define HAVE_ERRNO_H 1 1.858 + 1.859 +#elif WTF_OS_QNX 1.860 + 1.861 +#define HAVE_ERRNO_H 1 1.862 +#define HAVE_MMAP 1 1.863 +#define HAVE_SBRK 1 1.864 +#define HAVE_STRINGS_H 1 1.865 +#define HAVE_SYS_PARAM_H 1 1.866 +#define HAVE_SYS_TIME_H 1 1.867 + 1.868 +#elif WTF_OS_ANDROID 1.869 + 1.870 +#define HAVE_ERRNO_H 1 1.871 +#define HAVE_LANGINFO_H 0 1.872 +#define HAVE_MMAP 1 1.873 +#define HAVE_SBRK 1 1.874 +#define HAVE_STRINGS_H 1 1.875 +#define HAVE_SYS_PARAM_H 1 1.876 +#define HAVE_SYS_TIME_H 1 1.877 + 1.878 +#elif WTF_OS_OS2 1.879 + 1.880 +#define USE_SYSTEM_MALLOC 1 1.881 +#define HAVE_ERRNO_H 1 1.882 +#define HAVE_LANGINFO_H 1 1.883 +#define HAVE_MMAP 0 1.884 +#define HAVE_POSIX_MEMALIGN 1 1.885 +#define HAVE_SBRK 1 1.886 +#define HAVE_SYS_PARAM_H 1 1.887 +#define HAVE_SYS_TIME_H 1 1.888 +#define HAVE_STRINGS_H 1 1.889 + 1.890 +#else 1.891 + 1.892 +/* FIXME: is this actually used or do other platforms generate their own config.h? */ 1.893 + 1.894 +#define HAVE_ERRNO_H 1 1.895 +/* As long as Haiku doesn't have a complete support of locale this will be disabled. */ 1.896 +#if !WTF_OS_HAIKU 1.897 +#define HAVE_LANGINFO_H 1 1.898 +#endif 1.899 +#define HAVE_MMAP 1 1.900 +#define HAVE_SBRK 1 1.901 +#define HAVE_STRINGS_H 1 1.902 +#define HAVE_SYS_PARAM_H 1 1.903 +#define HAVE_SYS_TIME_H 1 1.904 + 1.905 +#endif 1.906 + 1.907 +/* ENABLE macro defaults */ 1.908 + 1.909 +#if WTF_PLATFORM_QT 1.910 +/* We must not customize the global operator new and delete for the Qt port. */ 1.911 +#define ENABLE_GLOBAL_FASTMALLOC_NEW 0 1.912 +#if !WTF_OS_UNIX || WTF_OS_SYMBIAN 1.913 +#define USE_SYSTEM_MALLOC 1 1.914 +#endif 1.915 +#endif 1.916 + 1.917 +/* fastMalloc match validation allows for runtime verification that 1.918 + new is matched by delete, fastMalloc is matched by fastFree, etc. */ 1.919 +#if !defined(ENABLE_FAST_MALLOC_MATCH_VALIDATION) 1.920 +#define ENABLE_FAST_MALLOC_MATCH_VALIDATION 0 1.921 +#endif 1.922 + 1.923 +#if !defined(ENABLE_ICONDATABASE) 1.924 +#define ENABLE_ICONDATABASE 1 1.925 +#endif 1.926 + 1.927 +#if !defined(ENABLE_DATABASE) 1.928 +#define ENABLE_DATABASE 1 1.929 +#endif 1.930 + 1.931 +#if !defined(ENABLE_JAVASCRIPT_DEBUGGER) 1.932 +#define ENABLE_JAVASCRIPT_DEBUGGER 1 1.933 +#endif 1.934 + 1.935 +#if !defined(ENABLE_FTPDIR) 1.936 +#define ENABLE_FTPDIR 1 1.937 +#endif 1.938 + 1.939 +#if !defined(ENABLE_CONTEXT_MENUS) 1.940 +#define ENABLE_CONTEXT_MENUS 1 1.941 +#endif 1.942 + 1.943 +#if !defined(ENABLE_DRAG_SUPPORT) 1.944 +#define ENABLE_DRAG_SUPPORT 1 1.945 +#endif 1.946 + 1.947 +#if !defined(ENABLE_DATA_TRANSFER_ITEMS) 1.948 +#define ENABLE_DATA_TRANSFER_ITEMS 0 1.949 +#endif 1.950 + 1.951 +#if !defined(ENABLE_DASHBOARD_SUPPORT) 1.952 +#define ENABLE_DASHBOARD_SUPPORT 0 1.953 +#endif 1.954 + 1.955 +#if !defined(ENABLE_INSPECTOR) 1.956 +#define ENABLE_INSPECTOR 1 1.957 +#endif 1.958 + 1.959 +#if !defined(ENABLE_JAVA_BRIDGE) 1.960 +#define ENABLE_JAVA_BRIDGE 0 1.961 +#endif 1.962 + 1.963 +#if !defined(ENABLE_NETSCAPE_PLUGIN_API) 1.964 +#define ENABLE_NETSCAPE_PLUGIN_API 1 1.965 +#endif 1.966 + 1.967 +#if !defined(ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE) 1.968 +#define ENABLE_NETSCAPE_PLUGIN_METADATA_CACHE 0 1.969 +#endif 1.970 + 1.971 +#if !defined(ENABLE_PURGEABLE_MEMORY) 1.972 +#define ENABLE_PURGEABLE_MEMORY 0 1.973 +#endif 1.974 + 1.975 +#if !defined(WTF_USE_PLUGIN_HOST_PROCESS) 1.976 +#define WTF_USE_PLUGIN_HOST_PROCESS 0 1.977 +#endif 1.978 + 1.979 +#if !defined(ENABLE_ORIENTATION_EVENTS) 1.980 +#define ENABLE_ORIENTATION_EVENTS 0 1.981 +#endif 1.982 + 1.983 +#if !defined(ENABLE_OPCODE_STATS) 1.984 +#define ENABLE_OPCODE_STATS 0 1.985 +#endif 1.986 + 1.987 +#if !defined(ENABLE_GLOBAL_FASTMALLOC_NEW) 1.988 +#define ENABLE_GLOBAL_FASTMALLOC_NEW 1 1.989 +#endif 1.990 + 1.991 +#define ENABLE_DEBUG_WITH_BREAKPOINT 0 1.992 +#define ENABLE_SAMPLING_COUNTERS 0 1.993 +#define ENABLE_SAMPLING_FLAGS 0 1.994 +#define ENABLE_OPCODE_SAMPLING 0 1.995 +#define ENABLE_CODEBLOCK_SAMPLING 0 1.996 +#if ENABLE_CODEBLOCK_SAMPLING && !ENABLE_OPCODE_SAMPLING 1.997 +#error "CODEBLOCK_SAMPLING requires OPCODE_SAMPLING" 1.998 +#endif 1.999 +#if ENABLE_OPCODE_SAMPLING || ENABLE_SAMPLING_FLAGS 1.1000 +#define ENABLE_SAMPLING_THREAD 1 1.1001 +#endif 1.1002 + 1.1003 +#if !defined(ENABLE_GEOLOCATION) 1.1004 +#define ENABLE_GEOLOCATION 0 1.1005 +#endif 1.1006 + 1.1007 +#if !defined(ENABLE_GESTURE_RECOGNIZER) 1.1008 +#define ENABLE_GESTURE_RECOGNIZER 0 1.1009 +#endif 1.1010 + 1.1011 +#if !defined(ENABLE_NOTIFICATIONS) 1.1012 +#define ENABLE_NOTIFICATIONS 0 1.1013 +#endif 1.1014 + 1.1015 +#if WTF_PLATFORM_IOS 1.1016 +#define ENABLE_TEXT_CARET 0 1.1017 +#endif 1.1018 + 1.1019 +#if !defined(ENABLE_TEXT_CARET) 1.1020 +#define ENABLE_TEXT_CARET 1 1.1021 +#endif 1.1022 + 1.1023 +#if !defined(ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL) 1.1024 +#define ENABLE_ON_FIRST_TEXTAREA_FOCUS_SELECT_ALL 0 1.1025 +#endif 1.1026 + 1.1027 +#if !defined(ENABLE_FULLSCREEN_API) 1.1028 +#define ENABLE_FULLSCREEN_API 0 1.1029 +#endif 1.1030 + 1.1031 +#if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32_64) 1.1032 +#if (WTF_CPU_X86_64 && (WTF_OS_UNIX || WTF_OS_WINDOWS)) \ 1.1033 + || (WTF_CPU_IA64 && !WTF_CPU_IA64_32) \ 1.1034 + || WTF_CPU_ALPHA \ 1.1035 + || WTF_CPU_SPARC64 \ 1.1036 + || WTF_CPU_S390X \ 1.1037 + || WTF_CPU_PPC64 1.1038 +#define WTF_USE_JSVALUE64 1 1.1039 +#else 1.1040 +#define WTF_USE_JSVALUE32_64 1 1.1041 +#endif 1.1042 +#endif /* !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32_64) */ 1.1043 + 1.1044 +#if !defined(ENABLE_REPAINT_THROTTLING) 1.1045 +#define ENABLE_REPAINT_THROTTLING 0 1.1046 +#endif 1.1047 + 1.1048 +/* Disable the JIT on versions of GCC prior to 4.1 */ 1.1049 +#if !defined(ENABLE_JIT) && WTF_COMPILER_GCC && !GCC_VERSION_AT_LEAST(4, 1, 0) 1.1050 +#define ENABLE_JIT 0 1.1051 +#endif 1.1052 + 1.1053 +/* The JIT is enabled by default on all x86, x64-64, ARM platforms. */ 1.1054 +#if !defined(ENABLE_JIT) \ 1.1055 + && (WTF_CPU_X86 || WTF_CPU_X86_64 || WTF_CPU_ARM || WTF_CPU_SPARC32 || WTF_CPU_MIPS) \ 1.1056 + && (WTF_OS_DARWIN || !WTF_COMPILER_GCC || GCC_VERSION_AT_LEAST(4, 1, 0)) \ 1.1057 + && !WTF_OS_WINCE 1.1058 +#define ENABLE_JIT 1 1.1059 +#endif 1.1060 + 1.1061 +/* Currently only implemented for JSVALUE64, only tested on WTF_PLATFORM_MAC */ 1.1062 +#if ENABLE_JIT && WTF_USE_JSVALUE64 && WTF_PLATFORM_MAC 1.1063 +#define ENABLE_DFG_JIT 1 1.1064 +/* Enabled with restrictions to circumvent known performance regressions. */ 1.1065 +#define ENABLE_DFG_JIT_RESTRICTIONS 1 1.1066 +#endif 1.1067 + 1.1068 +/* Ensure that either the JIT or the interpreter has been enabled. */ 1.1069 +#if !defined(ENABLE_INTERPRETER) && !ENABLE_JIT 1.1070 +#define ENABLE_INTERPRETER 1 1.1071 +#endif 1.1072 +#if !(ENABLE_JIT || ENABLE_INTERPRETER) 1.1073 +#error You have to have at least one execution model enabled to build JSC 1.1074 +#endif 1.1075 + 1.1076 +#if WTF_CPU_SH4 && WTF_PLATFORM_QT 1.1077 +#define ENABLE_JIT 1 1.1078 +#define ENABLE_YARR 1 1.1079 +#define ENABLE_YARR_JIT 1 1.1080 +#define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1 1.1081 +#define ENABLE_ASSEMBLER 1 1.1082 +#endif 1.1083 + 1.1084 +/* Configure the JIT */ 1.1085 +#if ENABLE_JIT 1.1086 + #if WTF_CPU_ARM 1.1087 + #if !defined(ENABLE_JIT_USE_SOFT_MODULO) && WTF_CPU_ARM && WTF_ARM_ARCH_VERSION >= 5 1.1088 + #define ENABLE_JIT_USE_SOFT_MODULO 1 1.1089 + #endif 1.1090 + #endif 1.1091 + 1.1092 + #ifndef ENABLE_JIT_OPTIMIZE_CALL 1.1093 + #define ENABLE_JIT_OPTIMIZE_CALL 1 1.1094 + #endif 1.1095 + #ifndef ENABLE_JIT_OPTIMIZE_NATIVE_CALL 1.1096 + #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 1 1.1097 + #endif 1.1098 + #ifndef ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 1.1099 + #define ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS 1 1.1100 + #endif 1.1101 + #ifndef ENABLE_JIT_OPTIMIZE_METHOD_CALLS 1.1102 + #define ENABLE_JIT_OPTIMIZE_METHOD_CALLS 1 1.1103 + #endif 1.1104 +#endif 1.1105 + 1.1106 +#if WTF_CPU_X86 && WTF_COMPILER_MSVC 1.1107 +#define JSC_HOST_CALL __fastcall 1.1108 +#elif WTF_CPU_X86 && WTF_COMPILER_GCC 1.1109 +#define JSC_HOST_CALL __attribute__ ((fastcall)) 1.1110 +#else 1.1111 +#define JSC_HOST_CALL 1.1112 +#endif 1.1113 + 1.1114 +/* Configure the interpreter */ 1.1115 +#if WTF_COMPILER_GCC || (RVCT_VERSION_AT_LEAST(4, 0, 0, 0) && defined(__GNUC__)) 1.1116 +#define HAVE_COMPUTED_GOTO 1 1.1117 +#endif 1.1118 +#if HAVE_COMPUTED_GOTO && ENABLE_INTERPRETER 1.1119 +#define ENABLE_COMPUTED_GOTO_INTERPRETER 1 1.1120 +#endif 1.1121 + 1.1122 +/* Regular Expression Tracing - Set to 1 to trace RegExp's in jsc. Results dumped at exit */ 1.1123 +#define ENABLE_REGEXP_TRACING 0 1.1124 + 1.1125 +/* Yet Another Regex Runtime - turned on by default for JIT enabled ports. */ 1.1126 +#if WTF_PLATFORM_CHROMIUM 1.1127 +#define ENABLE_YARR_JIT 0 1.1128 + 1.1129 +#elif ENABLE_YARR_JIT 1.1130 +/* Setting this flag compares JIT results with interpreter results. */ 1.1131 +#define ENABLE_YARR_JIT_DEBUG 0 1.1132 +#endif 1.1133 + 1.1134 +#if ENABLE_JIT || ENABLE_YARR_JIT 1.1135 +#define ENABLE_ASSEMBLER 1 1.1136 +#endif 1.1137 +/* Setting this flag prevents the assembler from using RWX memory; this may improve 1.1138 + security but currectly comes at a significant performance cost. */ 1.1139 +#if WTF_PLATFORM_IOS 1.1140 +//XXX: this doesn't currently compile in the spidermonkey build 1.1141 +#define ENABLE_ASSEMBLER_WX_EXCLUSIVE 0 1.1142 +#endif 1.1143 + 1.1144 +/* Pick which allocator to use; we only need an executable allocator if the assembler is compiled in. 1.1145 + On x86-64 we use a single fixed mmap, on other platforms we mmap on demand. */ 1.1146 +#if ENABLE_ASSEMBLER 1.1147 +#if WTF_CPU_X86_64 1.1148 +#define ENABLE_EXECUTABLE_ALLOCATOR_FIXED 1 1.1149 +#else 1.1150 +#define ENABLE_EXECUTABLE_ALLOCATOR_DEMAND 1 1.1151 +#endif 1.1152 +#endif 1.1153 + 1.1154 +#if !defined(ENABLE_PAN_SCROLLING) && WTF_OS_WINDOWS 1.1155 +#define ENABLE_PAN_SCROLLING 1 1.1156 +#endif 1.1157 + 1.1158 +#if !defined(ENABLE_SMOOTH_SCROLLING) 1.1159 +#define ENABLE_SMOOTH_SCROLLING 0 1.1160 +#endif 1.1161 + 1.1162 +#if !defined(ENABLE_WEB_ARCHIVE) 1.1163 +#define ENABLE_WEB_ARCHIVE 0 1.1164 +#endif 1.1165 + 1.1166 +/* Use the QXmlStreamReader implementation for XMLDocumentParser */ 1.1167 +/* Use the QXmlQuery implementation for XSLTProcessor */ 1.1168 +#if WTF_PLATFORM_QT 1.1169 +#define WTF_USE_QXMLSTREAM 1 1.1170 +#define WTF_USE_QXMLQUERY 1 1.1171 +#endif 1.1172 + 1.1173 +#if WTF_PLATFORM_MAC 1.1174 +/* Complex text framework */ 1.1175 +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) 1.1176 +#define WTF_USE_ATSUI 0 1.1177 +#define WTF_USE_CORE_TEXT 1 1.1178 +#else 1.1179 +#define WTF_USE_ATSUI 1 1.1180 +#define WTF_USE_CORE_TEXT 0 1.1181 +#endif 1.1182 +#endif 1.1183 + 1.1184 +/* Accelerated compositing */ 1.1185 +#if (WTF_PLATFORM_MAC && !defined(BUILDING_ON_TIGER)) || WTF_PLATFORM_IOS || WTF_PLATFORM_QT || (WTF_PLATFORM_WIN && !WTF_OS_WINCE &&!defined(WIN_CAIRO)) 1.1186 +#define WTF_USE_ACCELERATED_COMPOSITING 1 1.1187 +#endif 1.1188 + 1.1189 +#if (WTF_PLATFORM_MAC && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)) || WTF_PLATFORM_IOS 1.1190 +#define WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK 1 1.1191 +#endif 1.1192 + 1.1193 +#if WTF_PLATFORM_MAC && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) 1.1194 +#define WTF_USE_AVFOUNDATION 1 1.1195 +#endif 1.1196 + 1.1197 +#if WTF_COMPILER_GCC 1.1198 +#define WARN_UNUSED_RETURN __attribute__ ((warn_unused_result)) 1.1199 +#else 1.1200 +#define WARN_UNUSED_RETURN 1.1201 +#endif 1.1202 + 1.1203 +/* COMPILER(CLANG) - Clang */ 1.1204 +#if defined(__clang__) 1.1205 +#define WTF_COMPILER_CLANG 1 1.1206 +#endif 1.1207 + 1.1208 +#if !ENABLE_NETSCAPE_PLUGIN_API || (ENABLE_NETSCAPE_PLUGIN_API && ((WTF_OS_UNIX && (WTF_PLATFORM_QT || WTF_PLATFORM_WX)) || WTF_PLATFORM_GTK)) 1.1209 +#define ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH 1 1.1210 +#endif 1.1211 + 1.1212 +/* Set up a define for a common error that is intended to cause a build error -- thus the space after Error. */ 1.1213 +#define WTF_PLATFORM_CFNETWORK Error USE_macro_should_be_used_with_CFNETWORK 1.1214 + 1.1215 +#define ENABLE_JSC_ZOMBIES 0 1.1216 + 1.1217 +/* FIXME: Eventually we should enable this for all platforms and get rid of the define. */ 1.1218 +#if WTF_PLATFORM_MAC || WTF_PLATFORM_WIN || WTF_PLATFORM_QT 1.1219 +#define WTF_USE_PLATFORM_STRATEGIES 1 1.1220 +#endif 1.1221 + 1.1222 +#if WTF_PLATFORM_WIN 1.1223 +#define WTF_USE_CROSS_PLATFORM_CONTEXT_MENUS 1 1.1224 +#endif 1.1225 + 1.1226 +/* Geolocation request policy. pre-emptive policy is to acquire user permission before acquiring location. 1.1227 + Client based implementations will have option to choose between pre-emptive and nonpre-emptive permission policy. 1.1228 + pre-emptive permission policy is enabled by default for all client-based implementations. */ 1.1229 +#if ENABLE_CLIENT_BASED_GEOLOCATION 1.1230 +#define WTF_USE_PREEMPT_GEOLOCATION_PERMISSION 1 1.1231 +#endif 1.1232 + 1.1233 +#if WTF_CPU_ARM_THUMB2 1.1234 +#define ENABLE_BRANCH_COMPACTION 1 1.1235 +#endif 1.1236 + 1.1237 +#if !defined(ENABLE_THREADING_OPENMP) && defined(_OPENMP) 1.1238 +#define ENABLE_THREADING_OPENMP 1 1.1239 +#endif 1.1240 + 1.1241 +#if !defined(ENABLE_PARALLEL_JOBS) && !ENABLE_SINGLE_THREADED && (ENABLE_THREADING_GENERIC || ENABLE_THREADING_LIBDISPATCH || ENABLE_THREADING_OPENMP) 1.1242 +#define ENABLE_PARALLEL_JOBS 1 1.1243 +#endif 1.1244 + 1.1245 +#if ENABLE_GLIB_SUPPORT 1.1246 +//#include "GTypedefs.h" 1.1247 +#endif 1.1248 + 1.1249 +/* FIXME: This define won't be needed once #27551 is fully landed. However, 1.1250 + since most ports try to support sub-project independence, adding new headers 1.1251 + to WTF causes many ports to break, and so this way we can address the build 1.1252 + breakages one port at a time. */ 1.1253 +#define WTF_USE_EXPORT_MACROS 0 1.1254 + 1.1255 +#if WTF_PLATFORM_QT || WTF_PLATFORM_GTK 1.1256 +#define WTF_USE_UNIX_DOMAIN_SOCKETS 1 1.1257 +#endif 1.1258 + 1.1259 +#endif /* assembler_wtf_Platform_h */