[WK2] Fix for Display error occur in Help Center of FaceBook page
[framework/web/webkit-efl.git] / Source / WebCore / WebCorePrefix.h
1 /*
2  * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  *
19  */
20
21 /* This prefix file should contain only: 
22  *    1) files to precompile for faster builds
23  *    2) in one case at least: OS-X-specific performance bug workarounds
24  *    3) the special trick to catch us using new or delete without including "config.h"
25  * The project should be able to build without this header, although we rarely test that.
26  */
27
28 /* Things that need to be defined globally should go into "config.h". */
29
30 #if defined(__APPLE__)
31 #ifdef __cplusplus
32 #define NULL __null
33 #else
34 #define NULL ((void *)0)
35 #endif
36 #endif
37
38 #if defined(WIN32) || defined(_WIN32)
39
40 #ifndef _WIN32_WINNT
41 #define _WIN32_WINNT 0x0500
42 #endif
43
44 #ifndef WINVER
45 #define WINVER 0x0500
46 #endif
47
48 #ifndef WTF_USE_CURL
49 #ifndef _WINSOCKAPI_
50 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
51 #endif
52 #endif
53
54 // If we don't define these, they get defined in windef.h. 
55 // We want to use std::min and std::max
56 #ifdef __cplusplus
57 #define max max
58 #define min min
59 #endif
60
61 #else
62
63 #include <pthread.h>
64
65 #endif // defined(WIN32) || defined(_WIN32)
66
67 #include <sys/types.h>
68 #include <fcntl.h>
69 #if defined(__APPLE__)
70 #include <regex.h>
71 #endif
72
73 // On Linux this causes conflicts with libpng because there are two impls. of
74 // longjmp - see here: https://bugs.launchpad.net/ubuntu/+source/libpng/+bug/218409
75 #ifndef BUILDING_WX__
76 #include <setjmp.h>
77 #endif
78
79 #include <signal.h>
80 #include <stdarg.h>
81 #include <stddef.h>
82 #include <stdio.h>
83 #include <stdlib.h>
84 #include <string.h>
85 #include <time.h>
86 #if defined(__APPLE__)
87 #include <unistd.h>
88 #endif
89
90 #ifdef __cplusplus
91
92
93 #include <ciso646>
94
95 #if defined(_LIBCPP_VERSION)
96
97 // Add work around for a bug in libc++ that caused standard heap
98 // APIs to not compile <rdar://problem/10858112>.
99
100 #include <type_traits>
101
102 namespace WebCore {
103     class TimerHeapReference;
104 }
105
106 _LIBCPP_BEGIN_NAMESPACE_STD
107
108 inline _LIBCPP_INLINE_VISIBILITY
109 const WebCore::TimerHeapReference& move(const WebCore::TimerHeapReference& t)
110 {
111     return t;
112 }
113
114 _LIBCPP_END_NAMESPACE_STD
115
116 #endif // defined(_LIBCPP_VERSION)
117
118 #include <algorithm>
119 #include <cstddef>
120 #include <new>
121
122 #endif
123
124 #if defined(__APPLE__)
125 #include <sys/param.h>
126 #endif
127 #include <sys/stat.h>
128 #if defined(__APPLE__)
129 #include <sys/time.h>
130 #include <sys/resource.h>
131 #endif
132
133 #if !defined(BUILDING_WX__)
134 #include <CoreFoundation/CoreFoundation.h>
135 #ifdef WTF_PLATFORM_WIN_CAIRO
136 #include <ConditionalMacros.h>
137 #include <windows.h>
138 #else
139
140 #if defined(WIN32) || defined(_WIN32)
141 // FIXME <rdar://problem/8208868> Remove support for obsolete ColorSync API, CoreServices header in CoreGraphics
142 // We can remove this once the new ColorSync APIs are available in an internal Safari SDK.
143 #include <ColorSync/ColorSync.h>
144 #ifdef __COLORSYNCDEPRECATED__
145 #define COREGRAPHICS_INCLUDES_CORESERVICES_HEADER
146 #define OBSOLETE_COLORSYNC_API
147 #endif
148 /* Windows doesn't include CFNetwork.h via CoreServices.h, so we do
149    it explicitly here to make Windows more consistent with Mac. */
150 #include <CFNetwork/CFNetwork.h>
151 #include <windows.h>
152 #else
153 #include <CoreServices/CoreServices.h>
154 #endif
155
156 #endif
157 #endif // !defined(BUILDING_WX__)
158
159 #ifdef __OBJC__
160 #import <Cocoa/Cocoa.h>
161 #endif
162
163 #ifdef __cplusplus
164 #define new ("if you use new/delete make sure to include config.h at the top of the file"()) 
165 #define delete ("if you use new/delete make sure to include config.h at the top of the file"()) 
166 #endif
167
168 /* When C++ exceptions are disabled, the C++ library defines |try| and |catch|
169  * to allow C++ code that expects exceptions to build. These definitions
170  * interfere with Objective-C++ uses of Objective-C exception handlers, which
171  * use |@try| and |@catch|. As a workaround, undefine these macros. */
172 #ifdef __OBJC__
173 #undef try
174 #undef catch
175 #endif
176