Initialize Tizen 2.3
[framework/web/webkit-efl.git] / Source / WebCore / WebCorePrefix.h
1 /*
2  * Copyright (C) 2004, 2005, 2006, 2007, 2013 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 #include <wtf/Platform.h>
31
32 #if defined(__APPLE__)
33 #ifdef __cplusplus
34 #define NULL __null
35 #else
36 #define NULL ((void *)0)
37 #endif
38 #endif
39
40 #if OS(WINDOWS)
41
42 #ifndef _WIN32_WINNT
43 #define _WIN32_WINNT 0x0502
44 #endif
45
46 #ifndef WINVER
47 #define WINVER 0x0502
48 #endif
49
50 #if !USE(CURL)
51 #ifndef _WINSOCKAPI_
52 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
53 #endif
54 #endif
55
56 // If we don't define these, they get defined in windef.h. 
57 // We want to use std::min and std::max
58 #ifdef __cplusplus
59 #define max max
60 #define min min
61 #endif
62
63 #else
64
65 #include <pthread.h>
66
67 #endif // OS(WINDOWS)
68
69 #include <sys/types.h>
70 #include <fcntl.h>
71 #if defined(__APPLE__)
72 #include <regex.h>
73 #endif
74
75 #include <setjmp.h>
76
77 #include <signal.h>
78 #include <stdarg.h>
79 #include <stddef.h>
80 #include <stdio.h>
81 #include <stdlib.h>
82 #include <string.h>
83 #include <time.h>
84 #if defined(__APPLE__)
85 #include <unistd.h>
86 #endif
87
88 #ifdef __cplusplus
89
90
91 #include <ciso646>
92
93 #if defined(_LIBCPP_VERSION)
94
95 // Add work around for a bug in libc++ that caused standard heap
96 // APIs to not compile <rdar://problem/10858112>.
97
98 #include <type_traits>
99
100 namespace WebCore {
101     class TimerHeapReference;
102 }
103
104 _LIBCPP_BEGIN_NAMESPACE_STD
105
106 inline _LIBCPP_INLINE_VISIBILITY
107 const WebCore::TimerHeapReference& move(const WebCore::TimerHeapReference& t)
108 {
109     return t;
110 }
111
112 _LIBCPP_END_NAMESPACE_STD
113
114 #endif // defined(_LIBCPP_VERSION)
115
116 #include <algorithm>
117 #include <cstddef>
118 #include <new>
119
120 #endif
121
122 #if defined(__APPLE__)
123 #include <sys/param.h>
124 #endif
125 #include <sys/stat.h>
126 #if defined(__APPLE__)
127 #include <sys/time.h>
128 #include <sys/resource.h>
129 #endif
130
131 #include <CoreFoundation/CoreFoundation.h>
132 #if PLATFORM(WIN_CAIRO)
133 #include <ConditionalMacros.h>
134 #include <windows.h>
135 #else
136
137 #if OS(WINDOWS)
138 #if USE(CG)
139
140 #if defined(_MSC_VER) && _MSC_VER <= 1600
141
142 #include <WebCore/WebCoreHeaderDetection.h>
143
144 #if HAVE(AVCF_LEGIBLE_OUTPUT)
145 // These must be defined before including CGFloat.h
146 // This can be removed once we move to VS2012 or newer
147 #include <wtf/ExportMacros.h>
148 #include <wtf/MathExtras.h>
149
150 #define isnan _isnan
151 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
152 #include <CoreGraphics/CGFloat.h>
153 #endif
154 #include <CoreGraphics/CoreGraphics.h>
155 #undef isnan
156 #endif
157 #endif
158
159 // FIXME <rdar://problem/8208868> Remove support for obsolete ColorSync API, CoreServices header in CoreGraphics
160 // We can remove this once the new ColorSync APIs are available in an internal Safari SDK.
161 #include <ColorSync/ColorSync.h>
162 #ifdef __COLORSYNCDEPRECATED__
163 #define COREGRAPHICS_INCLUDES_CORESERVICES_HEADER
164 #define OBSOLETE_COLORSYNC_API
165 #endif
166 #endif
167 #if USE(CFNETWORK)
168 /* Windows doesn't include CFNetwork.h via CoreServices.h, so we do
169    it explicitly here to make Windows more consistent with Mac. */
170 #include <CFNetwork/CFNetwork.h>
171 // On Windows, dispatch.h needs to be included before certain CFNetwork headers.
172 #include <dispatch/dispatch.h>
173 #endif
174 #include <windows.h>
175 #else
176 #if !PLATFORM(IOS)
177 #include <CoreServices/CoreServices.h>
178 #endif // !PLATFORM(IOS)
179 #endif // OS(WINDOWS)
180
181 #endif
182
183 #ifdef __OBJC__
184 #if PLATFORM(IOS)
185 #import <Foundation/Foundation.h>
186 #else
187 #import <Cocoa/Cocoa.h>
188 #endif // PLATFORM(IOS)
189 #endif
190
191 #ifdef __cplusplus
192 #define new ("if you use new/delete make sure to include config.h at the top of the file"()) 
193 #define delete ("if you use new/delete make sure to include config.h at the top of the file"()) 
194 #endif
195
196 /* When C++ exceptions are disabled, the C++ library defines |try| and |catch|
197  * to allow C++ code that expects exceptions to build. These definitions
198  * interfere with Objective-C++ uses of Objective-C exception handlers, which
199  * use |@try| and |@catch|. As a workaround, undefine these macros. */
200 #ifdef __OBJC__
201 #undef try
202 #undef catch
203 #endif
204