1/* 2 * Copyright (C) 2004, 2005, 2006, 2013 Apple Inc. 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 23#ifdef BUILDING_WITH_CMAKE 24#include "cmakeconfig.h" 25#else 26#include "autotoolsconfig.h" 27#endif 28#endif 29 30#include <wtf/Platform.h> 31 32#if PLATFORM(MAC) || PLATFORM(IOS) 33#define WTF_USE_FILE_LOCK 1 34#endif 35 36#if PLATFORM(WIN) && !USE(WINGDI) 37#include <WebCore/WebCoreHeaderDetection.h> 38#endif 39 40#include <wtf/ExportMacros.h> 41#include "PlatformExportMacros.h" 42 43#include <runtime/JSExportMacros.h> 44 45#ifdef __APPLE__ 46#define HAVE_FUNC_USLEEP 1 47#endif /* __APPLE__ */ 48 49#if OS(WINDOWS) 50 51#ifndef _WIN32_WINNT 52#define _WIN32_WINNT 0x0502 53#endif 54 55#ifndef WINVER 56#define WINVER 0x0502 57#endif 58 59// CURL needs winsock, so don't prevent inclusion of it 60#if !USE(CURL) 61#ifndef _WINSOCKAPI_ 62#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h 63#endif 64#endif 65 66#endif /* OS(WINDOWS) */ 67 68#ifdef __cplusplus 69 70// These undefs match up with defines in WebCorePrefix.h for Mac OS X. 71// Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h". 72#undef new 73#undef delete 74#include <wtf/FastMalloc.h> 75 76#include <ciso646> 77 78#endif 79 80#include <wtf/DisallowCType.h> 81 82#if COMPILER(MSVC) 83#define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1 84#else 85#define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1 86#endif 87 88#if PLATFORM(WIN) 89#if PLATFORM(WIN_CAIRO) 90#undef WTF_USE_CG 91#define WTF_USE_CAIRO 1 92#define WTF_USE_CURL 1 93#ifndef _WINSOCKAPI_ 94#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h 95#endif 96#elif !USE(WINGDI) 97#define WTF_USE_CG 1 98#undef WTF_USE_CAIRO 99#undef WTF_USE_CURL 100#endif 101#endif 102 103#if PLATFORM(MAC) 104// New theme 105#define WTF_USE_NEW_THEME 1 106#endif // PLATFORM(MAC) 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#if PLATFORM(WIN) && USE(CG) 120#define WTF_USE_SAFARI_THEME 1 121#endif 122 123// CoreAnimation is available to IOS, Mac and Windows if using CG 124#if PLATFORM(MAC) || PLATFORM(IOS) || (PLATFORM(WIN) && USE(CG)) 125#define WTF_USE_CA 1 126#endif 127 128// FIXME: Move this to JavaScriptCore/wtf/Platform.h, which is where we define WTF_USE_AVFOUNDATION on the Mac. 129// https://bugs.webkit.org/show_bug.cgi?id=67334 130#if PLATFORM(WIN) 131#define WTF_USE_AVFOUNDATION 1 132 133#if HAVE(AVCF_LEGIBLE_OUTPUT) 134#define WTF_USE_AVFOUNDATION 1 135#define HAVE_AVFOUNDATION_MEDIA_SELECTION_GROUP 1 136#define HAVE_AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT 1 137#define HAVE_MEDIA_ACCESSIBILITY_FRAMEWORK 1 138#endif 139 140#endif 141 142