File indexing completed on 2025-01-18 10:07:40
0001
0002
0003
0004 #ifndef QTSYMBOLMACROS_H
0005 #define QTSYMBOLMACROS_H
0006
0007 #if 0
0008 # pragma qt_sync_stop_processing
0009 #endif
0010
0011
0012 #include <QtCore/qcompilerdetection.h>
0013 #include <QtCore/qtpreprocessorsupport.h>
0014
0015
0016 #ifdef QT_NAMESPACE
0017 # define QT_RCC_MANGLE_NAMESPACE0(x) x
0018 # define QT_RCC_MANGLE_NAMESPACE1(a, b) a##_##b
0019 # define QT_RCC_MANGLE_NAMESPACE2(a, b) QT_RCC_MANGLE_NAMESPACE1(a,b)
0020 # define QT_RCC_MANGLE_NAMESPACE(name) QT_RCC_MANGLE_NAMESPACE2( \
0021 QT_RCC_MANGLE_NAMESPACE0(name), QT_RCC_MANGLE_NAMESPACE0(QT_NAMESPACE))
0022 #else
0023 # define QT_RCC_MANGLE_NAMESPACE(name) name
0024 #endif
0025
0026
0027 #if defined(Q_CC_GHS)
0028 # define Q_GHS_KEEP_REFERENCE(S) QT_DO_PRAGMA(ghs reference S ##__Fv)
0029 #else
0030 # define Q_GHS_KEEP_REFERENCE(S)
0031 #endif
0032
0033
0034 #define QT_DECLARE_EXTERN_SYMBOL(NAME, RETURN_TYPE) \
0035 extern RETURN_TYPE NAME(); \
0036 Q_GHS_KEEP_REFERENCE(NAME)
0037
0038 #define QT_DECLARE_EXTERN_SYMBOL_INT(NAME) \
0039 QT_DECLARE_EXTERN_SYMBOL(NAME, int)
0040
0041 #define QT_DECLARE_EXTERN_SYMBOL_VOID(NAME) \
0042 QT_DECLARE_EXTERN_SYMBOL(NAME, void)
0043
0044 #define QT_KEEP_SYMBOL_VAR_NAME(NAME) NAME ## _keep
0045
0046 #define QT_KEEP_SYMBOL_HELPER(NAME, VAR_NAME) \
0047 volatile auto VAR_NAME = &NAME; \
0048 Q_UNUSED(VAR_NAME)
0049
0050 #define QT_KEEP_SYMBOL(NAME) \
0051 QT_KEEP_SYMBOL_HELPER(NAME, QT_KEEP_SYMBOL_VAR_NAME(NAME))
0052
0053
0054
0055 #define QT_GET_RESOURCE_INIT_SYMBOL(NAME) \
0056 QT_RCC_MANGLE_NAMESPACE(qInitResources_ ## NAME)
0057
0058 #define QT_DECLARE_EXTERN_RESOURCE(NAME) \
0059 QT_DECLARE_EXTERN_SYMBOL_INT(QT_GET_RESOURCE_INIT_SYMBOL(NAME))
0060
0061 #define QT_KEEP_RESOURCE(NAME) \
0062 QT_KEEP_SYMBOL(QT_GET_RESOURCE_INIT_SYMBOL(NAME))
0063
0064 #endif
0065