D-Bus 1.16.4
dbus-macros-internal.h
1/*
2 * Copyright © 2010-2015 Ralf Habacker
3 * Copyright © 2015-2019 Collabora Ltd.
4 *
5 * SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
6 *
7 * Licensed under the Academic Free License version 2.1
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
23#ifdef DBUS_INSIDE_DBUS_H
24#error "You can't include dbus-macros-internal.h in the public header dbus.h"
25#endif
26
27#ifndef DBUS_MACROS_INTERNAL_H
28#define DBUS_MACROS_INTERNAL_H
29
30#include <dbus/dbus-macros.h>
31
32#if defined(__clang__)
33# define DBUS_BEGIN_IGNORE_DEPRECATIONS \
34 _Pragma("clang diagnostic push") \
35 _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
36# define DBUS_END_IGNORE_DEPRECATIONS \
37 _Pragma("clang diagnostic pop")
38#elif __GNUC__ >= 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
39# define DBUS_BEGIN_IGNORE_DEPRECATIONS \
40 _Pragma("GCC diagnostic push") \
41 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
42# define DBUS_END_IGNORE_DEPRECATIONS \
43 _Pragma("GCC diagnostic pop")
44#else
45# define DBUS_BEGIN_IGNORE_DEPRECATIONS /* nothing */
46# define DBUS_END_IGNORE_DEPRECATIONS /* nothing */
47#endif
48
49#ifdef DBUS_ENABLE_INTRUSIVE_TESTS
50# define DBUS_INTRUSIVE_TESTS_EXPORT DBUS_PRIVATE_EXPORT
51#else
52# define DBUS_INTRUSIVE_TESTS_EXPORT /* nothing */
53#endif
54#define DBUS_EMBEDDED_TESTS_EXPORT DBUS_INTRUSIVE_TESTS_EXPORT
55
56#if defined(DBUS_PRIVATE_EXPORT)
57 /* value forced by compiler command line, don't redefine */
58#elif defined(_WIN32)
59# if defined(DBUS_STATIC_BUILD)
60# define DBUS_PRIVATE_EXPORT /* no decoration */
61# elif defined(dbus_1_EXPORTS)
62# define DBUS_PRIVATE_EXPORT __declspec(dllexport)
63# else
64# define DBUS_PRIVATE_EXPORT __declspec(dllimport)
65# endif
66#elif defined(__GNUC__) && __GNUC__ >= 4
67# define DBUS_PRIVATE_EXPORT __attribute__ ((__visibility__ ("default")))
68#else
69# define DBUS_PRIVATE_EXPORT /* no decoration */
70#endif
71
72#endif