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

WTF

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

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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