pidgin 2.14.14dev
dbus-maybe.h
1/* This file contains macros that wrap calls to the purple dbus module.
2 These macros call the appropriate functions if the build includes
3 dbus support and do nothing otherwise. See "dbus-server.h" for
4 documentation. */
5
6#ifndef _PURPLE_DBUS_MAYBE_H_
7#define _PURPLE_DBUS_MAYBE_H_
8
9#ifdef HAVE_DBUS
10
11#ifndef DBUS_API_SUBJECT_TO_CHANGE
12#define DBUS_API_SUBJECT_TO_CHANGE
13#endif
14
15#include "dbus-server.h"
16
17/* this provides a type check */
18#define PURPLE_DBUS_REGISTER_POINTER(ptr, type) { \
19 type *typed_ptr = ptr; \
20 purple_dbus_register_pointer(typed_ptr, PURPLE_DBUS_TYPE(type)); \
21}
22#define PURPLE_DBUS_UNREGISTER_POINTER(ptr) purple_dbus_unregister_pointer(ptr)
23
24#else /* !HAVE_DBUS */
25
26#define PURPLE_DBUS_REGISTER_POINTER(ptr, type) { \
27 if (ptr) {} \
28}
29
30#define PURPLE_DBUS_UNREGISTER_POINTER(ptr)
31#define DBUS_EXPORT
32
33#endif /* HAVE_DBUS */
34
35#endif
Purple DBUS Server.