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 WTF_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 0x0502 49#endif 50 51#ifndef WINVER 52#define WINVER 0x0502 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#ifdef __cplusplus 65 66// These undefs match up with defines in WebCorePrefix.h for Mac OS X. 67// Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h". 68#undef new 69#undef delete 70#include <wtf/FastMalloc.h> 71 72#include <ciso646> 73 74#endif 75 76#include <wtf/DisallowCType.h> 77 78#if COMPILER(MSVC) 79#define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1 80#else 81#define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1 82#endif 83 84#if PLATFORM(WIN) 85#if PLATFORM(WIN_CAIRO) 86#undef WTF_USE_CG 87#define WTF_USE_CAIRO 1 88#define WTF_USE_CURL 1 89#ifndef _WINSOCKAPI_ 90#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h 91#endif 92#elif !USE(WINGDI) 93#define WTF_USE_CG 1 94#undef WTF_USE_CAIRO 95#undef WTF_USE_CURL 96#endif 97#endif 98 99#if PLATFORM(MAC) 100#define WTF_USE_NEW_THEME 1 101#endif 102 103#if USE(CG) 104#ifndef CGFLOAT_DEFINED 105#if (defined(__LP64__) && __LP64__) || (defined(__x86_64__) && __x86_64__) || defined(_M_X64) || defined(__amd64__) 106typedef double CGFloat; 107#else 108typedef float CGFloat; 109#endif 110#define CGFLOAT_DEFINED 1 111#endif 112#endif /* USE(CG) */ 113 114#if PLATFORM(WIN) && USE(CG) 115#define WTF_USE_SAFARI_THEME 1 116#endif 117 118#if PLATFORM(IOS) 119#define WEBCORE_NAVIGATOR_PLATFORM wkGetPlatformNameForNavigator(); 120#define WEBCORE_NAVIGATOR_VENDOR wkGetVendorNameForNavigator(); 121#endif 122 123// FIXME: Move this to JavaScriptCore/wtf/Platform.h, which is where we define WTF_USE_AVFOUNDATION on the Mac. 124// https://bugs.webkit.org/show_bug.cgi?id=67334 125#if PLATFORM(WIN) && USE(CG) && HAVE(AVCF) 126#define WTF_USE_AVFOUNDATION 1 127 128#if HAVE(AVCF_LEGIBLE_OUTPUT) 129#define WTF_USE_AVFOUNDATION 1 130#define HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP 1 131#define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1 132#define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1 133#endif 134 135#endif 136 137