DtkCore
DTK Core module
dtkcore_global.h
1/*
2 * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20#include <QtCore/qglobal.h>
21#include <dtkcore_config.h>
22
23#define DTK_NAMESPACE Dtk
24
25#if !defined(DTK_NAMESPACE)
26# define DTK_BEGIN_NAMESPACE
27# define DTK_END_NAMESPACE
28# define DTK_USE_NAMESPACE
29#else
30# define DTK_BEGIN_NAMESPACE namespace DTK_NAMESPACE {
31# define DTK_END_NAMESPACE }
32# define DTK_USE_NAMESPACE using namespace DTK_NAMESPACE;
33#endif
34
35#define DCORE_NAMESPACE Core
36#define DTK_CORE_NAMESPACE DTK_NAMESPACE::DCORE_NAMESPACE
37
38#if !defined(DCORE_NAMESPACE)
39# define DCORE_BEGIN_NAMESPACE
40# define DCORE_END_NAMESPACE
41# define DCORE_USE_NAMESPACE
42#else
43# define DCORE_BEGIN_NAMESPACE namespace DTK_NAMESPACE { namespace DCORE_NAMESPACE {
44# define DCORE_END_NAMESPACE }}
45# define DCORE_USE_NAMESPACE using namespace DTK_CORE_NAMESPACE;
46#endif
47
48
49#if defined(DTK_STATIC_LIB)
50# define LIBDTKCORESHARED_EXPORT
51#else
52#if defined(LIBDTKCORE_LIBRARY)
53# define LIBDTKCORESHARED_EXPORT Q_DECL_EXPORT
54#else
55# define LIBDTKCORESHARED_EXPORT Q_DECL_IMPORT
56#endif
57#endif
58
59#ifdef D_DEPRECATED_CHECK
60#define D_DECL_DEPRECATED_X(text) Q_DECL_HIDDEN
61#define D_DECL_DEPRECATED Q_DECL_HIDDEN
62#else
63#define D_DECL_DEPRECATED Q_DECL_DEPRECATED
64#define D_DECL_DEPRECATED_X Q_DECL_DEPRECATED_X
65#endif
66
67#define DTK_VERSION_CHECK(major, minor, patch, build) ((major<<24)|(minor<<16)|(patch<<8)|build)
68#define DTK_VERSION DTK_VERSION_CHECK(DTK_VERSION_MAJOR, DTK_VERSION_MINOR, DTK_VERSION_PATCH, DTK_VERSION_BUILD)
69
70extern "C" {
71int LIBDTKCORESHARED_EXPORT dtkVersion();
72const LIBDTKCORESHARED_EXPORT char *dtkVersionString();
73}