blob: cf2579a5c8d6154b617c453c78a024f45b26e1b7 [file] [log] [blame]
darin707988e2006-01-16 01:29:54 +00001/*
darin@apple.com7e45de82014-01-13 02:42:54 +00002 * Copyright (C) 2004, 2005, 2006, 2013, 2014 Apple Inc. All rights reserved.
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
mrobinson@webkit.org3fdbc202014-03-25 17:45:52 +000022#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H && defined(BUILDING_WITH_CMAKE)
eric@webkit.orgd99f85b2010-05-15 13:37:59 +000023#include "cmakeconfig.h"
eric@webkit.orgd99f85b2010-05-15 13:37:59 +000024#endif
jmalonzo@webkit.org6afc5d42008-09-04 20:26:16 +000025
mjsbb863512006-05-09 09:27:55 +000026#include <wtf/Platform.h>
mjs3bfb61b2006-03-02 09:12:06 +000027
darin@apple.com7e45de82014-01-13 02:42:54 +000028#if PLATFORM(COCOA)
mrobinson@webkit.org2c91b422015-05-01 23:38:18 +000029#define USE_FILE_LOCK 1
mark.lam@apple.comf009ae42013-03-05 15:54:13 +000030#endif
31
paroga@webkit.org55e36592013-06-14 22:49:14 +000032#if PLATFORM(WIN) && !USE(WINGDI)
bfulgham@apple.com8afb3b72016-03-30 19:36:11 +000033#include "WebCoreHeaderDetection.h"
jeffm@apple.com16e86442011-08-03 20:15:53 +000034#endif
35
kevino@webkit.org531cac32011-03-15 14:59:20 +000036#include <wtf/ExportMacros.h>
commit-queue@webkit.org6343b722011-12-15 00:51:42 +000037#include "PlatformExportMacros.h"
kevino@webkit.org531cac32011-03-15 14:59:20 +000038
kbalazs@webkit.org768684d2012-04-12 22:28:03 +000039#include <runtime/JSExportMacros.h>
kbalazs@webkit.org768684d2012-04-12 22:28:03 +000040
mrowe@apple.com4d7e81e2007-11-20 16:06:23 +000041#ifdef __APPLE__
darin71e27492006-01-25 03:35:00 +000042#define HAVE_FUNC_USLEEP 1
weinigf18aae32006-08-03 21:55:57 +000043#endif /* __APPLE__ */
darin71e27492006-01-25 03:35:00 +000044
mjs@apple.comacbcc282010-01-05 08:58:28 +000045#if OS(WINDOWS)
darin707988e2006-01-16 01:29:54 +000046
kevino@webkit.org79fbef92007-11-24 00:52:18 +000047// CURL needs winsock, so don't prevent inclusion of it
bfulgham@webkit.org147773f2009-06-12 21:36:08 +000048#if !USE(CURL)
arobenfee2e822007-06-12 21:50:34 +000049#ifndef _WINSOCKAPI_
50#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
51#endif
bfulgham@webkit.org147773f2009-06-12 21:36:08 +000052#endif
bdashdb309122006-11-20 12:59:36 +000053
mjs@apple.comacbcc282010-01-05 08:58:28 +000054#endif /* OS(WINDOWS) */
weinigf18aae32006-08-03 21:55:57 +000055
achristensen@apple.com92a456f2014-08-08 18:13:54 +000056// Using CMake with Unix makefiles does not use prefix headers.
57#if PLATFORM(MAC) && defined(BUILDING_WITH_CMAKE)
58#include "WebCorePrefix.h"
59#endif
60
darin707988e2006-01-16 01:29:54 +000061#ifdef __cplusplus
62
63// These undefs match up with defines in WebCorePrefix.h for Mac OS X.
64// Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h".
65#undef new
66#undef delete
mjsbb863512006-05-09 09:27:55 +000067#include <wtf/FastMalloc.h>
darin707988e2006-01-16 01:29:54 +000068
weinig@apple.com07737d72012-02-19 01:08:39 +000069#include <ciso646>
70
darin707988e2006-01-16 01:29:54 +000071#endif
eseidel864b4dd2006-02-24 01:11:00 +000072
darineb0d86d2007-10-16 20:13:24 +000073#include <wtf/DisallowCType.h>
74
mrowe@apple.comfbe724c2008-09-03 23:46:54 +000075#if COMPILER(MSVC)
76#define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
laszlo.1.gombos@nokia.comae659222011-11-13 04:37:43 +000077#else
mrowe@apple.comfbe724c2008-09-03 23:46:54 +000078#define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
eseidel864b4dd2006-02-24 01:11:00 +000079#endif
anderscacd71fdd2006-09-14 01:56:44 +000080
arobenfee2e822007-06-12 21:50:34 +000081#if PLATFORM(WIN)
bfulgham@webkit.org5fcb8a12011-07-13 19:31:52 +000082#if PLATFORM(WIN_CAIRO)
mrobinson@webkit.org2c91b422015-05-01 23:38:18 +000083#undef USE_CG
mrobinson@webkit.org2c91b422015-05-01 23:38:18 +000084#define USE_CURL 1
bfulgham@webkit.org5742b26b2009-07-13 18:34:44 +000085#ifndef _WINSOCKAPI_
86#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
87#endif
bfulgham@apple.comb18f31c32016-10-05 21:16:27 +000088#elif USE(DIRECT2D)
bfulgham@apple.com6f6bf7a2016-10-06 18:01:32 +000089#undef USE_CA
bfulgham@apple.comb18f31c32016-10-05 21:16:27 +000090#undef USE_CG
paroga@webkit.org55e36592013-06-14 22:49:14 +000091#elif !USE(WINGDI)
mrobinson@webkit.org2c91b422015-05-01 23:38:18 +000092#define USE_CG 1
93#undef USE_CAIRO
94#undef USE_CURL
bfulgham@webkit.org5742b26b2009-07-13 18:34:44 +000095#endif
anderscacd71fdd2006-09-14 01:56:44 +000096#endif
bdash880df152006-11-11 02:55:57 +000097
zandobersek@gmail.com75ce5872017-05-09 11:07:57 +000098#if PLATFORM(MAC) || PLATFORM(WPE)
mrobinson@webkit.org2c91b422015-05-01 23:38:18 +000099#define USE_NEW_THEME 1
darin@apple.com7e45de82014-01-13 02:42:54 +0000100#endif
mitz@apple.comc0b050b2008-09-06 22:39:34 +0000101
paroga@webkit.orgf226d9f2011-04-17 10:04:48 +0000102#if USE(CG)
arobenfee2e822007-06-12 21:50:34 +0000103#ifndef CGFLOAT_DEFINED
bfulgham@apple.com92787c72014-01-23 18:14:00 +0000104#if (defined(__LP64__) && __LP64__) || (defined(__x86_64__) && __x86_64__) || defined(_M_X64) || defined(__amd64__)
arobenfee2e822007-06-12 21:50:34 +0000105typedef double CGFloat;
106#else
107typedef float CGFloat;
108#endif
109#define CGFLOAT_DEFINED 1
110#endif
paroga@webkit.orgf226d9f2011-04-17 10:04:48 +0000111#endif /* USE(CG) */
aroben808a0022007-06-27 04:07:35 +0000112
mrobinson@webkit.org2c91b422015-05-01 23:38:18 +0000113// FIXME: Move this to JavaScriptCore/wtf/Platform.h, which is where we define USE_AVFOUNDATION on the Mac.
jeffm@apple.com83bc8482011-08-31 23:55:01 +0000114// https://bugs.webkit.org/show_bug.cgi?id=67334
bfulgham@apple.comda8c93c2013-07-12 19:30:23 +0000115#if PLATFORM(WIN) && USE(CG) && HAVE(AVCF)
mrobinson@webkit.org2c91b422015-05-01 23:38:18 +0000116#define USE_AVFOUNDATION 1
bfulgham@apple.com31e96402013-07-05 22:17:27 +0000117
118#if HAVE(AVCF_LEGIBLE_OUTPUT)
mrobinson@webkit.org2c91b422015-05-01 23:38:18 +0000119#define USE_AVFOUNDATION 1
bfulgham@apple.com31e96402013-07-05 22:17:27 +0000120#define HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP 1
121#define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1
bfulgham@apple.com83139452013-07-18 20:30:23 +0000122#define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1
bfulgham@apple.com31e96402013-07-05 22:17:27 +0000123#endif
124
jeffm@apple.com16e86442011-08-03 20:15:53 +0000125#endif