Windows patch: dbus/dbus-internals.h

Peter Kümmel syntheticpp at gmx.net
Thu Jul 27 16:32:54 PDT 2006


-------------- next part --------------
Index: dbus/dbus-internals.h
===================================================================
--- dbus/dbus-internals.h       (revision 49)
+++ dbus/dbus-internals.h       (working copy)
@@ -81,9 +81,16 @@
                                ...) _DBUS_GNUC_PRINTF (1, 2);
 void _dbus_verbose_reset_real (void);

-#  define _dbus_verbose _dbus_verbose_real
+#  ifdef HAVE_GNUC_VARARGS
+#    define _dbus_verbose(format, rest...) _dbus_verbose_real("[%s %d] " format, __FUNCTION__,__LINE__, ## rest)
+#  else
+#    define _dbus_verbose _dbus_verbose_real
+#  endif // HAVE_GNUC_VARARGS
+
 #  define _dbus_verbose_reset _dbus_verbose_reset_real
-#else
+
+#else // DBUS_ENABLE_VERBOSE_MODE
+
 #  ifdef HAVE_ISO_VARARGS
 #    define _dbus_verbose(...)
 #  elif defined (HAVE_GNUC_VARARGS)
@@ -281,7 +288,9 @@
 _DBUS_DECLARE_GLOBAL_LOCK (system_users);
 _DBUS_DECLARE_GLOBAL_LOCK (message_cache);
 _DBUS_DECLARE_GLOBAL_LOCK (shared_connections);
-#define _DBUS_N_GLOBAL_LOCKS (11)
+_DBUS_DECLARE_GLOBAL_LOCK (win32_fds);
+_DBUS_DECLARE_GLOBAL_LOCK (sid_atom_cache);
+#define _DBUS_N_GLOBAL_LOCKS (13)

 dbus_bool_t _dbus_threads_init_debug (void);
-------------- next part --------------
relating notes:

> +#ifdef HAVE_GNUC_VARARGS
> +# define _dbus_verbose(format, rest...) _dbus_verbose_real("[%s %d] " format, __FUNCTION__,__LINE__, ## rest)
> +#else
>  #  define _dbus_verbose _dbus_verbose_real
> +#endif
>  #  define _dbus_verbose_reset _dbus_verbose_reset_real
> +
>  #else
> +
>  #  ifdef HAVE_ISO_VARARGS
>  #    define _dbus_verbose(...)


(havoc) This logic looks messed up - "if else end else"

> +#ifdef DBUS_WIN
> +_DBUS_DECLARE_GLOBAL_LOCK (win32_fds);
> +_DBUS_DECLARE_GLOBAL_LOCK (sid_atom_cache);
> +#endif
>  _DBUS_DECLARE_GLOBAL_LOCK (list);
>  _DBUS_DECLARE_GLOBAL_LOCK (connection_slots);
>  _DBUS_DECLARE_GLOBAL_LOCK (pending_call_slots);
> @@ -281,7 +291,11 @@
>  _DBUS_DECLARE_GLOBAL_LOCK (system_users);
>  _DBUS_DECLARE_GLOBAL_LOCK (message_cache);
>  _DBUS_DECLARE_GLOBAL_LOCK (shared_connections);
> +#ifdef DBUS_WIN
> +#define _DBUS_N_GLOBAL_LOCKS (13)
> +#else
>  #define _DBUS_N_GLOBAL_LOCKS (11)
> +#endif

(havoc) I'd just drop the #ifdef here and always have the two windows locks, 
saving a little memory is not worth having platform-specific bugs such a
s wrong N_GLOBAL_LOCKS on only one platform.



changelog entry: 

	* dbus/dbus-internals.h: use more verbose messages when in defined HAVE_GNUC_VARARGS
	* dbus/dbus-internals.h: add two Windows related global locks



More information about the dbus mailing list