darin | 707988e | 2006-01-16 01:29:54 +0000 | [diff] [blame] | 1 | /* |
mark.lam@apple.com | f009ae4 | 2013-03-05 15:54:13 +0000 | [diff] [blame] | 2 | * Copyright (C) 2004, 2005, 2006, 2013 Apple Inc. |
eric@webkit.org | 8b2edd0 | 2009-09-09 22:35:57 +0000 | [diff] [blame] | 3 | * Copyright (C) 2009 Google Inc. All rights reserved. |
| 4 | * |
darin | 707988e | 2006-01-16 01:29:54 +0000 | [diff] [blame] | 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Library General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Library General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Library General Public License |
| 16 | * along with this library; see the file COPYING.LIB. If not, write to |
ddkilzer | c8eccec | 2007-09-26 02:29:57 +0000 | [diff] [blame] | 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 | * Boston, MA 02110-1301, USA. |
darin | 707988e | 2006-01-16 01:29:54 +0000 | [diff] [blame] | 19 | * |
bfulgham@apple.com | da8c93c | 2013-07-12 19:30:23 +0000 | [diff] [blame] | 20 | */ |
darin | 707988e | 2006-01-16 01:29:54 +0000 | [diff] [blame] | 21 | |
mrowe@apple.com | 12b7c2d | 2008-09-04 21:00:02 +0000 | [diff] [blame] | 22 | #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H |
eric@webkit.org | d99f85b | 2010-05-15 13:37:59 +0000 | [diff] [blame] | 23 | #ifdef BUILDING_WITH_CMAKE |
| 24 | #include "cmakeconfig.h" |
| 25 | #else |
jmalonzo@webkit.org | 6afc5d4 | 2008-09-04 20:26:16 +0000 | [diff] [blame] | 26 | #include "autotoolsconfig.h" |
| 27 | #endif |
eric@webkit.org | d99f85b | 2010-05-15 13:37:59 +0000 | [diff] [blame] | 28 | #endif |
jmalonzo@webkit.org | 6afc5d4 | 2008-09-04 20:26:16 +0000 | [diff] [blame] | 29 | |
mjs | bb86351 | 2006-05-09 09:27:55 +0000 | [diff] [blame] | 30 | #include <wtf/Platform.h> |
mjs | 3bfb61b | 2006-03-02 09:12:06 +0000 | [diff] [blame] | 31 | |
mark.lam@apple.com | f009ae4 | 2013-03-05 15:54:13 +0000 | [diff] [blame] | 32 | #if PLATFORM(MAC) || PLATFORM(IOS) |
| 33 | #define WTF_USE_FILE_LOCK 1 |
| 34 | #endif |
| 35 | |
paroga@webkit.org | 55e3659 | 2013-06-14 22:49:14 +0000 | [diff] [blame] | 36 | #if PLATFORM(WIN) && !USE(WINGDI) |
jeffm@apple.com | 16e8644 | 2011-08-03 20:15:53 +0000 | [diff] [blame] | 37 | #include <WebCore/WebCoreHeaderDetection.h> |
| 38 | #endif |
| 39 | |
kevino@webkit.org | 531cac3 | 2011-03-15 14:59:20 +0000 | [diff] [blame] | 40 | #include <wtf/ExportMacros.h> |
commit-queue@webkit.org | 6343b72 | 2011-12-15 00:51:42 +0000 | [diff] [blame] | 41 | #include "PlatformExportMacros.h" |
kevino@webkit.org | 531cac3 | 2011-03-15 14:59:20 +0000 | [diff] [blame] | 42 | |
kbalazs@webkit.org | 768684d | 2012-04-12 22:28:03 +0000 | [diff] [blame] | 43 | #include <runtime/JSExportMacros.h> |
kbalazs@webkit.org | 768684d | 2012-04-12 22:28:03 +0000 | [diff] [blame] | 44 | |
mrowe@apple.com | 4d7e81e | 2007-11-20 16:06:23 +0000 | [diff] [blame] | 45 | #ifdef __APPLE__ |
darin | 71e2749 | 2006-01-25 03:35:00 +0000 | [diff] [blame] | 46 | #define HAVE_FUNC_USLEEP 1 |
weinig | f18aae3 | 2006-08-03 21:55:57 +0000 | [diff] [blame] | 47 | #endif /* __APPLE__ */ |
darin | 71e2749 | 2006-01-25 03:35:00 +0000 | [diff] [blame] | 48 | |
mjs@apple.com | acbcc28 | 2010-01-05 08:58:28 +0000 | [diff] [blame] | 49 | #if OS(WINDOWS) |
darin | 707988e | 2006-01-16 01:29:54 +0000 | [diff] [blame] | 50 | |
sfalken | c3cff1c | 2006-05-26 00:36:30 +0000 | [diff] [blame] | 51 | #ifndef _WIN32_WINNT |
commit-queue@webkit.org | b34aa9c | 2013-01-28 00:26:55 +0000 | [diff] [blame] | 52 | #define _WIN32_WINNT 0x0502 |
sfalken | c3cff1c | 2006-05-26 00:36:30 +0000 | [diff] [blame] | 53 | #endif |
| 54 | |
| 55 | #ifndef WINVER |
commit-queue@webkit.org | b34aa9c | 2013-01-28 00:26:55 +0000 | [diff] [blame] | 56 | #define WINVER 0x0502 |
sfalken | c3cff1c | 2006-05-26 00:36:30 +0000 | [diff] [blame] | 57 | #endif |
| 58 | |
aroben@apple.com | 06d35b9 | 2008-03-27 01:43:54 +0000 | [diff] [blame] | 59 | // If we don't define these, they get defined in windef.h. |
aroben@apple.com | 1840f96 | 2007-11-12 11:02:47 +0000 | [diff] [blame] | 60 | // We want to use std::min and std::max. |
aroben | fee2e82 | 2007-06-12 21:50:34 +0000 | [diff] [blame] | 61 | #ifndef max |
aroben | a6c43b9 | 2006-12-08 22:34:07 +0000 | [diff] [blame] | 62 | #define max max |
aroben | fee2e82 | 2007-06-12 21:50:34 +0000 | [diff] [blame] | 63 | #endif |
| 64 | #ifndef min |
aroben | a6c43b9 | 2006-12-08 22:34:07 +0000 | [diff] [blame] | 65 | #define min min |
aroben | fee2e82 | 2007-06-12 21:50:34 +0000 | [diff] [blame] | 66 | #endif |
| 67 | |
kevino@webkit.org | 79fbef9 | 2007-11-24 00:52:18 +0000 | [diff] [blame] | 68 | // CURL needs winsock, so don't prevent inclusion of it |
bfulgham@webkit.org | 147773f | 2009-06-12 21:36:08 +0000 | [diff] [blame] | 69 | #if !USE(CURL) |
aroben | fee2e82 | 2007-06-12 21:50:34 +0000 | [diff] [blame] | 70 | #ifndef _WINSOCKAPI_ |
| 71 | #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h |
| 72 | #endif |
bfulgham@webkit.org | 147773f | 2009-06-12 21:36:08 +0000 | [diff] [blame] | 73 | #endif |
bdash | db30912 | 2006-11-20 12:59:36 +0000 | [diff] [blame] | 74 | |
mjs@apple.com | acbcc28 | 2010-01-05 08:58:28 +0000 | [diff] [blame] | 75 | #endif /* OS(WINDOWS) */ |
weinig | f18aae3 | 2006-08-03 21:55:57 +0000 | [diff] [blame] | 76 | |
darin | 707988e | 2006-01-16 01:29:54 +0000 | [diff] [blame] | 77 | #ifdef __cplusplus |
| 78 | |
| 79 | // These undefs match up with defines in WebCorePrefix.h for Mac OS X. |
| 80 | // Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h". |
| 81 | #undef new |
| 82 | #undef delete |
mjs | bb86351 | 2006-05-09 09:27:55 +0000 | [diff] [blame] | 83 | #include <wtf/FastMalloc.h> |
darin | 707988e | 2006-01-16 01:29:54 +0000 | [diff] [blame] | 84 | |
weinig@apple.com | 07737d7 | 2012-02-19 01:08:39 +0000 | [diff] [blame] | 85 | #include <ciso646> |
| 86 | |
darin | 707988e | 2006-01-16 01:29:54 +0000 | [diff] [blame] | 87 | #endif |
eseidel | 864b4dd | 2006-02-24 01:11:00 +0000 | [diff] [blame] | 88 | |
darin | eb0d86d | 2007-10-16 20:13:24 +0000 | [diff] [blame] | 89 | #include <wtf/DisallowCType.h> |
| 90 | |
mrowe@apple.com | fbe724c | 2008-09-03 23:46:54 +0000 | [diff] [blame] | 91 | #if COMPILER(MSVC) |
| 92 | #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1 |
laszlo.1.gombos@nokia.com | ae65922 | 2011-11-13 04:37:43 +0000 | [diff] [blame] | 93 | #else |
mrowe@apple.com | fbe724c | 2008-09-03 23:46:54 +0000 | [diff] [blame] | 94 | #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1 |
eseidel | 864b4dd | 2006-02-24 01:11:00 +0000 | [diff] [blame] | 95 | #endif |
andersca | cd71fdd | 2006-09-14 01:56:44 +0000 | [diff] [blame] | 96 | |
aroben | fee2e82 | 2007-06-12 21:50:34 +0000 | [diff] [blame] | 97 | #if PLATFORM(WIN) |
bfulgham@webkit.org | 5fcb8a1 | 2011-07-13 19:31:52 +0000 | [diff] [blame] | 98 | #if PLATFORM(WIN_CAIRO) |
paroga@webkit.org | f226d9f | 2011-04-17 10:04:48 +0000 | [diff] [blame] | 99 | #undef WTF_USE_CG |
paroga@webkit.org | 411b476 | 2011-04-16 10:37:01 +0000 | [diff] [blame] | 100 | #define WTF_USE_CAIRO 1 |
bfulgham@webkit.org | 5742b26b | 2009-07-13 18:34:44 +0000 | [diff] [blame] | 101 | #define WTF_USE_CURL 1 |
| 102 | #ifndef _WINSOCKAPI_ |
| 103 | #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h |
| 104 | #endif |
paroga@webkit.org | 55e3659 | 2013-06-14 22:49:14 +0000 | [diff] [blame] | 105 | #elif !USE(WINGDI) |
paroga@webkit.org | f226d9f | 2011-04-17 10:04:48 +0000 | [diff] [blame] | 106 | #define WTF_USE_CG 1 |
paroga@webkit.org | 411b476 | 2011-04-16 10:37:01 +0000 | [diff] [blame] | 107 | #undef WTF_USE_CAIRO |
bfulgham@webkit.org | 5742b26b | 2009-07-13 18:34:44 +0000 | [diff] [blame] | 108 | #undef WTF_USE_CURL |
| 109 | #endif |
andersca | cd71fdd | 2006-09-14 01:56:44 +0000 | [diff] [blame] | 110 | #endif |
bdash | 880df15 | 2006-11-11 02:55:57 +0000 | [diff] [blame] | 111 | |
mitz@apple.com | c0b050b | 2008-09-06 22:39:34 +0000 | [diff] [blame] | 112 | #if PLATFORM(MAC) |
simon.fraser@apple.com | ccf3690 | 2009-03-17 19:24:35 +0000 | [diff] [blame] | 113 | // New theme |
hyatt@apple.com | 084394f | 2008-10-17 21:26:46 +0000 | [diff] [blame] | 114 | #define WTF_USE_NEW_THEME 1 |
simon.fraser@apple.com | ccf3690 | 2009-03-17 19:24:35 +0000 | [diff] [blame] | 115 | #endif // PLATFORM(MAC) |
mitz@apple.com | c0b050b | 2008-09-06 22:39:34 +0000 | [diff] [blame] | 116 | |
paroga@webkit.org | f226d9f | 2011-04-17 10:04:48 +0000 | [diff] [blame] | 117 | #if USE(CG) |
aroben | fee2e82 | 2007-06-12 21:50:34 +0000 | [diff] [blame] | 118 | #ifndef CGFLOAT_DEFINED |
| 119 | #ifdef __LP64__ |
| 120 | typedef double CGFloat; |
| 121 | #else |
| 122 | typedef float CGFloat; |
| 123 | #endif |
| 124 | #define CGFLOAT_DEFINED 1 |
| 125 | #endif |
paroga@webkit.org | f226d9f | 2011-04-17 10:04:48 +0000 | [diff] [blame] | 126 | #endif /* USE(CG) */ |
aroben | 808a002 | 2007-06-27 04:07:35 +0000 | [diff] [blame] | 127 | |
commit-queue@webkit.org | 4974d27f | 2013-02-21 23:50:20 +0000 | [diff] [blame] | 128 | #if PLATFORM(WIN) && USE(CG) |
| 129 | #define WTF_USE_SAFARI_THEME 1 |
| 130 | #endif |
| 131 | |
cmarrin@apple.com | 14a3dcf | 2011-01-07 20:00:22 +0000 | [diff] [blame] | 132 | // CoreAnimation is available to IOS, Mac and Windows if using CG |
paroga@webkit.org | f226d9f | 2011-04-17 10:04:48 +0000 | [diff] [blame] | 133 | #if PLATFORM(MAC) || PLATFORM(IOS) || (PLATFORM(WIN) && USE(CG)) |
paroga@webkit.org | e0e0b03 | 2011-04-17 18:59:57 +0000 | [diff] [blame] | 134 | #define WTF_USE_CA 1 |
cmarrin@apple.com | 14a3dcf | 2011-01-07 20:00:22 +0000 | [diff] [blame] | 135 | #endif |
| 136 | |
jeffm@apple.com | 83bc848 | 2011-08-31 23:55:01 +0000 | [diff] [blame] | 137 | // FIXME: Move this to JavaScriptCore/wtf/Platform.h, which is where we define WTF_USE_AVFOUNDATION on the Mac. |
| 138 | // https://bugs.webkit.org/show_bug.cgi?id=67334 |
bfulgham@apple.com | da8c93c | 2013-07-12 19:30:23 +0000 | [diff] [blame] | 139 | #if PLATFORM(WIN) && USE(CG) && HAVE(AVCF) |
jeffm@apple.com | ecd746b | 2011-08-04 20:06:48 +0000 | [diff] [blame] | 140 | #define WTF_USE_AVFOUNDATION 1 |
bfulgham@apple.com | 31e9640 | 2013-07-05 22:17:27 +0000 | [diff] [blame] | 141 | |
| 142 | #if HAVE(AVCF_LEGIBLE_OUTPUT) |
bfulgham@apple.com | 8313945 | 2013-07-18 20:30:23 +0000 | [diff] [blame^] | 143 | #define WTF_USE_AVFOUNDATION 1 |
bfulgham@apple.com | 31e9640 | 2013-07-05 22:17:27 +0000 | [diff] [blame] | 144 | #define HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP 1 |
| 145 | #define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1 |
bfulgham@apple.com | 8313945 | 2013-07-18 20:30:23 +0000 | [diff] [blame^] | 146 | #define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1 |
bfulgham@apple.com | 31e9640 | 2013-07-05 22:17:27 +0000 | [diff] [blame] | 147 | #endif |
| 148 | |
jeffm@apple.com | 16e8644 | 2011-08-03 20:15:53 +0000 | [diff] [blame] | 149 | #endif |
rniwa@webkit.org | 2588715 | 2011-10-08 07:31:44 +0000 | [diff] [blame] | 150 | |