Smithy Qt 0.1.0-pre
Internal development documentation
Loading...
Searching...
No Matches
qtsmithy_global.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2013-2025 Paul Colby <git@colby.id.au>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
4/*!
5 * \file
6 * Global QtSmithy library macros.
7 */
8
9#ifndef QTSMITHY_GLOBAL_H
10#define QTSMITHY_GLOBAL_H
11
12#include <QtGlobal>
13
14/// \cond internal
15
16/*!
17 * QtSmithy library export/import macro.
18 */
19#if defined(QTSMITHY_SHARED) || !defined(QTSMITHY_STATIC)
20# ifdef QTSMITHY_STATIC
21# error "Both QTSMITHY_SHARED and QTSMITHY_STATIC defined."
22# endif
23# if defined(QTSMITHY_LIBRARY)
24# define QTSMITHY_EXPORT Q_DECL_EXPORT
25# else
26# define QTSMITHY_EXPORT Q_DECL_IMPORT
27# endif
28#else
29# define QTSMITHY_EXPORT
30#endif
31
32/*!
33 * \def QTSMITHY_BEGIN_NAMESPACE
34 *
35 * Macro for starting the QtSmithy library's top-most namespace (if one is defined).
36 *
37 * \sa QTSMITHY_END_NAMESPACE
38 * \sa QTSMITHY_NAMESPACE
39 */
40
41/*!
42 * \def QTSMITHY_END_NAMESPACE
43 *
44 * Macro for ending the QtSmithy library's top-most namespace (if one is defined).
45 *
46 * \sa QTSMITHY_BEGIN_NAMESPACE
47 * \sa QTSMITHY_NAMESPACE
48 */
49
50#ifdef QTSMITHY_NAMESPACE
51 #define QTSMITHY_BEGIN_NAMESPACE namespace QTSMITHY_NAMESPACE {
52 #define QTSMITHY_END_NAMESPACE }
53#else
54 #define QTSMITHY_BEGIN_NAMESPACE
55 #define QTSMITHY_END_NAMESPACE
56#endif
57
58/*!
59 * \def QTSMITHY_DECLARE_TEST
60 *
61 * Macro for forward-delcaring a related unit test class, but only when QT_TESTLIB_LIB is defined.
62 *
63 * \sa QTSMITHY_BEFRIEND_TEST
64 */
65
66/*!
67 * \def QTSMITHY_BEFRIEND_TEST
68 *
69 * Macro for befriending a related unit test class, but only when QT_TESTLIB_LIB is defined.
70 *
71 * \sa QTSMITHY_DECLARE_TEST
72 */
73
74#ifdef QT_TESTLIB_LIB
75 #define QTSMITHY_DECLARE_TEST(Class) class Test##Class;
76 #define QTSMITHY_BEFRIEND_TEST(Class) friend class ::Test##Class;
77#else
78 #define QTSMITHY_DECLARE_TEST(Class)
79 #define QTSMITHY_BEFRIEND_TEST(Class)
80#endif
81
82/// \endcond
83
84#endif // QTSMITHY_GLOBAL_H