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(HAVE_CONFIG_H) && HAVE_CONFIG_H && defined(BUILDING_WITH_CMAKE)
28#include "cmakeconfig.h"
29#endif
30
31#include <wtf/Platform.h>
32
33#include <runtime/JSExportMacros.h>
34#include <wtf/DisallowCType.h>
35#include <wtf/ExportMacros.h>
36
37#ifdef __cplusplus
38#ifndef EXTERN_C_BEGIN
39#define EXTERN_C_BEGIN extern "C" {
40#endif
41#ifndef EXTERN_C_END
42#define EXTERN_C_END }
43#endif
44#else
45#define EXTERN_C_BEGIN
46#define EXTERN_C_END
47#endif
48
49#ifdef __cplusplus
50
51// These undefs match up with defines in WebKit2Prefix.h for Mac OS X.
52// Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h".
53#undef new
54#undef delete
55#include <wtf/FastMalloc.h>
56
57#endif
58
59#ifndef PLUGIN_ARCHITECTURE_UNSUPPORTED
60#if PLATFORM(MAC)
61#define PLUGIN_ARCHITECTURE_MAC 1
62#elif (PLATFORM(GTK) || PLATFORM(EFL)) && (OS(UNIX) && !OS(MAC_OS_X)) && PLATFORM(X11)
63#define PLUGIN_ARCHITECTURE_X11 1
64#else
65#define PLUGIN_ARCHITECTURE_UNSUPPORTED 1
66#endif
67#endif
68
69#define PLUGIN_ARCHITECTURE(ARCH) (defined PLUGIN_ARCHITECTURE_##ARCH && PLUGIN_ARCHITECTURE_##ARCH)
70
71#ifndef ENABLE_INSPECTOR_SERVER
72#if ENABLE(INSPECTOR) && ENABLE(WEB_SOCKETS) && (PLATFORM(GTK) || PLATFORM(EFL))
73#define ENABLE_INSPECTOR_SERVER 1
74#endif
75#endif
76
77#ifndef ENABLE_SEC_ITEM_SHIM
78#if PLATFORM(MAC) || PLATFORM(IOS)
79#define ENABLE_SEC_ITEM_SHIM 1
80#endif
81#endif
82
83#ifndef HAVE_WINDOW_SERVER_OCCLUSION_NOTIFICATIONS
84#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
85#define HAVE_WINDOW_SERVER_OCCLUSION_NOTIFICATIONS 1
86#endif
87#endif
88
89#ifndef HAVE_VOUCHERS
90#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000)
91#define HAVE_VOUCHERS 1
92#endif
93#endif
94
95#ifndef HAVE_SEC_ACCESS_CONTROL
96#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000)
97#define HAVE_SEC_ACCESS_CONTROL 1
98#endif
99#endif
100