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 #ifndef DBUS_API_SUBJECT_TO_CHANGE
00012 #define DBUS_API_SUBJECT_TO_CHANGE
00013 #endif
00014 
00015 #include "dbus-server.h"
00016 
00017 /* this provides a type check */
00018 #define PURPLE_DBUS_REGISTER_POINTER(ptr, type) { \
00019     type *typed_ptr = ptr; \
00020     purple_dbus_register_pointer(typed_ptr, PURPLE_DBUS_TYPE(type));    \
00021 }
00022 #define PURPLE_DBUS_UNREGISTER_POINTER(ptr) purple_dbus_unregister_pointer(ptr)
00023 
00024 #else  /* !HAVE_DBUS */
00025 
00026 #define PURPLE_DBUS_REGISTER_POINTER(ptr, type) { \
00027     if (ptr) {} \
00028 }
00029 
00030 #define PURPLE_DBUS_UNREGISTER_POINTER(ptr)
00031 #define DBUS_EXPORT
00032 
00033 #endif  /* HAVE_DBUS */
00034 
00035 #endif