initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 1 | /* |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 2 | * Copyright (C) 2004, 2005, 2006 Apple Inc. |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Library General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Library General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Library General Public License |
| 15 | * along with this library; see the file COPYING.LIB. If not, write to |
| 16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 | * Boston, MA 02110-1301, USA. |
| 18 | * |
| 19 | */ |
| 20 | |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 21 | #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H |
| 22 | #include "autotoolsconfig.h" |
| 23 | #endif |
| 24 | |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 25 | #include <wtf/Platform.h> |
| 26 | |
| 27 | #define MOBILE 0 |
| 28 | |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 29 | #ifdef __APPLE__ |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 30 | #define HAVE_FUNC_USLEEP 1 |
| 31 | #endif /* __APPLE__ */ |
| 32 | |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 33 | #if PLATFORM(WIN_OS) |
| 34 | |
| 35 | #ifndef _WIN32_WINNT |
| 36 | #define _WIN32_WINNT 0x0500 |
| 37 | #endif |
| 38 | |
| 39 | #ifndef WINVER |
| 40 | #define WINVER 0x0500 |
| 41 | #endif |
| 42 | |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 43 | // If we don't define these, they get defined in windef.h. |
| 44 | // We want to use std::min and std::max. |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 45 | #ifndef max |
| 46 | #define max max |
| 47 | #endif |
| 48 | #ifndef min |
| 49 | #define min min |
| 50 | #endif |
| 51 | |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 52 | // CURL needs winsock, so don't prevent inclusion of it |
| 53 | #if !USE(CURL) |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 54 | #ifndef _WINSOCKAPI_ |
| 55 | #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h |
| 56 | #endif |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 57 | #endif |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 58 | |
| 59 | #endif /* PLATFORM(WIN_OS) */ |
| 60 | |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 61 | // On MSW, wx headers need to be included before windows.h is. |
| 62 | // The only way we can always ensure this is if we include wx here. |
| 63 | #if PLATFORM(WX) |
| 64 | // The defines in KeyboardCodes.h conflict with Windows as well, and the only way I've found |
| 65 | // to address the problem is include KeyboarddCodes.h before windows.h, so do it here. |
| 66 | #include "KeyboardCodes.h" |
| 67 | #include <wx/defs.h> |
| 68 | #endif |
| 69 | |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 70 | #if !PLATFORM(SYMBIAN) |
| 71 | #define IMPORT_C |
| 72 | #define EXPORT_C |
| 73 | #endif |
| 74 | |
[email protected] | 42179c2e | 2009-02-20 16:36:07 | [diff] [blame] | 75 | #define WTF_CHANGES 1 |
| 76 | |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [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 |
| 83 | #include <wtf/FastMalloc.h> |
| 84 | |
| 85 | #endif |
| 86 | |
| 87 | // this breaks compilation of <QFontDatabase>, at least, so turn it off for now |
| 88 | // Also generates errors on wx on Windows, presumably because these functions |
| 89 | // are used from wx headers. |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 90 | #if !PLATFORM(QT) && !PLATFORM(WX) && !PLATFORM(CHROMIUM) |
| 91 | #include <wtf/DisallowCType.h> |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 92 | #endif |
| 93 | |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 94 | #if COMPILER(MSVC) |
| 95 | #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1 |
| 96 | #else |
| 97 | #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1 |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 98 | #endif |
| 99 | |
| 100 | #if PLATFORM(WIN) |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 101 | #define WTF_PLATFORM_CG 1 |
| 102 | #undef WTF_PLATFORM_CAIRO |
| 103 | #define WTF_USE_CFNETWORK 1 |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 104 | #undef WTF_USE_WININET |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 105 | #define WTF_PLATFORM_CF 1 |
| 106 | #define WTF_USE_PTHREADS 0 |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 107 | #endif |
| 108 | |
| 109 | #if PLATFORM(SYMBIAN) |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 110 | #undef WIN32 |
| 111 | #undef _WIN32 |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 112 | #undef SKIP_STATIC_CONSTRUCTORS_ON_GCC |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 113 | #define USE_SYSTEM_MALLOC 1 |
| 114 | #define U_HAVE_INT8_T 0 |
| 115 | #define U_HAVE_INT16_T 0 |
| 116 | #define U_HAVE_INT32_T 0 |
| 117 | #define U_HAVE_INT64_T 0 |
| 118 | #define U_HAVE_INTTYPES_H 0 |
| 119 | |
| 120 | #include <stdio.h> |
| 121 | #include <snprintf.h> |
| 122 | #include <limits.h> |
| 123 | #include <wtf/MathExtras.h> |
| 124 | #endif |
| 125 | |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 126 | #if PLATFORM(CHROMIUM) |
[email protected] | 43390223 | 2008-12-18 18:46:40 | [diff] [blame] | 127 | |
| 128 | #define WTF_USE_GOOGLEURL 1 |
| 129 | |
[email protected] | 3697547 | 2009-03-13 14:53:02 | [diff] [blame] | 130 | #if PLATFORM(DARWIN) |
| 131 | |
| 132 | // Chromium's version of WebCore includes the following Objective-C classes. |
| 133 | // The system-provided WebCore framework may also provide these classes. |
| 134 | // Because of the nature of Objective-C binding (dynamically at runtime), |
| 135 | // it's possible for the Chromium-provided versions to interfere with the |
| 136 | // system-provided versions. This may happen when a system framework attempts |
| 137 | // to use WebCore.framework, such as when converting an HTML-flavored string |
| 138 | // to an NSAttributedString. The solution is to force Objective-C class names |
| 139 | // that would conflict to use alternate names. |
| 140 | // |
| 141 | // TODO(mark): This list will hopefully shrink but may also grow. Periodically |
| 142 | // run "nm libwebcore.a | grep -E '[atsATS] ([+-]\[|\.objc_class_name)'" and |
| 143 | // make sure that everything listed there has the alternate ChromiumWebCoreObjC |
| 144 | // name, and that nothing extraneous is listed here. If all Objective-C can |
| 145 | // be eliminated from Chromium's WebCore library, these defines should be |
| 146 | // removed entirely. |
| 147 | |
| 148 | #define ScrollbarPrefsObserver \ |
| 149 | ChromiumWebCoreObjCScrollbarPrefsObserver |
| 150 | #define WebCoreControlTintObserver \ |
| 151 | ChromiumWebCoreObjCWebCoreControlTintObserver |
| 152 | #define WebCoreRenderThemeNotificationObserver \ |
| 153 | ChromiumWebCoreObjCWebCoreRenderThemeNotificationObserver |
| 154 | #define WebFontCache \ |
| 155 | ChromiumWebCoreObjCWebFontCache |
| 156 | |
| 157 | #else // !PLATFORM(DARWIN) |
| 158 | |
[email protected] | c91996ae | 2008-10-22 17:23:24 | [diff] [blame] | 159 | // Don't define SKIA on Mac. Undefine other things as well that might get set |
| 160 | // as side-effects. |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 161 | #define WTF_PLATFORM_SKIA 1 |
[email protected] | c91996ae | 2008-10-22 17:23:24 | [diff] [blame] | 162 | #undef WTF_PLATFORM_CG |
| 163 | #undef WTF_PLATFORM_CF |
[email protected] | 3697547 | 2009-03-13 14:53:02 | [diff] [blame] | 164 | |
| 165 | #endif // !PLATFORM(DARWIN) |
[email protected] | f42cd7e | 2008-10-03 19:26:23 | [diff] [blame] | 166 | |
[email protected] | 34024b38 | 2008-10-04 00:43:28 | [diff] [blame] | 167 | #if !defined(WTF_USE_V8) |
| 168 | #define WTF_USE_V8 1 |
| 169 | #endif |
| 170 | |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 171 | #undef WTF_USE_CFNETWORK |
[email protected] | d03218c8 | 2008-10-02 00:29:35 | [diff] [blame] | 172 | // Upstream Platform.h's #ifdef check for other graphics libraries doesn't |
| 173 | // check SKIA, so it falls back on defining CAIRO. Undo that here. |
| 174 | // TODO(evanm): clean this up. |
| 175 | #undef WTF_PLATFORM_CAIRO |
[email protected] | f42cd7e | 2008-10-03 19:26:23 | [diff] [blame] | 176 | #endif // if PLATFORM(CHROMIUM) |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 177 | |
| 178 | #if !defined(WTF_USE_V8) |
| 179 | #define WTF_USE_V8 0 |
| 180 | #endif |
| 181 | |
| 182 | /* Using V8 implies not using JSC and vice versa */ |
| 183 | #define WTF_USE_JSC !WTF_USE_V8 |
| 184 | |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 185 | #if PLATFORM(CG) |
| 186 | #ifndef CGFLOAT_DEFINED |
| 187 | #ifdef __LP64__ |
| 188 | typedef double CGFloat; |
| 189 | #else |
| 190 | typedef float CGFloat; |
| 191 | #endif |
| 192 | #define CGFLOAT_DEFINED 1 |
| 193 | #endif |
| 194 | #endif /* PLATFORM(CG) */ |
| 195 | |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 196 | #ifdef BUILDING_ON_TIGER |
initial.commit | f5b16fe | 2008-07-27 00:20:51 | [diff] [blame] | 197 | #undef ENABLE_FTPDIR |
| 198 | #define ENABLE_FTPDIR 0 |
[email protected] | de56f378 | 2008-10-01 22:31:35 | [diff] [blame] | 199 | #endif |
| 200 | |
| 201 | #if PLATFORM(WIN) && PLATFORM(CG) |
| 202 | #define WTF_USE_SAFARI_THEME 1 |
| 203 | #endif |
[email protected] | 9cbe1c4c | 2008-09-08 23:20:27 | [diff] [blame] | 204 | |
| 205 | #ifndef WEBCORE_NAVIGATOR_VENDOR |
| 206 | #ifdef GOOGLE_CHROME_BUILD |
| 207 | #define WEBCORE_NAVIGATOR_VENDOR "Google Inc." |
| 208 | #else |
| 209 | #define WEBCORE_NAVIGATOR_VENDOR "" |
| 210 | #endif // ifdef GOOGLE_CHROME_BUILD |
| 211 | #endif // ifndef WEBCORE_NAVIGATOR_VENDOR |