Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-17 09:24:51

0001 // Copyright (C) 2022 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 // Qt-Security score:significant reason:default
0004 
0005 #ifndef QCONSTRUCTORMACROS_H
0006 #define QCONSTRUCTORMACROS_H
0007 
0008 #if 0
0009 #pragma qt_class(QtConstructorMacros)
0010 #pragma qt_sync_stop_processing
0011 #endif
0012 
0013 #if defined(__cplusplus)
0014 
0015 #ifndef Q_CONSTRUCTOR_FUNCTION
0016 # define Q_CONSTRUCTOR_FUNCTION0(AFUNC) \
0017     namespace { \
0018     static const struct AFUNC ## _ctor_class_ { \
0019         inline AFUNC ## _ctor_class_() { AFUNC(); } \
0020     } AFUNC ## _ctor_instance_; \
0021     }
0022 
0023 # define Q_CONSTRUCTOR_FUNCTION(AFUNC) Q_CONSTRUCTOR_FUNCTION0(AFUNC)
0024 #endif
0025 
0026 #ifndef Q_DESTRUCTOR_FUNCTION
0027 # define Q_DESTRUCTOR_FUNCTION0(AFUNC) \
0028     namespace { \
0029     static const struct AFUNC ## _dtor_class_ { \
0030         inline AFUNC ## _dtor_class_() { } \
0031         inline ~ AFUNC ## _dtor_class_() { AFUNC(); } \
0032     } AFUNC ## _dtor_instance_; \
0033     }
0034 # define Q_DESTRUCTOR_FUNCTION(AFUNC) Q_DESTRUCTOR_FUNCTION0(AFUNC)
0035 #endif
0036 
0037 #endif // __cplusplus
0038 
0039 #endif // QCONSTRUCTORMACROS_H