Debian Codegraph @

include/global/dtkcore_global.h

raw
1 // SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
2 //
3 // SPDX-License-Identifier: LGPL-3.0-or-later
4
5 #pragma once
6
7 #include <QtCore/qglobal.h>
8 #include <dtkcore_config.h>
9
10 #define DTK_NAMESPACE Dtk
11
12 #if !defined(DTK_NAMESPACE)
13 # define DTK_BEGIN_NAMESPACE
14 # define DTK_END_NAMESPACE
15 # define DTK_USE_NAMESPACE
16 #else
17 # define DTK_BEGIN_NAMESPACE namespace DTK_NAMESPACE {
18 # define DTK_END_NAMESPACE }
19 # define DTK_USE_NAMESPACE using namespace DTK_NAMESPACE;
20 #endif
21
22 #define DCORE_NAMESPACE Core
23 #define DTK_CORE_NAMESPACE DTK_NAMESPACE::DCORE_NAMESPACE
24
25 #if !defined(DCORE_NAMESPACE)
26 # define DCORE_BEGIN_NAMESPACE
27 # define DCORE_END_NAMESPACE
28 # define DCORE_USE_NAMESPACE
29 #else
30 # define DCORE_BEGIN_NAMESPACE namespace DTK_NAMESPACE { namespace DCORE_NAMESPACE {
31 # define DCORE_END_NAMESPACE }}
32 # define DCORE_USE_NAMESPACE using namespace DTK_CORE_NAMESPACE;
33 #endif
34
35
36 #if defined(DTK_STATIC_LIB)
37 # define LIBDTKCORESHARED_EXPORT
38 #else
39 #if defined(LIBDTKCORE_LIBRARY)
40 # define LIBDTKCORESHARED_EXPORT Q_DECL_EXPORT
41 #else
42 # define LIBDTKCORESHARED_EXPORT Q_DECL_IMPORT
43 #endif
44 #endif
45
46 #ifdef D_DEPRECATED_CHECK
47 #define D_DECL_DEPRECATED_X(text) Q_DECL_HIDDEN
48 #define D_DECL_DEPRECATED Q_DECL_HIDDEN
49 #else
50 #ifdef __GNUC__
51 #if __GNUC__ < 13
52 #define D_DECL_DEPRECATED __attribute__((__deprecated__))
53 #define D_DECL_DEPRECATED_X(text) __attribute__((__deprecated__(text)))
54 #else
55 #define D_DECL_DEPRECATED Q_DECL_DEPRECATED
56 #define D_DECL_DEPRECATED_X Q_DECL_DEPRECATED_X
57 #endif
58 #else
59 #define D_DECL_DEPRECATED Q_DECL_DEPRECATED
60 #define D_DECL_DEPRECATED_X Q_DECL_DEPRECATED_X
61 #endif
62 #endif
63
64 #define DTK_VERSION_CHECK(major, minor, patch, build) ((major<<24)|(minor<<16)|(patch<<8)|build)
65 #define DTK_VERSION DTK_VERSION_CHECK(DTK_VERSION_MAJOR, DTK_VERSION_MINOR, DTK_VERSION_PATCH, DTK_VERSION_BUILD)
66
67 #if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
68 extern "C" {
69 int LIBDTKCORESHARED_EXPORT dtkVersion();
70 const LIBDTKCORESHARED_EXPORT char *dtkVersionString();
71 }
72 #endif