dbus-maybe.h

00001 /* This file contains macros that wrap calls to the purple dbus module.
00002    These macros call the appropriate functions if the build includes
00003    dbus support and do nothing otherwise.  See "dbus-server.h" for
00004    documentation.  */
00005 
00006 #ifndef _PURPLE_DBUS_MAYBE_H_
00007 #define _PURPLE_DBUS_MAYBE_H_
00008 
00009 #ifdef HAVE_DBUS
00010 
00011 #include "dbus-server.h"
00012 
00013 /* this provides a type check */
00014 #define PURPLE_DBUS_REGISTER_POINTER(ptr, type) { \
00015     type *typed_ptr = ptr; \
00016     purple_dbus_register_pointer(typed_ptr, PURPLE_DBUS_TYPE(type));    \
00017 }
00018 #define PURPLE_DBUS_UNREGISTER_POINTER(ptr) purple_dbus_unregister_pointer(ptr)
00019 
00020 #else  /* !HAVE_DBUS */
00021 
00022 #define PURPLE_DBUS_REGISTER_POINTER(ptr, type) 
00023 #define PURPLE_DBUS_UNREGISTER_POINTER(ptr)
00024 #define DBUS_EXPORT
00025 
00026 #endif  /* HAVE_DBUS */
00027 
00028 #endif