1/*
2 * Copyright (C) 2004, 2005, 2006, 2013, 2014 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Google Inc. All rights reserved.
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
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 *
20 */
21
22#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H && defined(BUILDING_WITH_CMAKE)
23#include "cmakeconfig.h"
24#endif
25
26#include <wtf/Platform.h>
27
28#if PLATFORM(COCOA)
29#define USE_FILE_LOCK 1
30#endif
31
32#if PLATFORM(WIN) && !USE(WINGDI)
33#include <WebCore/WebCoreHeaderDetection.h>
34#endif
35
36#include <wtf/ExportMacros.h>
37#include "PlatformExportMacros.h"
38
39#include <runtime/JSExportMacros.h>
40
41#ifdef __APPLE__
42#define HAVE_FUNC_USLEEP 1
43#endif /* __APPLE__ */
44
45#if OS(WINDOWS)
46
47#ifndef _WIN32_WINNT
48#define _WIN32_WINNT 0x601
49#endif
50
51#ifndef WINVER
52#define WINVER 0x0601
53#endif
54
55// CURL needs winsock, so don't prevent inclusion of it
56#if !USE(CURL)
57#ifndef _WINSOCKAPI_
58#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
59#endif
60#endif
61
62#endif /* OS(WINDOWS) */
63
64// Using CMake with Unix makefiles does not use prefix headers.
65#if PLATFORM(MAC) && defined(BUILDING_WITH_CMAKE)
66#include "WebCorePrefix.h"
67#endif
68
69#ifdef __cplusplus
70
71// These undefs match up with defines in WebCorePrefix.h for Mac OS X.
72// Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h".
73#undef new
74#undef delete
75#include <wtf/FastMalloc.h>
76
77#include <ciso646>
78
79#endif
80
81#include <wtf/DisallowCType.h>
82
83#if COMPILER(MSVC)
84#define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
85#else
86#define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
87#endif
88
89#if PLATFORM(WIN)
90#if PLATFORM(WIN_CAIRO)
91#undef USE_CG
92#define USE_CAIRO 1
93#define USE_CURL 1
94#ifndef _WINSOCKAPI_
95#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
96#endif
97#elif !USE(WINGDI)
98#define USE_CG 1
99#undef USE_CAIRO
100#undef USE_CURL
101#endif
102#endif
103
104#if PLATFORM(MAC)
105#define USE_NEW_THEME 1
106#endif
107
108#if USE(CG)
109#ifndef CGFLOAT_DEFINED
110#if (defined(__LP64__) && __LP64__) || (defined(__x86_64__) && __x86_64__) || defined(_M_X64) || defined(__amd64__)
111typedef double CGFloat;
112#else
113typedef float CGFloat;
114#endif
115#define CGFLOAT_DEFINED 1
116#endif
117#endif /* USE(CG) */
118
119// FIXME: Move this to JavaScriptCore/wtf/Platform.h, which is where we define USE_AVFOUNDATION on the Mac.
120// https://bugs.webkit.org/show_bug.cgi?id=67334
121#if PLATFORM(WIN) && USE(CG) && HAVE(AVCF)
122#define USE_AVFOUNDATION 1
123
124#if HAVE(AVCF_LEGIBLE_OUTPUT)
125#define USE_AVFOUNDATION 1
126#define HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP 1
127#define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1
128#define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1
129#endif
130
131#endif
132
133