blob: 30bed8e6a1f67bdd27259e45c8a683ad8bc97cda [file] [log] [blame]
darin707988e2006-01-16 01:29:54 +00001/*
mark.lam@apple.comf009ae42013-03-05 15:54:13 +00002 * Copyright (C) 2004, 2005, 2006, 2013 Apple Inc.
eric@webkit.org8b2edd02009-09-09 22:35:57 +00003 * Copyright (C) 2009 Google Inc. All rights reserved.
4 *
darin707988e2006-01-16 01:29:54 +00005 * 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.
darin707988e2006-01-16 01:29:54 +000019 *
bfulgham@apple.comda8c93c2013-07-12 19:30:23 +000020 */
darin707988e2006-01-16 01:29:54 +000021
mrowe@apple.com12b7c2d2008-09-04 21:00:02 +000022#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
eric@webkit.orgd99f85b2010-05-15 13:37:59 +000023#ifdef BUILDING_WITH_CMAKE
24#include "cmakeconfig.h"
25#else
jmalonzo@webkit.org6afc5d42008-09-04 20:26:16 +000026#include "autotoolsconfig.h"
27#endif
eric@webkit.orgd99f85b2010-05-15 13:37:59 +000028#endif
jmalonzo@webkit.org6afc5d42008-09-04 20:26:16 +000029
mjsbb863512006-05-09 09:27:55 +000030#include <wtf/Platform.h>
mjs3bfb61b2006-03-02 09:12:06 +000031
mark.lam@apple.comf009ae42013-03-05 15:54:13 +000032#if PLATFORM(MAC) || PLATFORM(IOS)
33#define WTF_USE_FILE_LOCK 1
34#endif
35
paroga@webkit.org55e36592013-06-14 22:49:14 +000036#if PLATFORM(WIN) && !USE(WINGDI)
jeffm@apple.com16e86442011-08-03 20:15:53 +000037#include <WebCore/WebCoreHeaderDetection.h>
38#endif
39
kevino@webkit.org531cac32011-03-15 14:59:20 +000040#include <wtf/ExportMacros.h>
commit-queue@webkit.org6343b722011-12-15 00:51:42 +000041#include "PlatformExportMacros.h"
kevino@webkit.org531cac32011-03-15 14:59:20 +000042
kbalazs@webkit.org768684d2012-04-12 22:28:03 +000043#include <runtime/JSExportMacros.h>
kbalazs@webkit.org768684d2012-04-12 22:28:03 +000044
mrowe@apple.com4d7e81e2007-11-20 16:06:23 +000045#ifdef __APPLE__
darin71e27492006-01-25 03:35:00 +000046#define HAVE_FUNC_USLEEP 1
weinigf18aae32006-08-03 21:55:57 +000047#endif /* __APPLE__ */
darin71e27492006-01-25 03:35:00 +000048
mjs@apple.comacbcc282010-01-05 08:58:28 +000049#if OS(WINDOWS)
darin707988e2006-01-16 01:29:54 +000050
sfalkenc3cff1c2006-05-26 00:36:30 +000051#ifndef _WIN32_WINNT
commit-queue@webkit.orgb34aa9c2013-01-28 00:26:55 +000052#define _WIN32_WINNT 0x0502
sfalkenc3cff1c2006-05-26 00:36:30 +000053#endif
54
55#ifndef WINVER
commit-queue@webkit.orgb34aa9c2013-01-28 00:26:55 +000056#define WINVER 0x0502
sfalkenc3cff1c2006-05-26 00:36:30 +000057#endif
58
aroben@apple.com06d35b92008-03-27 01:43:54 +000059// If we don't define these, they get defined in windef.h.
aroben@apple.com1840f962007-11-12 11:02:47 +000060// We want to use std::min and std::max.
arobenfee2e822007-06-12 21:50:34 +000061#ifndef max
arobena6c43b92006-12-08 22:34:07 +000062#define max max
arobenfee2e822007-06-12 21:50:34 +000063#endif
64#ifndef min
arobena6c43b92006-12-08 22:34:07 +000065#define min min
arobenfee2e822007-06-12 21:50:34 +000066#endif
67
kevino@webkit.org79fbef92007-11-24 00:52:18 +000068// CURL needs winsock, so don't prevent inclusion of it
bfulgham@webkit.org147773f2009-06-12 21:36:08 +000069#if !USE(CURL)
arobenfee2e822007-06-12 21:50:34 +000070#ifndef _WINSOCKAPI_
71#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
72#endif
bfulgham@webkit.org147773f2009-06-12 21:36:08 +000073#endif
bdashdb309122006-11-20 12:59:36 +000074
mjs@apple.comacbcc282010-01-05 08:58:28 +000075#endif /* OS(WINDOWS) */
weinigf18aae32006-08-03 21:55:57 +000076
darin707988e2006-01-16 01:29:54 +000077#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
mjsbb863512006-05-09 09:27:55 +000083#include <wtf/FastMalloc.h>
darin707988e2006-01-16 01:29:54 +000084
weinig@apple.com07737d72012-02-19 01:08:39 +000085#include <ciso646>
86
darin707988e2006-01-16 01:29:54 +000087#endif
eseidel864b4dd2006-02-24 01:11:00 +000088
darineb0d86d2007-10-16 20:13:24 +000089#include <wtf/DisallowCType.h>
90
mrowe@apple.comfbe724c2008-09-03 23:46:54 +000091#if COMPILER(MSVC)
92#define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
laszlo.1.gombos@nokia.comae659222011-11-13 04:37:43 +000093#else
mrowe@apple.comfbe724c2008-09-03 23:46:54 +000094#define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
eseidel864b4dd2006-02-24 01:11:00 +000095#endif
anderscacd71fdd2006-09-14 01:56:44 +000096
arobenfee2e822007-06-12 21:50:34 +000097#if PLATFORM(WIN)
bfulgham@webkit.org5fcb8a12011-07-13 19:31:52 +000098#if PLATFORM(WIN_CAIRO)
paroga@webkit.orgf226d9f2011-04-17 10:04:48 +000099#undef WTF_USE_CG
paroga@webkit.org411b4762011-04-16 10:37:01 +0000100#define WTF_USE_CAIRO 1
bfulgham@webkit.org5742b26b2009-07-13 18:34:44 +0000101#define WTF_USE_CURL 1
102#ifndef _WINSOCKAPI_
103#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
104#endif
paroga@webkit.org55e36592013-06-14 22:49:14 +0000105#elif !USE(WINGDI)
paroga@webkit.orgf226d9f2011-04-17 10:04:48 +0000106#define WTF_USE_CG 1
paroga@webkit.org411b4762011-04-16 10:37:01 +0000107#undef WTF_USE_CAIRO
bfulgham@webkit.org5742b26b2009-07-13 18:34:44 +0000108#undef WTF_USE_CURL
109#endif
anderscacd71fdd2006-09-14 01:56:44 +0000110#endif
bdash880df152006-11-11 02:55:57 +0000111
mitz@apple.comc0b050b2008-09-06 22:39:34 +0000112#if PLATFORM(MAC)
simon.fraser@apple.comccf36902009-03-17 19:24:35 +0000113// New theme
hyatt@apple.com084394f2008-10-17 21:26:46 +0000114#define WTF_USE_NEW_THEME 1
simon.fraser@apple.comccf36902009-03-17 19:24:35 +0000115#endif // PLATFORM(MAC)
mitz@apple.comc0b050b2008-09-06 22:39:34 +0000116
paroga@webkit.orgf226d9f2011-04-17 10:04:48 +0000117#if USE(CG)
arobenfee2e822007-06-12 21:50:34 +0000118#ifndef CGFLOAT_DEFINED
119#ifdef __LP64__
120typedef double CGFloat;
121#else
122typedef float CGFloat;
123#endif
124#define CGFLOAT_DEFINED 1
125#endif
paroga@webkit.orgf226d9f2011-04-17 10:04:48 +0000126#endif /* USE(CG) */
aroben808a0022007-06-27 04:07:35 +0000127
commit-queue@webkit.org4974d27f2013-02-21 23:50:20 +0000128#if PLATFORM(WIN) && USE(CG)
129#define WTF_USE_SAFARI_THEME 1
130#endif
131
cmarrin@apple.com14a3dcf2011-01-07 20:00:22 +0000132// CoreAnimation is available to IOS, Mac and Windows if using CG
paroga@webkit.orgf226d9f2011-04-17 10:04:48 +0000133#if PLATFORM(MAC) || PLATFORM(IOS) || (PLATFORM(WIN) && USE(CG))
paroga@webkit.orge0e0b032011-04-17 18:59:57 +0000134#define WTF_USE_CA 1
cmarrin@apple.com14a3dcf2011-01-07 20:00:22 +0000135#endif
136
jeffm@apple.com83bc8482011-08-31 23:55:01 +0000137// 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.comda8c93c2013-07-12 19:30:23 +0000139#if PLATFORM(WIN) && USE(CG) && HAVE(AVCF)
jeffm@apple.comecd746b2011-08-04 20:06:48 +0000140#define WTF_USE_AVFOUNDATION 1
bfulgham@apple.com31e96402013-07-05 22:17:27 +0000141
142#if HAVE(AVCF_LEGIBLE_OUTPUT)
bfulgham@apple.com83139452013-07-18 20:30:23 +0000143#define WTF_USE_AVFOUNDATION 1
bfulgham@apple.com31e96402013-07-05 22:17:27 +0000144#define HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP 1
145#define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1
bfulgham@apple.com83139452013-07-18 20:30:23 +0000146#define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1
bfulgham@apple.com31e96402013-07-05 22:17:27 +0000147#endif
148
jeffm@apple.com16e86442011-08-03 20:15:53 +0000149#endif
rniwa@webkit.org25887152011-10-08 07:31:44 +0000150