Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qstdlibdetection.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#if 0
6#pragma qt_class(QtStdLibDetection)
7#pragma qt_sync_skip_header_check
8#pragma qt_sync_stop_processing
9#endif
10
11#ifndef QSTDLIBDETECTION_H
12#define QSTDLIBDETECTION_H
13
14#include <QtCore/qtconfiginclude.h>
15
16#ifdef __cplusplus
17
18/* If <version> exists, qtconfiginclude.h will have included it. */
19/* If not, we need to include _something_, and <utility> is included by qcompilerdetection.h, too */
20#if !__has_include(<version>)
21# include <utility>
22#endif
23
24/*
25 The std lib, must be one of: (Q_STL_x)
26
27 LIBCPP - libc++ (shipped with Clang, e.g.)
28 LIBSTDCPP - libstdc++ (shipped with GCC, e.g.)
29 MSSTL - Microsoft STL
30 DINKUMWARE - Dinkumware (shipped with QNX, VxWorks, Integrity, origin of MSSTL)
31 STLPORT - STLport (merged with SGI)
32 SGI - The original STL
33 ROGUEWAVE - RogueWave ((used to be) popular on ARM?)
34
35 Not included:
36 EASTL - EASTL (this is not a drop-in STL, e.g. it doesn't have <vector>-style headers)
37
38 Should be sorted most to least authoritative.
39*/
40
41#if defined(_LIBCPP_VERSION) /* libc++ */
42# define Q_STL_LIBCPP
43#elif defined(_GLIBCXX_RELEASE) /* libstdc++ */
44# define Q_STL_LIBSTDCPP
45#elif defined(_MSVC_STL_VERSION) /* MSSTL (must be before Dinkumware) */
46# define Q_STL_MSSTL
47#elif defined(_YVALS) || defined(_CPPLIB_VER) /* Dinkumware */
48# define Q_STL_DINKUMWARE
49#elif defined(_STLPORT_VERSION) /* STLport, cf. _stlport_version.h */
50# define Q_STL_STLPORT
51#elif defined(__SGI_STL) /* must be after STLport, which mimics as SGI STL */
52# define Q_STL_SGI
53#elif defined(_RWSTD_VER) /* RogueWave, at least as contributed to Apache stdcxx, cf. rw/_config.h */
54# define Q_STL_ROGUEWAVE
55#else
56# error Unknown std library implementation, please file a report at bugreports.qt.io.
57#endif
58
59#endif // __cplusplus
60
61#endif // QSTDLIBDETECTION_H
#define __has_include(x)