1 // -*- mode: c++; c-basic-offset: 4 -*-
3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 #ifndef KXMLCORE_PLATFORM_H
28 #define KXMLCORE_PLATFORM_H
30 // PLATFORM handles OS, operating environment, graphics API, and CPU
31 #define PLATFORM(KX_FEATURE) (defined( KXMLCORE_PLATFORM_##KX_FEATURE ) && KXMLCORE_PLATFORM_##KX_FEATURE)
32 #define COMPILER(KX_FEATURE) (defined( KXMLCORE_COMPILER_##KX_FEATURE ) && KXMLCORE_COMPILER_##KX_FEATURE)
33 #define HAVE(KX_FEATURE) (defined( HAVE_##KX_FEATURE ) && HAVE_##KX_FEATURE)
34 #define USE(KX_FEATURE) (defined( KXMLCORE_USE_##KX_FEATURE ) && KXMLCORE_USE_##KX_FEATURE)
36 // Operating systems - low-level dependencies
39 // Operating system level dependencies for Mac OS X / Darwin that should
40 // be used regardless of operating environment
42 #define KXMLCORE_PLATFORM_DARWIN 1
46 // Operating system level dependencies for Windows that should be used
47 // regardless of operating environment
48 #if defined(WIN32) || defined(_WIN32)
49 #define KXMLCORE_PLATFORM_WIN_OS 1
53 // Operating system level dependencies for Unix-like systems that
54 // should be used regardless of operating environment
55 // (includes PLATFORM(DARWIN))
56 #if defined(__APPLE__) \
59 || defined(__unix__) \
60 || defined (__NetBSD__) \
62 #define KXMLCORE_PLATFORM_UNIX 1
65 // Operating environments
67 // I made the BUILDING_KDE__ macro up for the KDE build system to define
72 #if defined(BUILDING_KDE__)
73 #define KXMLCORE_PLATFORM_KDE 1
74 #elif PLATFORM(DARWIN)
75 #define KXMLCORE_PLATFORM_MAC 1
76 #elif PLATFORM(WIN_OS)
77 #define KXMLCORE_PLATFORM_WIN 1
83 #if defined(__ppc__) \
85 || defined(__powerpc__) \
86 || defined(__powerpc) \
87 || defined(__POWERPC__) \
90 #define KXMLCORE_PLATFORM_PPC 1
91 #define KXMLCORE_PLATFORM_BIG_ENDIAN 1
95 #if defined(__ppc64__) \
97 #define KXMLCORE_PLATFORM_PPC64 1
98 #define KXMLCORE_PLATFORM_BIG_ENDIAN 1
102 #define KXMLCORE_PLATFORM_ARM 1
103 #define KXMLCORE_PLATFORM_MIDDLE_ENDIAN 1
107 #if defined(__i386__) \
109 || defined(_M_IX86) \
111 || defined(__THW_INTEL)
112 #define KXMLCORE_PLATFORM_X86 1
116 #if defined(__x86_64__) \
118 #define KXMLCORE_PLATFORM_X86_64 1
124 #if defined(_MSC_VER)
125 #define KXMLCORE_COMPILER_MSVC 1
129 #if defined(__GNUC__)
130 #define KXMLCORE_COMPILER_GCC 1
134 // not really fully supported - is this relevant any more?
135 #if defined(__BORLANDC__)
136 #define KXMLCORE_COMPILER_BORLAND 1
140 // not really fully supported - is this relevant any more?
141 #if defined(__CYGWIN__)
142 #define KXMLCORE_COMPILER_CYGWIN 1
145 // multiple threads only supported on Mac for now
147 #define KXMLCORE_USE_MULTIPLE_THREADS 1
150 // for Unicode, KDE uses Qt, everything else uses ICU
152 #define KXMLCORE_USE_QT4_UNICODE 1
154 #define KXMLCORE_USE_ICU_UNICODE 1
157 #endif // KXMLCORE_PLATFORM_H