1/* 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' 15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS 18 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 24 * THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#if defined(BUILDING_WITH_CMAKE) 28#include "cmakeconfig.h" 29#elif defined(BUILDING_GTK__) 30#include "autotoolsconfig.h" 31#endif 32 33#include <runtime/JSExportMacros.h> 34#include <wtf/DisallowCType.h> 35#include <wtf/Platform.h> 36#include <wtf/ExportMacros.h> 37 38#ifdef __cplusplus 39#ifndef EXTERN_C_BEGIN 40#define EXTERN_C_BEGIN extern "C" { 41#endif 42#ifndef EXTERN_C_END 43#define EXTERN_C_END } 44#endif 45#else 46#define EXTERN_C_BEGIN 47#define EXTERN_C_END 48#endif 49 50// For defining getters to a static value, where the getters have internal linkage 51#define DEFINE_STATIC_GETTER(type, name, arguments) \ 52static const type& name() \ 53{ \ 54 DEFINE_STATIC_LOCAL(type, name##Value, arguments); \ 55 return name##Value; \ 56} 57 58#if defined(WIN32) || defined(_WIN32) 59 60#ifndef _WIN32_WINNT 61#define _WIN32_WINNT 0x0502 62#endif 63 64#ifndef WINVER 65#define WINVER 0x0502 66#endif 67 68#ifndef _WINSOCKAPI_ 69#define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */ 70#endif 71 72#if !PLATFORM(QT) 73#include <WebCore/config.h> 74#endif 75#include <windows.h> 76 77#if USE(CG) 78#include <CoreGraphics/CoreGraphics.h> 79#endif 80 81#endif /* defined(WIN32) || defined(_WIN32) */ 82 83#ifdef __cplusplus 84 85// These undefs match up with defines in WebKit2Prefix.h for Mac OS X. 86// Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h". 87#undef new 88#undef delete 89#include <wtf/FastMalloc.h> 90 91#endif 92 93#ifndef PLUGIN_ARCHITECTURE_UNSUPPORTED 94#if PLATFORM(MAC) 95#define PLUGIN_ARCHITECTURE_MAC 1 96#elif (PLATFORM(GTK) || PLATFORM(EFL)) && (OS(UNIX) && !OS(MAC_OS_X)) 97#define PLUGIN_ARCHITECTURE_X11 1 98#elif PLATFORM(QT) 99// Qt handles this features.prf 100#else 101#define PLUGIN_ARCHITECTURE_UNSUPPORTED 1 102#endif 103#endif 104 105#define PLUGIN_ARCHITECTURE(ARCH) (defined PLUGIN_ARCHITECTURE_##ARCH && PLUGIN_ARCHITECTURE_##ARCH) 106 107#ifndef ENABLE_INSPECTOR_SERVER 108#if ENABLE(INSPECTOR) && (PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)) 109#define ENABLE_INSPECTOR_SERVER 1 110#endif 111#endif 112