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

WTF

Platform.h

Go to the documentation of this file.
00001 /* -*- mode: c++; c-basic-offset: 4 -*- */
00002 /*
00003  * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  * 1. Redistributions of source code must retain the above copyright
00009  *    notice, this list of conditions and the following disclaimer.
00010  * 2. Redistributions in binary form must reproduce the above copyright
00011  *    notice, this list of conditions and the following disclaimer in the
00012  *    documentation and/or other materials provided with the distribution.
00013  *
00014  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
00015  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00016  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00017  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
00018  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00019  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00020  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00021  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00022  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00023  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00024  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
00025  */
00026 
00027 #ifndef WTF_Platform_h
00028 #define WTF_Platform_h
00029 
00030 /* Force KDE build here in our tree... */
00031 #ifndef BUILDING_KDE__
00032 #define BUILDING_KDE__ 1
00033 #endif
00034 
00035 /* PLATFORM handles OS, operating environment, graphics API, and CPU */
00036 #define PLATFORM(WTF_FEATURE) (defined( WTF_PLATFORM_##WTF_FEATURE ) && WTF_PLATFORM_##WTF_FEATURE)
00037 #define COMPILER(WTF_FEATURE) (defined( WTF_COMPILER_##WTF_FEATURE ) && WTF_COMPILER_##WTF_FEATURE)
00038 #define HAVE(WTF_FEATURE) (defined( HAVE_##WTF_FEATURE ) && HAVE_##WTF_FEATURE)
00039 #define USE(WTF_FEATURE) (defined( WTF_USE_##WTF_FEATURE ) && WTF_USE_##WTF_FEATURE)
00040 
00041 /* Operating systems - low-level dependencies */
00042 
00043 /* PLATFORM(DARWIN) */
00044 /* Operating system level dependencies for Mac OS X / Darwin that should */
00045 /* be used regardless of operating environment */
00046 #ifdef __APPLE__
00047 #define WTF_PLATFORM_DARWIN 1
00048 #endif
00049 
00050 /* PLATFORM(WIN_OS) */
00051 /* Operating system level dependencies for Windows that should be used */
00052 /* regardless of operating environment */
00053 #if defined(WIN32) || defined(_WIN32)
00054 #define WTF_PLATFORM_WIN_OS 1
00055 #endif
00056 
00057 /* PLATFORM(UNIX) */
00058 /* Operating system level dependencies for Unix-like systems that */
00059 /* should be used regardless of operating environment */
00060 /* (includes PLATFORM(DARWIN)) */
00061 #if   defined(__APPLE__)   \
00062    || defined(unix)        \
00063    || defined(__unix)      \
00064    || defined(__unix__)    \
00065    || defined (__NetBSD__) \
00066    || defined(_AIX)
00067 #define WTF_PLATFORM_UNIX 1
00068 #endif
00069 
00070 /* PLATFORM(SOLARIS_OS) */
00071 /* Operating system level dependencies for Sun (Open)Solaris 10. */
00072 /* Studio 12 on Solaris defines __SunOS; gcc defines __sun__; */
00073 /* Both compilers define __sun and sun. */
00074 #if defined(__sun) || defined(sun)
00075 #define WTF_PLATFORM_SOLARIS_OS 1
00076 #endif
00077 
00078 /* Operating environments */
00079 
00080 /* I made the BUILDING_KDE__ macro up for the KDE build system to define */
00081 
00082 /* PLATFORM(KDE) */
00083 /* PLATFORM(MAC) */
00084 /* PLATFORM(WIN) */
00085 #if BUILDING_KDE__
00086 #define WTF_PLATFORM_KDE 1
00087 #elif PLATFORM(DARWIN)
00088 #define WTF_PLATFORM_MAC 1
00089 #elif PLATFORM(WIN_OS)
00090 #define WTF_PLATFORM_WIN 1
00091 #endif
00092 #if defined(BUILDING_GDK__)
00093 #define WTF_PLATFORM_GDK 1
00094 #endif
00095 
00096 
00097 /* CPU */
00098 
00099 /* PLATFORM(PPC) */
00100 #if   defined(__ppc__)     \
00101    || defined(__PPC__)     \
00102    || defined(__powerpc__) \
00103    || defined(__powerpc)   \
00104    || defined(__POWERPC__) \
00105    || defined(_M_PPC)      \
00106    || defined(__PPC)
00107 #define WTF_PLATFORM_PPC 1
00108 #define WTF_PLATFORM_BIG_ENDIAN 1
00109 #endif
00110 
00111 /* PLATFORM(PPC64) */
00112 #if   defined(__ppc64__) \
00113    || defined(__PPC64__)
00114 #define WTF_PLATFORM_PPC64 1
00115 #define WTF_PLATFORM_BIG_ENDIAN 1
00116 #endif
00117 
00118 #if defined(arm)
00119 #define WTF_PLATFORM_ARM 1
00120 #if defined(__ARMEB__)
00121 #define WTF_PLATFORM_BIG_ENDIAN 1
00122 #elif !defined(__ARM_EABI__) && !defined(__ARMEB__)
00123 #define WTF_PLATFORM_MIDDLE_ENDIAN 1
00124 #endif
00125 #if !defined(__ARM_EABI__)
00126 #define WTF_PLATFORM_FORCE_PACK 1
00127 #endif
00128 #endif
00129 
00130 /* PLATFORM(X86) */
00131 #if   defined(__i386__) \
00132    || defined(i386)     \
00133    || defined(_M_IX86)  \
00134    || defined(_X86_)    \
00135    || defined(__THW_INTEL)
00136 #define WTF_PLATFORM_X86 1
00137 #endif
00138 
00139 /* PLATFORM(X86_64) */
00140 #if   defined(__x86_64__) \
00141    || defined(__ia64__)
00142 #define WTF_PLATFORM_X86_64 1
00143 #endif
00144 
00145 /* PLATFORM(SPARC) */
00146 #if defined(sparc)
00147 #define WTF_PLATFORM_SPARC 1
00148 #endif
00149 
00150 /* Compiler */
00151 
00152 /* COMPILER(CWP) */
00153 #if defined(__MWERKS__)
00154 #define WTF_COMPILER_CWP 1
00155 #endif
00156 
00157 /* COMPILER(MSVC) */
00158 #if defined(_MSC_VER)
00159 #define WTF_COMPILER_MSVC 1
00160 #endif
00161 
00162 /* COMPILER(GCC) */
00163 #if defined(__GNUC__)
00164 #define WTF_COMPILER_GCC 1
00165 #endif
00166 
00167 /* COMPILER(SUNPRO) */
00168 #if defined(__SUNPRO_CC)
00169 #define WTF_COMPILER_SUNPRO 1
00170 #endif
00171 
00172 /* COMPILER(BORLAND) */
00173 /* not really fully supported - is this relevant any more? */
00174 #if defined(__BORLANDC__)
00175 #define WTF_COMPILER_BORLAND 1
00176 #endif
00177 
00178 /* COMPILER(CYGWIN) */
00179 /* not really fully supported - is this relevant any more? */
00180 #if defined(__CYGWIN__)
00181 #define WTF_COMPILER_CYGWIN 1
00182 #endif
00183 
00184 /* multiple threads only supported on Mac for now */
00185 #if PLATFORM(MAC)
00186 #ifndef WTF_USE_MULTIPLE_THREADS
00187 #define WTF_USE_MULTIPLE_THREADS 1
00188 #endif
00189 #ifndef WTF_USE_BINDINGS
00190 #define WTF_USE_BINDINGS 1
00191 #endif
00192 #endif
00193 
00194 /* for Unicode, KDE uses Qt, everything else uses ICU */
00195 #if PLATFORM(KDE) || PLATFORM(QT)
00196 #define WTF_USE_QT4_UNICODE 1
00197 #elif PLATFORM(SYMBIAN)
00198 #define WTF_USE_SYMBIAN_UNICODE 1
00199 #else
00200 #define WTF_USE_ICU_UNICODE 1
00201 #endif
00202 
00203 #if PLATFORM(MAC)
00204 #define WTF_PLATFORM_CF 1
00205 #endif
00206 
00207 #if PLATFORM(WIN)
00208 #define WTF_USE_WININET 1
00209 #endif
00210 
00211 #if PLATFORM(GDK)
00212 #define WTF_USE_CURL 1
00213 #endif
00214 
00215 #endif /* WTF_Platform_h */

WTF

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   WTF
  • KJSEmbed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  •   core
  • Phonon
  •   Backend
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal