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__)
34 #define NULL ((void *)0)
38 #if defined(WIN32) || defined(_WIN32)
41 #define _WIN32_WINNT 0x0500
49 #define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
52 // If we don't define these, they get defined in windef.h.
53 // We want to use std::min and std::max
61 #endif // defined(WIN32) || defined(_WIN32)
63 #include <sys/types.h>
65 #if defined(__APPLE__)
76 #if defined(__APPLE__)
88 #include <sys/types.h>
89 #if defined(__APPLE__)
90 #include <sys/param.h>
93 #if defined(__APPLE__)
95 #include <sys/resource.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
114 #import <Cocoa/Cocoa.h>
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"())
122 /* Work around bug with C++ library that screws up Objective-C++ when exception support is disabled. */
123 #if defined(__APPLE__)