Move QT_SHARED, QT_STATIC and QT_CONFIG macos to qtconfigmacros.h
Change-Id: Icf4621fa22f41355f98ed38b47560706258b41b7 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 43b59a842a86140fa5f5da2f0d66d0d916883c8f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f4d3b191a0
commit
b000770c20
@ -33,45 +33,9 @@
|
|||||||
#include <QtCore/qtcore-config.h>
|
#include <QtCore/qtcore-config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
#include <QtCore/qtconfigmacros.h>
|
||||||
The Qt modules' export macros.
|
|
||||||
The options are:
|
|
||||||
- defined(QT_STATIC): Qt was built or is being built in static mode
|
|
||||||
- defined(QT_SHARED): Qt was built or is being built in shared/dynamic mode
|
|
||||||
If neither was defined, then QT_SHARED is implied. If Qt was compiled in static
|
|
||||||
mode, QT_STATIC is defined in qconfig.h. In shared mode, QT_STATIC is implied
|
|
||||||
for the bootstrapped tools.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef QT_BOOTSTRAPPED
|
|
||||||
# ifdef QT_SHARED
|
|
||||||
# error "QT_SHARED and QT_BOOTSTRAPPED together don't make sense. Please fix the build"
|
|
||||||
# elif !defined(QT_STATIC)
|
|
||||||
# define QT_STATIC
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(QT_SHARED) || !defined(QT_STATIC)
|
|
||||||
# ifdef QT_STATIC
|
|
||||||
# error "Both QT_SHARED and QT_STATIC defined, please make up your mind"
|
|
||||||
# endif
|
|
||||||
# ifndef QT_SHARED
|
|
||||||
# define QT_SHARED
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QtCore/qtcoreexports.h>
|
#include <QtCore/qtcoreexports.h>
|
||||||
|
|
||||||
/*
|
|
||||||
The QT_CONFIG macro implements a safe compile time check for features of Qt.
|
|
||||||
Features can be in three states:
|
|
||||||
0 or undefined: This will lead to a compile error when testing for it
|
|
||||||
-1: The feature is not available
|
|
||||||
1: The feature is available
|
|
||||||
*/
|
|
||||||
#define QT_CONFIG(feature) (1/QT_FEATURE_##feature == 1)
|
|
||||||
#define QT_REQUIRE_CONFIG(feature) Q_STATIC_ASSERT_X(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " __FILE__ " not available.")
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
helper macros to make some simple code work active in Qt 6 or Qt 7 only,
|
helper macros to make some simple code work active in Qt 6 or Qt 7 only,
|
||||||
like:
|
like:
|
||||||
@ -192,8 +156,6 @@ static_assert(!std::is_convertible_v<std::nullptr_t, bool>,
|
|||||||
# define Q_STATIC_ASSERT_X(Condition, Message) Q_STATIC_ASSERT(Condition)
|
# define Q_STATIC_ASSERT_X(Condition, Message) Q_STATIC_ASSERT(Condition)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include <QtCore/qtconfigmacros.h>
|
|
||||||
|
|
||||||
#ifndef __ASSEMBLER__
|
#ifndef __ASSEMBLER__
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
@ -4,6 +4,43 @@
|
|||||||
#ifndef QTCONFIGMACROS_H
|
#ifndef QTCONFIGMACROS_H
|
||||||
#define QTCONFIGMACROS_H
|
#define QTCONFIGMACROS_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
The Qt modules' export macros.
|
||||||
|
The options are:
|
||||||
|
- defined(QT_STATIC): Qt was built or is being built in static mode
|
||||||
|
- defined(QT_SHARED): Qt was built or is being built in shared/dynamic mode
|
||||||
|
If neither was defined, then QT_SHARED is implied. If Qt was compiled in static
|
||||||
|
mode, QT_STATIC is defined in qconfig.h. In shared mode, QT_STATIC is implied
|
||||||
|
for the bootstrapped tools.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef QT_BOOTSTRAPPED
|
||||||
|
# ifdef QT_SHARED
|
||||||
|
# error "QT_SHARED and QT_BOOTSTRAPPED together don't make sense. Please fix the build"
|
||||||
|
# elif !defined(QT_STATIC)
|
||||||
|
# define QT_STATIC
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(QT_SHARED) || !defined(QT_STATIC)
|
||||||
|
# ifdef QT_STATIC
|
||||||
|
# error "Both QT_SHARED and QT_STATIC defined, please make up your mind"
|
||||||
|
# endif
|
||||||
|
# ifndef QT_SHARED
|
||||||
|
# define QT_SHARED
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
The QT_CONFIG macro implements a safe compile time check for features of Qt.
|
||||||
|
Features can be in three states:
|
||||||
|
0 or undefined: This will lead to a compile error when testing for it
|
||||||
|
-1: The feature is not available
|
||||||
|
1: The feature is available
|
||||||
|
*/
|
||||||
|
#define QT_CONFIG(feature) (1/QT_FEATURE_##feature == 1)
|
||||||
|
#define QT_REQUIRE_CONFIG(feature) Q_STATIC_ASSERT_X(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " __FILE__ " not available.")
|
||||||
|
|
||||||
// valid for both C and C++
|
// valid for both C and C++
|
||||||
#define QT_MANGLE_NAMESPACE0(x) x
|
#define QT_MANGLE_NAMESPACE0(x) x
|
||||||
#define QT_MANGLE_NAMESPACE1(a, b) a##_##b
|
#define QT_MANGLE_NAMESPACE1(a, b) a##_##b
|
||||||
|
Loading…
x
Reference in New Issue
Block a user