diff options
Diffstat (limited to 'src/qml/qtqmlglobal_p.h')
-rw-r--r-- | src/qml/qtqmlglobal_p.h | 46 |
1 files changed, 7 insertions, 39 deletions
diff --git a/src/qml/qtqmlglobal_p.h b/src/qml/qtqmlglobal_p.h index 6547274d09..4c0ba338d8 100644 --- a/src/qml/qtqmlglobal_p.h +++ b/src/qml/qtqmlglobal_p.h @@ -52,49 +52,17 @@ // #include <QtCore/private/qglobal_p.h> -#include <QtQml/private/qtqml-config_p.h> #include <QtQml/qtqmlglobal.h> +#ifndef QT_QML_BOOTSTRAPPED +# include <QtQml/private/qtqml-config_p.h> +#endif -// Define Q_ALLOCA_VAR macro to be used instead of #ifdeffing -// the occurrences of alloca() in case it's not supported. -// Q_ALLOCA_DECLARE and Q_ALLOCA_ASSIGN macros separate -// memory allocation from the declaration and RAII. -#define Q_ALLOCA_VAR(type, name, size) \ - Q_ALLOCA_DECLARE(type, name); \ - Q_ALLOCA_ASSIGN(type, name, size) - -#if defined(QT_BOOTSTRAPPED) || QT_CONFIG(alloca) - -#define Q_ALLOCA_DECLARE(type, name) \ - type *name = 0 - -#define Q_ALLOCA_ASSIGN(type, name, size) \ - name = static_cast<type*>(alloca(size)) +#define Q_QML_PRIVATE_EXPORT Q_QML_EXPORT +#if !defined(QT_QMLDEVTOOLS_LIB) && !defined(QT_BUILD_QMLDEVTOOLS_LIB) +# define Q_QML_AUTOTEST_EXPORT Q_AUTOTEST_EXPORT #else -QT_BEGIN_NAMESPACE -class Qt_AllocaWrapper -{ -public: - Qt_AllocaWrapper() { m_data = 0; } - ~Qt_AllocaWrapper() { free(m_data); } - void *data() { return m_data; } - void allocate(int size) { m_data = malloc(size); } -private: - void *m_data; -}; -QT_END_NAMESPACE - -#define Q_ALLOCA_DECLARE(type, name) \ - Qt_AllocaWrapper _qt_alloca_##name; \ - type *name = 0 - -#define Q_ALLOCA_ASSIGN(type, name, size) \ - _qt_alloca_##name.allocate(size); \ - name = static_cast<type*>(_qt_alloca_##name.data()) - +# define Q_QML_AUTOTEST_EXPORT #endif -#define Q_QML_PRIVATE_EXPORT Q_QML_EXPORT - #endif // QTQMLGLOBAL_P_H |