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 */
38 /* PLATFORM(DARWIN) */
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
45 /* PLATFORM(WIN_OS) */
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 */
70 #if defined(BUILDING_QT__)
71 #define KXMLCORE_PLATFORM_QT 1
72 #elif PLATFORM(DARWIN)
73 #define KXMLCORE_PLATFORM_MAC 1
74 #elif PLATFORM(WIN_OS)
75 #define KXMLCORE_PLATFORM_WIN 1
77 #if defined(BUILDING_GDK__)
78 #define KXMLCORE_PLATFORM_GDK 1
81 /* Graphics engines */
86 #define KXMLCORE_PLATFORM_CG 1
88 #define KXMLCORE_PLATFORM_CAIRO 1
94 #if defined(__ppc__) \
96 || defined(__powerpc__) \
97 || defined(__powerpc) \
98 || defined(__POWERPC__) \
101 #define KXMLCORE_PLATFORM_PPC 1
102 #define KXMLCORE_PLATFORM_BIG_ENDIAN 1
105 /* PLATFORM(PPC64) */
106 #if defined(__ppc64__) \
107 || defined(__PPC64__)
108 #define KXMLCORE_PLATFORM_PPC64 1
109 #define KXMLCORE_PLATFORM_BIG_ENDIAN 1
113 #define KXMLCORE_PLATFORM_ARM 1
114 #define KXMLCORE_PLATFORM_MIDDLE_ENDIAN 1
118 #if defined(__i386__) \
120 || defined(_M_IX86) \
122 || defined(__THW_INTEL)
123 #define KXMLCORE_PLATFORM_X86 1
126 /* PLATFORM(X86_64) */
127 #if defined(__x86_64__) \
129 #define KXMLCORE_PLATFORM_X86_64 1
135 #if defined(_MSC_VER)
136 #define KXMLCORE_COMPILER_MSVC 1
140 #if defined(__GNUC__)
141 #define KXMLCORE_COMPILER_GCC 1
144 /* COMPILER(BORLAND) */
145 /* not really fully supported - is this relevant any more? */
146 #if defined(__BORLANDC__)
147 #define KXMLCORE_COMPILER_BORLAND 1
150 /* COMPILER(CYGWIN) */
151 /* not really fully supported - is this relevant any more? */
152 #if defined(__CYGWIN__)
153 #define KXMLCORE_COMPILER_CYGWIN 1
156 /* multiple threads only supported on Mac for now */
158 #define KXMLCORE_USE_MULTIPLE_THREADS 1
161 /* for Unicode, KDE uses Qt, everything else uses ICU */
163 #define KXMLCORE_USE_QT4_UNICODE 1
165 #define KXMLCORE_USE_ICU_UNICODE 1
168 #endif /* KXMLCORE_PLATFORM_H */