• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include <pthread.h>
63 #endif // defined(WIN32) || defined(_WIN32)
64 
65 #include <sys/types.h>
66 #include <fcntl.h>
67 #if defined(__APPLE__)
68 #include <regex.h>
69 #endif
70 
71 // On Linux this causes conflicts with libpng because there are two impls. of
72 // longjmp - see here: https://bugs.launchpad.net/ubuntu/+source/libpng/+bug/218409
73 #ifndef BUILDING_WX__
74 #include <setjmp.h>
75 #endif
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 #include <algorithm>
91 #include <cstddef>
92 #include <new>
93 
94 #endif
95 
96 #include <sys/types.h>
97 #if defined(__APPLE__)
98 #include <sys/param.h>
99 #endif
100 #include <sys/stat.h>
101 #if defined(__APPLE__)
102 #include <sys/time.h>
103 #include <sys/resource.h>
104 #endif
105 
106 #include <time.h>
107 
108 #ifndef BUILDING_WX__
109 #include <CoreFoundation/CoreFoundation.h>
110 #ifdef WIN_CAIRO
111 #include <ConditionalMacros.h>
112 #include <windows.h>
113 #include <stdio.h>
114 #else
115 #include <CoreServices/CoreServices.h>
116 #endif
117 #endif
118 
119 #ifdef __OBJC__
120 #import <Cocoa/Cocoa.h>
121 #endif
122 
123 #ifdef __cplusplus
124 #define new ("if you use new/delete make sure to include config.h at the top of the file"())
125 #define delete ("if you use new/delete make sure to include config.h at the top of the file"())
126 #endif
127 
128 /* Work around a bug with C++ library that screws up Objective-C++ when exception support is disabled. */
129 #if defined(__APPLE__)
130 #undef try
131 #undef catch
132 #endif
133