Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/QtCore/qsystemdetection.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (C) 2019 The Qt Company Ltd.
0002 // Copyright (C) 2019 Intel Corporation.
0003 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0004 
0005 #if 0
0006 #pragma qt_class(QtSystemDetection)
0007 #pragma qt_sync_skip_header_check
0008 #pragma qt_sync_stop_processing
0009 #endif
0010 
0011 #ifndef QSYSTEMDETECTION_H
0012 #define QSYSTEMDETECTION_H
0013 
0014 /*
0015    The operating system, must be one of: (Q_OS_x)
0016 
0017      DARWIN   - Any Darwin system (macOS, iOS, watchOS, tvOS)
0018      MACOS    - macOS
0019      IOS      - iOS
0020      WATCHOS  - watchOS
0021      TVOS     - tvOS
0022      WIN32    - Win32 (Windows 2000/XP/Vista/7 and Windows Server 2003/2008)
0023      CYGWIN   - Cygwin
0024      SOLARIS  - Sun Solaris
0025      HPUX     - HP-UX
0026      LINUX    - Linux [has variants]
0027      FREEBSD  - FreeBSD [has variants]
0028      NETBSD   - NetBSD
0029      OPENBSD  - OpenBSD
0030      INTERIX  - Interix
0031      AIX      - AIX
0032      HURD     - GNU Hurd
0033      QNX      - QNX [has variants]
0034      QNX6     - QNX RTP 6.1
0035      LYNX     - LynxOS
0036      BSD4     - Any BSD 4.4 system
0037      UNIX     - Any UNIX BSD/SYSV system
0038      ANDROID  - Android platform
0039      HAIKU    - Haiku
0040      WEBOS    - LG WebOS
0041      WASM     - WebAssembly
0042 
0043    The following operating systems have variants:
0044      LINUX    - both Q_OS_LINUX and Q_OS_ANDROID are defined when building for Android
0045               - only Q_OS_LINUX is defined if building for other Linux systems
0046      MACOS    - both Q_OS_BSD4 and Q_OS_IOS are defined when building for iOS
0047               - both Q_OS_BSD4 and Q_OS_MACOS are defined when building for macOS
0048      FREEBSD  - Q_OS_FREEBSD is defined only when building for FreeBSD with a BSD userland
0049               - Q_OS_FREEBSD_KERNEL is always defined on FreeBSD, even if the userland is from GNU
0050 */
0051 
0052 #if defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__))
0053 #  include <TargetConditionals.h>
0054 #  define Q_OS_APPLE
0055 #  if defined(TARGET_OS_MAC) && TARGET_OS_MAC
0056 #    define Q_OS_DARWIN
0057 #    define Q_OS_BSD4
0058 #    if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
0059 #      define QT_PLATFORM_UIKIT
0060 #      if defined(TARGET_OS_WATCH) && TARGET_OS_WATCH
0061 #        define Q_OS_WATCHOS
0062 #      elif defined(TARGET_OS_TV) && TARGET_OS_TV
0063 #        define Q_OS_TVOS
0064 #      else
0065 #        // TARGET_OS_IOS is only available in newer SDKs,
0066 #        // so assume any other iOS-based platform is iOS for now
0067 #        define Q_OS_IOS
0068 #      endif
0069 #    else
0070 #      // TARGET_OS_OSX is only available in newer SDKs,
0071 #      // so assume any non iOS-based platform is macOS for now
0072 #      define Q_OS_MACOS
0073 #    endif
0074 #  else
0075 #    error "Qt has not been ported to this Apple platform - see http://www.qt.io/developers"
0076 #  endif
0077 #elif defined(__WEBOS__)
0078 #  define Q_OS_WEBOS
0079 #  define Q_OS_LINUX
0080 #elif defined(__ANDROID__) || defined(ANDROID)
0081 #  define Q_OS_ANDROID
0082 #  define Q_OS_LINUX
0083 #elif defined(__CYGWIN__)
0084 #  define Q_OS_CYGWIN
0085 #elif !defined(SAG_COM) && (!defined(WINAPI_FAMILY) || WINAPI_FAMILY==WINAPI_FAMILY_DESKTOP_APP) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))
0086 #  define Q_OS_WIN32
0087 #  define Q_OS_WIN64
0088 #elif !defined(SAG_COM) && (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__))
0089 #    define Q_OS_WIN32
0090 #elif defined(__sun) || defined(sun)
0091 #  define Q_OS_SOLARIS
0092 #elif defined(hpux) || defined(__hpux)
0093 #  define Q_OS_HPUX
0094 #elif defined(__EMSCRIPTEN__)
0095 #  define Q_OS_WASM
0096 #elif defined(__linux__) || defined(__linux)
0097 #  define Q_OS_LINUX
0098 #elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)
0099 #  ifndef __FreeBSD_kernel__
0100 #    define Q_OS_FREEBSD
0101 #  endif
0102 #  define Q_OS_FREEBSD_KERNEL
0103 #  define Q_OS_BSD4
0104 #elif defined(__NetBSD__)
0105 #  define Q_OS_NETBSD
0106 #  define Q_OS_BSD4
0107 #elif defined(__OpenBSD__)
0108 #  define Q_OS_OPENBSD
0109 #  define Q_OS_BSD4
0110 #elif defined(__INTERIX)
0111 #  define Q_OS_INTERIX
0112 #  define Q_OS_BSD4
0113 #elif defined(_AIX)
0114 #  define Q_OS_AIX
0115 #elif defined(__Lynx__)
0116 #  define Q_OS_LYNX
0117 #elif defined(__GNU__)
0118 #  define Q_OS_HURD
0119 #elif defined(__QNXNTO__)
0120 #  define Q_OS_QNX
0121 #elif defined(__INTEGRITY)
0122 #  define Q_OS_INTEGRITY
0123 #elif defined(__rtems__)
0124 #  define Q_OS_RTEMS
0125 #elif defined(__vxworks)
0126 #  define Q_OS_VXWORKS
0127 #elif defined(__HAIKU__)
0128 #  define Q_OS_HAIKU
0129 #elif defined(__MAKEDEPEND__)
0130 #else
0131 #  error "Qt has not been ported to this OS - see http://www.qt-project.org/"
0132 #endif
0133 
0134 #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
0135 #  define Q_OS_WINDOWS
0136 #  define Q_OS_WIN
0137 // On Windows, pointers to dllimport'ed variables are not constant expressions,
0138 // so to keep to certain initializations (like QMetaObject) constexpr, we need
0139 // to use functions instead.
0140 #  define QT_NO_DATA_RELOCATION
0141 #endif
0142 
0143 #if defined(Q_OS_WIN)
0144 #  undef Q_OS_UNIX
0145 #elif !defined(Q_OS_UNIX)
0146 #  define Q_OS_UNIX
0147 #endif
0148 
0149 // Compatibility synonyms
0150 #ifdef Q_OS_DARWIN
0151 #  pragma clang diagnostic push
0152 #  pragma clang diagnostic ignored "-Wunknown-pragmas"
0153 #  define Q_OS_MAC // FIXME: Deprecate
0154 #  ifdef __LP64__
0155 #    define Q_OS_DARWIN64
0156 #    pragma clang deprecated(Q_OS_DARWIN64, "use Q_OS_DARWIN and QT_POINTER_SIZE/Q_PROCESSOR_* instead")
0157 #    define Q_OS_MAC64
0158 #    pragma clang deprecated(Q_OS_MAC64, "use Q_OS_DARWIN and QT_POINTER_SIZE/Q_PROCESSOR_* instead")
0159 #  else
0160 #    define Q_OS_DARWIN32
0161 #    pragma clang deprecated(Q_OS_DARWIN32, "use Q_OS_DARWIN and QT_POINTER_SIZE/Q_PROCESSOR_* instead")
0162 #    define Q_OS_MAC32
0163 #    pragma clang deprecated(Q_OS_MAC32, "use Q_OS_DARWIN and QT_POINTER_SIZE/Q_PROCESSOR_* instead")
0164 #  endif
0165 #  ifdef Q_OS_MACOS
0166 #    define Q_OS_MACX
0167 #    pragma clang deprecated(Q_OS_MACX, "use Q_OS_MACOS instead")
0168 #    define Q_OS_OSX
0169 #    pragma clang deprecated(Q_OS_OSX, "use Q_OS_MACOS instead")
0170 #  endif
0171 #  pragma clang diagnostic pop
0172 #endif
0173 
0174 #ifdef Q_OS_DARWIN
0175 #  include <Availability.h>
0176 #  include <AvailabilityMacros.h>
0177 
0178 #  define QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios, tvos, watchos) \
0179     ((defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && macos != __MAC_NA && __MAC_OS_X_VERSION_MAX_ALLOWED >= macos) || \
0180      (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && ios != __IPHONE_NA && __IPHONE_OS_VERSION_MAX_ALLOWED >= ios) || \
0181      (defined(__TV_OS_VERSION_MAX_ALLOWED) && tvos != __TVOS_NA && __TV_OS_VERSION_MAX_ALLOWED >= tvos) || \
0182      (defined(__WATCH_OS_VERSION_MAX_ALLOWED) && watchos != __WATCHOS_NA && __WATCH_OS_VERSION_MAX_ALLOWED >= watchos))
0183 
0184 #  define QT_DARWIN_DEPLOYMENT_TARGET_BELOW(macos, ios, tvos, watchos) \
0185     ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && macos != __MAC_NA && __MAC_OS_X_VERSION_MIN_REQUIRED < macos) || \
0186      (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && ios != __IPHONE_NA && __IPHONE_OS_VERSION_MIN_REQUIRED < ios) || \
0187      (defined(__TV_OS_VERSION_MIN_REQUIRED) && tvos != __TVOS_NA && __TV_OS_VERSION_MIN_REQUIRED < tvos) || \
0188      (defined(__WATCH_OS_VERSION_MIN_REQUIRED) && watchos != __WATCHOS_NA && __WATCH_OS_VERSION_MIN_REQUIRED < watchos))
0189 
0190 #  define QT_MACOS_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios) \
0191       QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios, __TVOS_NA, __WATCHOS_NA)
0192 #  define QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(macos) \
0193       QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, __IPHONE_NA, __TVOS_NA, __WATCHOS_NA)
0194 #  define QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(ios) \
0195       QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_NA, ios, __TVOS_NA, __WATCHOS_NA)
0196 #  define QT_TVOS_PLATFORM_SDK_EQUAL_OR_ABOVE(tvos) \
0197       QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_NA, __IPHONE_NA, tvos, __WATCHOS_NA)
0198 #  define QT_WATCHOS_PLATFORM_SDK_EQUAL_OR_ABOVE(watchos) \
0199       QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_NA, __IPHONE_NA, __TVOS_NA, watchos)
0200 
0201 #  define QT_MACOS_IOS_DEPLOYMENT_TARGET_BELOW(macos, ios) \
0202       QT_DARWIN_DEPLOYMENT_TARGET_BELOW(macos, ios, __TVOS_NA, __WATCHOS_NA)
0203 #  define QT_MACOS_DEPLOYMENT_TARGET_BELOW(macos) \
0204       QT_DARWIN_DEPLOYMENT_TARGET_BELOW(macos, __IPHONE_NA, __TVOS_NA, __WATCHOS_NA)
0205 #  define QT_IOS_DEPLOYMENT_TARGET_BELOW(ios) \
0206       QT_DARWIN_DEPLOYMENT_TARGET_BELOW(__MAC_NA, ios, __TVOS_NA, __WATCHOS_NA)
0207 #  define QT_TVOS_DEPLOYMENT_TARGET_BELOW(tvos) \
0208       QT_DARWIN_DEPLOYMENT_TARGET_BELOW(__MAC_NA, __IPHONE_NA, tvos, __WATCHOS_NA)
0209 #  define QT_WATCHOS_DEPLOYMENT_TARGET_BELOW(watchos) \
0210       QT_DARWIN_DEPLOYMENT_TARGET_BELOW(__MAC_NA, __IPHONE_NA, __TVOS_NA, watchos)
0211 
0212 #else // !Q_OS_DARWIN
0213 
0214 #define QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios, tvos, watchos) (0)
0215 #define QT_MACOS_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(macos, ios) (0)
0216 #define QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(macos) (0)
0217 #define QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(ios) (0)
0218 #define QT_TVOS_PLATFORM_SDK_EQUAL_OR_ABOVE(tvos) (0)
0219 #define QT_WATCHOS_PLATFORM_SDK_EQUAL_OR_ABOVE(watchos) (0)
0220 
0221 #endif // Q_OS_DARWIN
0222 
0223 #ifdef __LSB_VERSION__
0224 #  if __LSB_VERSION__ < 40
0225 #    error "This version of the Linux Standard Base is unsupported"
0226 #  endif
0227 #ifndef QT_LINUXBASE
0228 #  define QT_LINUXBASE
0229 #endif
0230 #endif
0231 
0232 #if defined (__ELF__)
0233 #  define Q_OF_ELF
0234 #endif
0235 #if defined (__MACH__) && defined (__APPLE__)
0236 #  define Q_OF_MACH_O
0237 #endif
0238 
0239 #endif // QSYSTEMDETECTION_H