blob: 006ab3dce5154a301499f48a26b8d249fd4bd237 [file] [log] [blame]
bdashdb309122006-11-20 12:59:36 +00001/*
ggaren@apple.com82a62d02008-06-27 22:35:33 +00002 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
bdashdb309122006-11-20 12:59:36 +00003 * 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
ddkilzerc8eccec2007-09-26 02:29:57 +000017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
bdashdb309122006-11-20 12:59:36 +000019 *
20 */
21
mrowe@apple.com12b7c2d2008-09-04 21:00:02 +000022#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
jmalonzo@webkit.org6afc5d42008-09-04 20:26:16 +000023#include "autotoolsconfig.h"
24#endif
25
mjsbb863512006-05-09 09:27:55 +000026#include <wtf/Platform.h>
mjs3bfb61b2006-03-02 09:12:06 +000027
mjs@apple.comacbcc282010-01-05 08:58:28 +000028#if OS(WINDOWS) && !defined(BUILDING_WX__) && !COMPILER(GCC)
sfalken@apple.com46fc85a2009-04-20 21:25:37 +000029#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.comacbcc282010-01-05 08:58:28 +000038#if OS(WINDOWS)
darinf64e6672005-08-31 07:57:56 +000039
arobena6c43b92006-12-08 22:34:07 +000040// 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
anderscacdd68422006-11-18 03:15:42 +000044
mjs@apple.comacbcc282010-01-05 08:58:28 +000045#if !COMPILER(MSVC7) && !OS(WINCE)
ggarend1db0912007-09-13 18:52:29 +000046// We need to define this before the first #include of stdlib.h or it won't contain rand_s.
eric@webkit.orgcf4cb662008-02-02 23:13:40 +000047#ifndef _CRT_RAND_S
ggarend1db0912007-09-13 18:52:29 +000048#define _CRT_RAND_S
kevino@webkit.org79fbef92007-11-24 00:52:18 +000049#endif
eric@webkit.orgcf4cb662008-02-02 23:13:40 +000050#endif
ggarend1db0912007-09-13 18:52:29 +000051
darinf64e6672005-08-31 07:57:56 +000052#endif
53
mjs@apple.comacbcc282010-01-05 08:58:28 +000054#if OS(FREEBSD) || OS(OPENBSD)
olivera7bce7c2007-10-12 15:26:27 +000055#define HAVE_PTHREAD_NP_H 1
56#endif
57
weinigab5f09e2006-07-29 23:15:25 +000058/* FIXME: if all platforms have these, do they really need #defines? */
mjscff5e5e2005-09-27 22:37:33 +000059#define HAVE_STDINT_H 1
darinf64e6672005-08-31 07:57:56 +000060
mjsbb863512006-05-09 09:27:55 +000061#define WTF_CHANGES 1
mjsb64c50a2005-10-03 21:13:12 +000062
63#ifdef __cplusplus
64#undef new
65#undef delete
mjsbb863512006-05-09 09:27:55 +000066#include <wtf/FastMalloc.h>
mjsb64c50a2005-10-03 21:13:12 +000067#endif
darineb0d86d2007-10-16 20:13:24 +000068
kevino@webkit.org007acf52007-11-20 00:24:49 +000069// 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)
darineb0d86d2007-10-16 20:13:24 +000073#include <wtf/DisallowCType.h>
hausmann94214d72007-10-19 11:28:58 +000074#endif
kmccullough@apple.comac769762008-04-16 19:08:03 +000075
levin@chromium.orgb45937d2009-11-08 21:02:20 +000076#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