2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc.
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.
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.
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.
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.
28 /* Things that need to be defined globally should go into "config.h". */
30 #if defined(__APPLE__)
34 #define NULL ((void *)0)
38 #if defined(WIN32) || defined(_WIN32)
41 #define _WIN32_WINNT 0x0500
50 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
54 // If we don't define these, they get defined in windef.h.
55 // We want to use std::min and std::max
63 #endif // defined(WIN32) || defined(_WIN32)
67 // Must come before include of algorithm.
68 #define PREFIX_FOR_WEBCORE 1
69 #define EXPORT __attribute__((visibility("default")))
71 // Android uses a single set of include directories when building WebKit and
72 // JavaScriptCore. Since WebCore/ is included before JavaScriptCore/, Android
73 // includes JavaScriptCore/config.h explicitly here to make sure it gets picked
75 #include <JavaScriptCore/config.h>
78 #include <sys/types.h>
80 #if defined(__APPLE__)
84 // On Linux this causes conflicts with libpng because there are two impls. of
85 // longjmp - see here: https://bugs.launchpad.net/ubuntu/+source/libpng/+bug/218409
97 #if defined(__APPLE__)
109 #include <sys/types.h>
110 #if defined(__APPLE__)
111 #include <sys/param.h>
113 #include <sys/stat.h>
114 #if defined(__APPLE__)
115 #include <sys/time.h>
116 #include <sys/resource.h>
121 #if !defined(BUILDING_WX__) && !defined(ANDROID)
122 #include <CoreFoundation/CoreFoundation.h>
124 #include <ConditionalMacros.h>
128 #include <CoreServices/CoreServices.h>
130 #if defined(WIN32) || defined(_WIN32)
131 /* Including CoreServices.h on Windows doesn't include CFNetwork.h, so we do
132 it explicitly here to make Windows more consistent with Mac. */
133 #include <CFNetwork/CFNetwork.h>
137 #endif // !defined(BUILDING_WX__) && !defined(ANDROID)
140 #import <Cocoa/Cocoa.h>
144 #define new ("if you use new/delete make sure to include config.h at the top of the file"())
145 #define delete ("if you use new/delete make sure to include config.h at the top of the file"())
148 /* When C++ exceptions are disabled, the C++ library defines |try| and |catch|
149 * to allow C++ code that expects exceptions to build. These definitions
150 * interfere with Objective-C++ uses of Objective-C exception handlers, which
151 * use |@try| and |@catch|. As a workaround, undefine these macros. */