Home | History | Annotate | Download | only in WebKit2
      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_GTK__)
     28 #include "autotoolsconfig.h"
     29 #endif /* defined (BUILDING_GTK__) */
     30 
     31 #include <wtf/DisallowCType.h>
     32 #include <wtf/Platform.h>
     33 
     34 #ifdef __cplusplus
     35 #ifndef EXTERN_C_BEGIN
     36 #define EXTERN_C_BEGIN extern "C" {
     37 #endif
     38 #ifndef EXTERN_C_END
     39 #define EXTERN_C_END }
     40 #endif
     41 #else
     42 #define EXTERN_C_BEGIN
     43 #define EXTERN_C_END
     44 #endif
     45 
     46 // For defining getters to a static value, where the getters have internal linkage
     47 #define DEFINE_STATIC_GETTER(type, name, arguments) \
     48 static const type& name() \
     49 { \
     50     DEFINE_STATIC_LOCAL(type, name##Value, arguments); \
     51     return name##Value; \
     52 }
     53 
     54 #if defined(BUILDING_QT__) || defined(BUILDING_GTK__)
     55 
     56 #define WTF_USE_JSC 1
     57 #define WTF_USE_V8 0
     58 
     59 #define JS_EXPORTDATA
     60 #define JS_EXPORTCLASS
     61 #define WTF_EXPORT_PRIVATE
     62 #define JS_EXPORT_PRIVATE
     63 
     64 #elif defined(__APPLE__)
     65 
     66 #ifdef __OBJC__
     67 #define OBJC_CLASS @class
     68 #else
     69 #define OBJC_CLASS class
     70 #endif
     71 
     72 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     73 #define ENABLE_WEB_PROCESS_SANDBOX 1
     74 #endif
     75 
     76 #define ENABLE_PLUGIN_PROCESS 1
     77 
     78 #if PLATFORM(MAC)
     79 #define ENABLE_MEMORY_SAMPLER 1
     80 #endif
     81 
     82 #import <CoreGraphics/CoreGraphics.h>
     83 
     84 #ifdef __OBJC__
     85 #import <Cocoa/Cocoa.h>
     86 #endif
     87 
     88 /* WebKit has no way to pull settings from WebCore/config.h for now */
     89 /* so we assume WebKit is always being compiled on top of JavaScriptCore */
     90 #define WTF_USE_JSC 1
     91 #define WTF_USE_V8 0
     92 
     93 #define JS_EXPORTDATA
     94 #define JS_EXPORTCLASS
     95 #define WEBKIT_EXPORTDATA
     96 
     97 #define WTF_EXPORT_PRIVATE
     98 #define JS_EXPORT_PRIVATE
     99 
    100 #include <WebCore/EmptyProtocolDefinitions.h>
    101 
    102 #elif defined(WIN32) || defined(_WIN32)
    103 
    104 #ifndef _WIN32_WINNT
    105 #define _WIN32_WINNT 0x0500
    106 #endif
    107 
    108 #ifndef WINVER
    109 #define WINVER 0x0500
    110 #endif
    111 
    112 /* If we don't define these, they get defined in windef.h. */
    113 /* We want to use std::min and std::max. */
    114 #ifndef max
    115 #define max max
    116 #endif
    117 #ifndef min
    118 #define min min
    119 #endif
    120 
    121 #ifndef _WINSOCKAPI_
    122 #define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */
    123 #endif
    124 
    125 #include <WebCore/config.h>
    126 #include <windows.h>
    127 
    128 #if USE(CG)
    129 #include <CoreGraphics/CoreGraphics.h>
    130 #endif
    131 
    132 #endif /* defined(WIN32) || defined(_WIN32) */
    133 
    134 #ifdef __cplusplus
    135 
    136 // These undefs match up with defines in WebKit2Prefix.h for Mac OS X.
    137 // Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h".
    138 #undef new
    139 #undef delete
    140 #include <wtf/FastMalloc.h>
    141 
    142 #endif
    143 
    144 #if PLATFORM(MAC)
    145 #define PLUGIN_ARCHITECTURE_MAC 1
    146 #elif PLATFORM(WIN)
    147 #define PLUGIN_ARCHITECTURE_WIN 1
    148 #elif (PLATFORM(QT) || (PLATFORM(GTK))) && (OS(UNIX) && !OS(MAC_OS_X) && !OS(SYMBIAN))
    149 #define PLUGIN_ARCHITECTURE_X11 1
    150 #else
    151 #define PLUGIN_ARCHITECTURE_UNSUPPORTED 1
    152 #endif
    153 
    154 #define PLUGIN_ARCHITECTURE(ARCH) (defined PLUGIN_ARCHITECTURE_##ARCH && PLUGIN_ARCHITECTURE_##ARCH)
    155