[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.24
[framework/web/webkit-efl.git] / Source / WebCore / config.h
1 /*
2  * Copyright (C) 2004, 2005, 2006 Apple Inc.
3  * Copyright (C) 2009 Google Inc. All rights reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB.  If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  *
20  */ 
21
22 #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
23 #ifdef BUILDING_WITH_CMAKE
24 #include "cmakeconfig.h"
25 #else
26 #include "autotoolsconfig.h"
27 #endif
28 #endif
29
30 #include <wtf/Platform.h>
31
32 #if OS(WINDOWS) && !OS(WINCE) && !PLATFORM(QT) && !PLATFORM(CHROMIUM) && !PLATFORM(GTK) && !PLATFORM(WX)
33 #include <WebCore/WebCoreHeaderDetection.h>
34 #endif
35
36 #include <wtf/ExportMacros.h>
37 #include "PlatformExportMacros.h"
38
39 #if PLATFORM(QT) && USE(V8)
40 #include <JavaScriptCore/runtime/JSExportMacros.h>
41 #else
42 #include <runtime/JSExportMacros.h>
43 #endif
44
45 #ifdef __APPLE__
46 #define HAVE_FUNC_USLEEP 1
47 #endif /* __APPLE__ */
48
49 #if OS(WINDOWS)
50
51 #ifndef _WIN32_WINNT
52 #define _WIN32_WINNT 0x0500
53 #endif
54
55 #ifndef WINVER
56 #define WINVER 0x0500
57 #endif
58
59 // If we don't define these, they get defined in windef.h.
60 // We want to use std::min and std::max.
61 #ifndef max
62 #define max max
63 #endif
64 #ifndef min
65 #define min min
66 #endif
67
68 // CURL needs winsock, so don't prevent inclusion of it
69 #if !USE(CURL)
70 #ifndef _WINSOCKAPI_
71 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
72 #endif
73 #endif
74
75 #endif /* OS(WINDOWS) */
76
77 #ifdef __cplusplus
78
79 // These undefs match up with defines in WebCorePrefix.h for Mac OS X.
80 // Helps us catch if anyone uses new or delete by accident in code and doesn't include "config.h".
81 #undef new
82 #undef delete
83 #include <wtf/FastMalloc.h>
84
85 #include <ciso646>
86
87 #endif
88
89 // On MSW, wx headers need to be included before windows.h is.
90 // The only way we can always ensure this is if we include wx here.
91 #if PLATFORM(WX)
92 #include <wx/defs.h>
93 #endif
94
95 // this breaks compilation of <QFontDatabase>, at least, so turn it off for now
96 // Also generates errors on wx on Windows, presumably because these functions
97 // are used from wx headers. On GTK+ for Mac many GTK+ files include <libintl.h>
98 // or <glib/gi18n-lib.h>, which in turn include <xlocale/_ctype.h> which uses
99 // isacii(). 
100 #if !PLATFORM(QT) && !PLATFORM(WX) && !PLATFORM(CHROMIUM) && !(OS(DARWIN) && PLATFORM(GTK)) && !OS(QNX) && !defined(_LIBCPP_VERSION)
101 #include <wtf/DisallowCType.h>
102 #endif
103
104 #if COMPILER(MSVC)
105 #define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
106 #else
107 #define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
108 #endif
109
110 #if PLATFORM(WIN)
111 #if PLATFORM(WIN_CAIRO)
112 #undef WTF_USE_CG
113 #define WTF_USE_CAIRO 1
114 #define WTF_USE_CURL 1
115 #ifndef _WINSOCKAPI_
116 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
117 #endif
118 #elif !OS(WINCE)
119 #define WTF_USE_CG 1
120 #undef WTF_USE_CAIRO
121 #undef WTF_USE_CURL
122 #endif
123 #endif
124
125 #if PLATFORM(MAC)
126 // New theme
127 #define WTF_USE_NEW_THEME 1
128 #endif // PLATFORM(MAC)
129
130 #if PLATFORM(CHROMIUM)
131
132 // Chromium uses this file instead of JavaScriptCore/config.h to compile
133 // JavaScriptCore/wtf (chromium doesn't compile the rest of JSC). Therefore,
134 // this define is required.
135 #define WTF_CHANGES 1
136
137 #define WTF_USE_GOOGLEURL 1
138
139 #endif /* PLATFORM(CHROMIUM) */
140
141 #if USE(CG)
142 #ifndef CGFLOAT_DEFINED
143 #ifdef __LP64__
144 typedef double CGFloat;
145 #else
146 typedef float CGFloat;
147 #endif
148 #define CGFLOAT_DEFINED 1
149 #endif
150 #endif /* USE(CG) */
151
152 #if PLATFORM(WIN) && USE(CG)
153 #define WTF_USE_SAFARI_THEME 1
154 #endif
155
156 // CoreAnimation is available to IOS, Mac and Windows if using CG
157 #if PLATFORM(MAC) || PLATFORM(IOS) || (PLATFORM(WIN) && USE(CG))
158 #define WTF_USE_CA 1
159 #endif
160
161 #if PLATFORM(QT) && USE(V8) && defined(Q_WS_X11)
162 /* protect ourselves from evil X11 defines */
163 #include <bridge/npruntime_internal.h>
164 #endif
165
166 // FIXME: Move this to JavaScriptCore/wtf/Platform.h, which is where we define WTF_USE_AVFOUNDATION on the Mac.
167 // https://bugs.webkit.org/show_bug.cgi?id=67334
168 #if PLATFORM(WIN) && HAVE(AVCF)
169 #define WTF_USE_AVFOUNDATION 1
170 #endif
171