DtkCore
DTK Core module
载入中...
搜索中...
未找到
dtkcore_global.h
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# define D_IGNORE_DEPRECATIONS
39#else
40#if defined(LIBDTKCORE_LIBRARY)
41# define LIBDTKCORESHARED_EXPORT Q_DECL_EXPORT
42# define D_IGNORE_DEPRECATIONS
43#else
44# define LIBDTKCORESHARED_EXPORT Q_DECL_IMPORT
45#endif
46#endif
47
48#ifdef D_DEPRECATED_CHECK
49#define D_DECL_DEPRECATED_X(text) Q_DECL_HIDDEN
50#define D_DECL_DEPRECATED Q_DECL_HIDDEN
51#else
52#if defined(D_IGNORE_DEPRECATIONS)
53#define D_DECL_DEPRECATED
54#define D_DECL_DEPRECATED_X(text)
55#else
56#ifdef __GNUC__
57#if __GNUC__ < 13
58#define D_DECL_DEPRECATED __attribute__((__deprecated__))
59#define D_DECL_DEPRECATED_X(text) __attribute__((__deprecated__(text)))
60#else
61#define D_DECL_DEPRECATED Q_DECL_DEPRECATED
62#define D_DECL_DEPRECATED_X Q_DECL_DEPRECATED_X
63#endif
64#else
65#define D_DECL_DEPRECATED Q_DECL_DEPRECATED
66#define D_DECL_DEPRECATED_X Q_DECL_DEPRECATED_X
67#endif
68#endif
69#endif
70
71#define DTK_VERSION_CHECK(major, minor, patch, build) ((major<<24)|(minor<<16)|(patch<<8)|build)
72#define DTK_VERSION DTK_VERSION_CHECK(DTK_VERSION_MAJOR, DTK_VERSION_MINOR, DTK_VERSION_PATCH, DTK_VERSION_BUILD)
73
74#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
75extern "C" {
76int LIBDTKCORESHARED_EXPORT dtkVersion();
77const LIBDTKCORESHARED_EXPORT char *dtkVersionString();
78}
79#endif