2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / WebCore / WebCorePrefix.h
blob948fe39a9d69d49c0a6626dacce6e892b392f81b
1 /*
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 is for use on Mac OS X and Windows only. It should contain only:
22 * 1) files to precompile on Mac OS X and Windows 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__)
31 #ifdef __cplusplus
32 #define NULL __null
33 #else
34 #define NULL ((void *)0)
35 #endif
36 #endif
38 #if defined(WIN32) || defined(_WIN32)
40 #ifndef _WIN32_WINNT
41 #define _WIN32_WINNT 0x0500
42 #endif
44 #ifndef WINVER
45 #define WINVER 0x0500
46 #endif
48 #ifndef _WINSOCKAPI_
49 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
50 #endif
52 // If we don't define these, they get defined in windef.h.
53 // We want to use std::min and std::max
54 #ifdef __cplusplus
55 #define max max
56 #define min min
57 #endif
59 #else
60 #include <pthread.h>
61 #endif // defined(WIN32) || defined(_WIN32)
63 #include <sys/types.h>
64 #include <fcntl.h>
65 #if defined(__APPLE__)
66 #include <regex.h>
67 #endif
68 #include <setjmp.h>
69 #include <signal.h>
70 #include <stdarg.h>
71 #include <stddef.h>
72 #include <stdio.h>
73 #include <stdlib.h>
74 #include <string.h>
75 #include <time.h>
76 #if defined(__APPLE__)
77 #include <unistd.h>
78 #endif
80 #ifdef __cplusplus
82 #include <algorithm>
83 #include <cstddef>
84 #include <new>
86 #endif
88 #include <sys/types.h>
89 #if defined(__APPLE__)
90 #include <sys/param.h>
91 #endif
92 #include <sys/stat.h>
93 #if defined(__APPLE__)
94 #include <sys/time.h>
95 #include <sys/resource.h>
96 #endif
98 #include <time.h>
100 #include <CoreFoundation/CoreFoundation.h>
101 #include <CoreServices/CoreServices.h>
103 #include <AvailabilityMacros.h>
105 #if defined(__APPLE__)
106 #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
107 #define BUILDING_ON_TIGER 1
108 #elif MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_5
109 #define BUILDING_ON_LEOPARD 1
110 #endif
111 #endif
113 #ifdef __OBJC__
114 #import <Cocoa/Cocoa.h>
115 #endif
117 #ifdef __cplusplus
118 #define new ("if you use new/delete make sure to include config.h at the top of the file"())
119 #define delete ("if you use new/delete make sure to include config.h at the top of the file"())
120 #endif
122 /* Work around bug with C++ library that screws up Objective-C++ when exception support is disabled. */
123 #if defined(__APPLE__)
124 #undef try
125 #undef catch
126 #endif