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

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