• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.0 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(PPC) */
101 #if defined(__ppc__) \
102  || defined(__PPC__) \
103  || defined(__powerpc__) \
104  || defined(__powerpc) \
105  || defined(__POWERPC__) \
106  || defined(_M_PPC) \
107  || defined(__PPC)
108 #define WTF_PLATFORM_PPC 1
109 #define WTF_PLATFORM_BIG_ENDIAN 1
110 #endif
111 
112 /* PLATFORM(PPC64) */
113 #if defined(__ppc64__) \
114  || defined(__PPC64__)
115 #define WTF_PLATFORM_PPC64 1
116 #define WTF_PLATFORM_BIG_ENDIAN 1
117 #endif
118 
119 #if defined(arm)
120 #define WTF_PLATFORM_ARM 1
121 #if defined(__ARMEB__)
122 #define WTF_PLATFORM_BIG_ENDIAN 1
123 #elif !defined(__ARM_EABI__) && !defined(__ARMEB__)
124 #define WTF_PLATFORM_MIDDLE_ENDIAN 1
125 #endif
126 #if !defined(__ARM_EABI__)
127 #define WTF_PLATFORM_FORCE_PACK 1
128 #endif
129 #endif
130 
131 /* PLATFORM(X86) */
132 #if defined(__i386__) \
133  || defined(i386) \
134  || defined(_M_IX86) \
135  || defined(_X86_) \
136  || defined(__THW_INTEL)
137 #define WTF_PLATFORM_X86 1
138 #endif
139 
140 /* PLATFORM(X86_64) */
141 #if defined(__x86_64__) \
142  || defined(__ia64__)
143 #define WTF_PLATFORM_X86_64 1
144 #endif
145 
146 /* PLATFORM(SPARC) */
147 #if defined(sparc)
148 #define WTF_PLATFORM_SPARC 1
149 #endif
150 
151 /* Compiler */
152 
153 /* COMPILER(CWP) */
154 #if defined(__MWERKS__)
155 #define WTF_COMPILER_CWP 1
156 #endif
157 
158 /* COMPILER(MSVC) */
159 #if defined(_MSC_VER)
160 #define WTF_COMPILER_MSVC 1
161 #endif
162 
163 /* COMPILER(GCC) */
164 #if defined(__GNUC__)
165 #define WTF_COMPILER_GCC 1
166 #endif
167 
168 /* COMPILER(SUNPRO) */
169 #if defined(__SUNPRO_CC)
170 #define WTF_COMPILER_SUNPRO 1
171 #endif
172 
173 /* COMPILER(BORLAND) */
174 /* not really fully supported - is this relevant any more? */
175 #if defined(__BORLANDC__)
176 #define WTF_COMPILER_BORLAND 1
177 #endif
178 
179 /* COMPILER(CYGWIN) */
180 /* not really fully supported - is this relevant any more? */
181 #if defined(__CYGWIN__)
182 #define WTF_COMPILER_CYGWIN 1
183 #endif
184 
185 /* multiple threads only supported on Mac for now */
186 #if PLATFORM(MAC)
187 #ifndef WTF_USE_MULTIPLE_THREADS
188 #define WTF_USE_MULTIPLE_THREADS 1
189 #endif
190 #ifndef WTF_USE_BINDINGS
191 #define WTF_USE_BINDINGS 1
192 #endif
193 #endif
194 
195 /* for Unicode, KDE uses Qt, everything else uses ICU */
196 #if PLATFORM(KDE) || PLATFORM(QT)
197 #define WTF_USE_QT4_UNICODE 1
198 #elif PLATFORM(SYMBIAN)
199 #define WTF_USE_SYMBIAN_UNICODE 1
200 #else
201 #define WTF_USE_ICU_UNICODE 1
202 #endif
203 
204 #if PLATFORM(MAC)
205 #define WTF_PLATFORM_CF 1
206 #endif
207 
208 #if PLATFORM(WIN)
209 #define WTF_USE_WININET 1
210 #endif
211 
212 #if PLATFORM(GDK)
213 #define WTF_USE_CURL 1
214 #endif
215 
216 /* ENABLE macro defaults */
217 
218 #endif /* WTF_Platform_h */
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Feb 9 2013 12:04:19 by doxygen 1.8.2 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.0 API Reference

Skip menu "kdelibs-4.10.0 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