• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

WTF

  • kjs
  • wtf
Platform.h
Go to the documentation of this file.
1 /* -*- mode: c++; c-basic-offset: 4 -*- */
2 /*
3  * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
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.
13  *
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.
25  */
26 
27 #ifndef WTF_Platform_h
28 #define WTF_Platform_h
29 
30 /* Force KDE build here in our tree... */
31 #ifndef BUILDING_KDE__
32 #define BUILDING_KDE__ 1
33 #endif
34 
35 /* PLATFORM handles OS, operating environment, graphics API, and CPU */
36 #define PLATFORM(WTF_FEATURE) (defined( WTF_PLATFORM_##WTF_FEATURE ) && WTF_PLATFORM_##WTF_FEATURE)
37 #define COMPILER(WTF_FEATURE) (defined( WTF_COMPILER_##WTF_FEATURE ) && WTF_COMPILER_##WTF_FEATURE)
38 #define HAVE(WTF_FEATURE) (defined( HAVE_##WTF_FEATURE ) && HAVE_##WTF_FEATURE)
39 #define USE(WTF_FEATURE) (defined( WTF_USE_##WTF_FEATURE ) && WTF_USE_##WTF_FEATURE)
40 #define ENABLE(WTF_FEATURE) (defined( ENABLE_##WTF_FEATURE ) && ENABLE_##WTF_FEATURE)
41 
42 /* Operating systems - low-level dependencies */
43 
44 /* PLATFORM(DARWIN) */
45 /* Operating system level dependencies for Mac OS X / Darwin that should */
46 /* be used regardless of operating environment */
47 #ifdef __APPLE__
48 #define WTF_PLATFORM_DARWIN 1
49 #endif
50 
51 /* PLATFORM(WIN_OS) */
52 /* Operating system level dependencies for Windows that should be used */
53 /* regardless of operating environment */
54 #if defined(WIN32) || defined(_WIN32)
55 #define WTF_PLATFORM_WIN_OS 1
56 #endif
57 
58 /* PLATFORM(UNIX) */
59 /* Operating system level dependencies for Unix-like systems that */
60 /* should be used regardless of operating environment */
61 /* (includes PLATFORM(DARWIN)) */
62 #if defined(__APPLE__) \
63  || defined(unix) \
64  || defined(__unix) \
65  || defined(__unix__) \
66  || defined (__NetBSD__) \
67  || defined(_AIX)
68 #define WTF_PLATFORM_UNIX 1
69 #endif
70 
71 /* PLATFORM(SOLARIS_OS) */
72 /* Operating system level dependencies for Sun (Open)Solaris 10. */
73 /* Studio 12 on Solaris defines __SunOS; gcc defines __sun__; */
74 /* Both compilers define __sun and sun. */
75 #if defined(__sun) || defined(sun)
76 #define WTF_PLATFORM_SOLARIS_OS 1
77 #endif
78 
79 /* Operating environments */
80 
81 /* I made the BUILDING_KDE__ macro up for the KDE build system to define */
82 
83 /* PLATFORM(KDE) */
84 /* PLATFORM(MAC) */
85 /* PLATFORM(WIN) */
86 #if BUILDING_KDE__
87 #define WTF_PLATFORM_KDE 1
88 #elif PLATFORM(DARWIN)
89 #define WTF_PLATFORM_MAC 1
90 #elif PLATFORM(WIN_OS)
91 #define WTF_PLATFORM_WIN 1
92 #endif
93 #if defined(BUILDING_GDK__)
94 #define WTF_PLATFORM_GDK 1
95 #endif
96 
97 
98 /* CPU */
99 
100 /* PLATFORM(S390X) - S390X 64-bit */
101 #if defined(__s390x__)
102 #define WTF_PLATFORM_S390X 1
103 #define WTF_PLATFORM_BIG_ENDIAN 1
104 #endif
105 
106 /* PLATFORM(S390) - S390 32-bit */
107 #if defined(__s390__)
108 #define WTF_PLATFORM_S390 1
109 #define WTF_PLATFORM_BIG_ENDIAN 1
110 #endif
111 
112 /* PLATFORM(PPC) */
113 #if defined(__ppc__) \
114  || defined(__PPC__) \
115  || defined(__powerpc__) \
116  || defined(__powerpc) \
117  || defined(__POWERPC__) \
118  || defined(_M_PPC) \
119  || defined(__PPC)
120 #define WTF_PLATFORM_PPC 1
121 #define WTF_PLATFORM_BIG_ENDIAN 1
122 #endif
123 
124 /* PLATFORM(PPC64) */
125 #if defined(__ppc64__) \
126  || defined(__PPC64__)
127 #define WTF_PLATFORM_PPC64 1
128 #define WTF_PLATFORM_BIG_ENDIAN 1
129 #endif
130 
131 #if defined(arm)
132 #define WTF_PLATFORM_ARM 1
133 #if defined(__ARMEB__)
134 #define WTF_PLATFORM_BIG_ENDIAN 1
135 #elif !defined(__ARM_EABI__) && !defined(__ARMEB__)
136 #define WTF_PLATFORM_MIDDLE_ENDIAN 1
137 #endif
138 #if !defined(__ARM_EABI__)
139 #define WTF_PLATFORM_FORCE_PACK 1
140 #endif
141 #endif
142 
143 /* PLATFORM(X86) */
144 #if defined(__i386__) \
145  || defined(i386) \
146  || defined(_M_IX86) \
147  || defined(_X86_) \
148  || defined(__THW_INTEL)
149 #define WTF_PLATFORM_X86 1
150 #endif
151 
152 /* PLATFORM(X86_64) */
153 #if defined(__x86_64__) \
154  || defined(__ia64__)
155 #define WTF_PLATFORM_X86_64 1
156 #endif
157 
158 /* PLATFORM(SPARC) */
159 #if defined(sparc)
160 #define WTF_PLATFORM_SPARC 1
161 #endif
162 
163 /* Compiler */
164 
165 /* COMPILER(CWP) */
166 #if defined(__MWERKS__)
167 #define WTF_COMPILER_CWP 1
168 #endif
169 
170 /* COMPILER(MSVC) */
171 #if defined(_MSC_VER)
172 #define WTF_COMPILER_MSVC 1
173 #endif
174 
175 /* COMPILER(GCC) */
176 #if defined(__GNUC__)
177 #define WTF_COMPILER_GCC 1
178 #endif
179 
180 /* COMPILER(SUNPRO) */
181 #if defined(__SUNPRO_CC)
182 #define WTF_COMPILER_SUNPRO 1
183 #endif
184 
185 /* COMPILER(BORLAND) */
186 /* not really fully supported - is this relevant any more? */
187 #if defined(__BORLANDC__)
188 #define WTF_COMPILER_BORLAND 1
189 #endif
190 
191 /* COMPILER(CYGWIN) */
192 /* not really fully supported - is this relevant any more? */
193 #if defined(__CYGWIN__)
194 #define WTF_COMPILER_CYGWIN 1
195 #endif
196 
197 /* multiple threads only supported on Mac for now */
198 #if PLATFORM(MAC)
199 #ifndef WTF_USE_MULTIPLE_THREADS
200 #define WTF_USE_MULTIPLE_THREADS 1
201 #endif
202 #ifndef WTF_USE_BINDINGS
203 #define WTF_USE_BINDINGS 1
204 #endif
205 #endif
206 
207 /* for Unicode, KDE uses Qt, everything else uses ICU */
208 #if PLATFORM(KDE) || PLATFORM(QT)
209 #define WTF_USE_QT4_UNICODE 1
210 #elif PLATFORM(SYMBIAN)
211 #define WTF_USE_SYMBIAN_UNICODE 1
212 #else
213 #define WTF_USE_ICU_UNICODE 1
214 #endif
215 
216 #if PLATFORM(MAC)
217 #define WTF_PLATFORM_CF 1
218 #endif
219 
220 #if PLATFORM(WIN)
221 #define WTF_USE_WININET 1
222 #endif
223 
224 #if PLATFORM(GDK)
225 #define WTF_USE_CURL 1
226 #endif
227 
228 /* ENABLE macro defaults */
229 
230 #endif /* WTF_Platform_h */
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Wed Jun 11 2014 00:30:16 by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

WTF

Skip menu "WTF"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.10.5 API Reference

Skip menu "kdelibs-4.10.5 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal