bdash | db30912 | 2006-11-20 12:59:36 +0000 | [diff] [blame] | 1 | /* |
ggaren@apple.com | 82a62d0 | 2008-06-27 22:35:33 +0000 | [diff] [blame] | 2 | * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
bdash | db30912 | 2006-11-20 12:59:36 +0000 | [diff] [blame] | 3 | * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
| 4 | * |
| 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. |
bdash | db30912 | 2006-11-20 12:59:36 +0000 | [diff] [blame] | 19 | * |
| 20 | */ |
| 21 | |
mrowe@apple.com | 12b7c2d | 2008-09-04 21:00:02 +0000 | [diff] [blame] | 22 | #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H |
jmalonzo@webkit.org | 6afc5d4 | 2008-09-04 20:26:16 +0000 | [diff] [blame] | 23 | #include "autotoolsconfig.h" |
| 24 | #endif |
| 25 | |
mjs | bb86351 | 2006-05-09 09:27:55 +0000 | [diff] [blame] | 26 | #include <wtf/Platform.h> |
mjs | 3bfb61b | 2006-03-02 09:12:06 +0000 | [diff] [blame] | 27 | |
mjs@apple.com | acbcc28 | 2010-01-05 08:58:28 +0000 | [diff] [blame] | 28 | #if OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC) |
sfalken@apple.com | 46fc85a | 2009-04-20 21:25:37 +0000 | [diff] [blame] | 29 | #if defined(BUILDING_JavaScriptCore) || defined(BUILDING_WTF) |
| 30 | #define JS_EXPORTDATA __declspec(dllexport) |
| 31 | #else |
| 32 | #define JS_EXPORTDATA __declspec(dllimport) |
| 33 | #endif |
| 34 | #else |
| 35 | #define JS_EXPORTDATA |
| 36 | #endif |
| 37 | |
mjs@apple.com | acbcc28 | 2010-01-05 08:58:28 +0000 | [diff] [blame] | 38 | #if OS(WINDOWS) |
darin | f64e667 | 2005-08-31 07:57:56 +0000 | [diff] [blame] | 39 | |
aroben | a6c43b9 | 2006-12-08 22:34:07 +0000 | [diff] [blame] | 40 | // If we don't define these, they get defined in windef.h. |
| 41 | // We want to use std::min and std::max |
| 42 | #define max max |
| 43 | #define min min |
andersca | cdd6842 | 2006-11-18 03:15:42 +0000 | [diff] [blame] | 44 | |
mjs@apple.com | acbcc28 | 2010-01-05 08:58:28 +0000 | [diff] [blame] | 45 | #if !COMPILER(MSVC7) && !OS(WINCE) |
ggaren | d1db091 | 2007-09-13 18:52:29 +0000 | [diff] [blame] | 46 | // We need to define this before the first #include of stdlib.h or it won't contain rand_s. |
eric@webkit.org | cf4cb66 | 2008-02-02 23:13:40 +0000 | [diff] [blame] | 47 | #ifndef _CRT_RAND_S |
ggaren | d1db091 | 2007-09-13 18:52:29 +0000 | [diff] [blame] | 48 | #define _CRT_RAND_S |
kevino@webkit.org | 79fbef9 | 2007-11-24 00:52:18 +0000 | [diff] [blame] | 49 | #endif |
eric@webkit.org | cf4cb66 | 2008-02-02 23:13:40 +0000 | [diff] [blame] | 50 | #endif |
ggaren | d1db091 | 2007-09-13 18:52:29 +0000 | [diff] [blame] | 51 | |
darin | f64e667 | 2005-08-31 07:57:56 +0000 | [diff] [blame] | 52 | #endif |
| 53 | |
mjs@apple.com | acbcc28 | 2010-01-05 08:58:28 +0000 | [diff] [blame] | 54 | #if OS(FREEBSD) || OS(OPENBSD) |
oliver | a7bce7c | 2007-10-12 15:26:27 +0000 | [diff] [blame] | 55 | #define HAVE_PTHREAD_NP_H 1 |
| 56 | #endif |
| 57 | |
weinig | ab5f09e | 2006-07-29 23:15:25 +0000 | [diff] [blame] | 58 | /* FIXME: if all platforms have these, do they really need #defines? */ |
mjs | cff5e5e | 2005-09-27 22:37:33 +0000 | [diff] [blame] | 59 | #define HAVE_STDINT_H 1 |
darin | f64e667 | 2005-08-31 07:57:56 +0000 | [diff] [blame] | 60 | |
mjs | bb86351 | 2006-05-09 09:27:55 +0000 | [diff] [blame] | 61 | #define WTF_CHANGES 1 |
mjs | b64c50a | 2005-10-03 21:13:12 +0000 | [diff] [blame] | 62 | |
| 63 | #ifdef __cplusplus |
| 64 | #undef new |
| 65 | #undef delete |
mjs | bb86351 | 2006-05-09 09:27:55 +0000 | [diff] [blame] | 66 | #include <wtf/FastMalloc.h> |
mjs | b64c50a | 2005-10-03 21:13:12 +0000 | [diff] [blame] | 67 | #endif |
darin | eb0d86d | 2007-10-16 20:13:24 +0000 | [diff] [blame] | 68 | |
kevino@webkit.org | 007acf5 | 2007-11-20 00:24:49 +0000 | [diff] [blame] | 69 | // this breaks compilation of <QFontDatabase>, at least, so turn it off for now |
| 70 | // Also generates errors on wx on Windows, because these functions |
| 71 | // are used from wx headers. |
| 72 | #if !PLATFORM(QT) && !PLATFORM(WX) |
darin | eb0d86d | 2007-10-16 20:13:24 +0000 | [diff] [blame] | 73 | #include <wtf/DisallowCType.h> |
hausmann | 94214d7 | 2007-10-19 11:28:58 +0000 | [diff] [blame] | 74 | #endif |
kmccullough@apple.com | ac76976 | 2008-04-16 19:08:03 +0000 | [diff] [blame] | 75 | |
levin@chromium.org | b45937d | 2009-11-08 21:02:20 +0000 | [diff] [blame] | 76 | #if PLATFORM(CHROMIUM) |
| 77 | #if !defined(WTF_USE_V8) |
| 78 | #define WTF_USE_V8 1 |
| 79 | #endif |
| 80 | #endif /* PLATFORM(CHROMIUM) */ |
| 81 | |
| 82 | #if !defined(WTF_USE_V8) |
| 83 | #define WTF_USE_V8 0 |
| 84 | #endif /* !defined(WTF_USE_V8) */ |
| 85 | |
| 86 | /* Using V8 implies not using JSC and vice versa */ |
| 87 | #define WTF_USE_JSC !WTF_USE_V8 |