Fix build failure if build with checks but without asserts
authorChengwei Yang <chengwei.yang@intel.com>
Tue, 25 Jun 2013 03:34:11 +0000 (11:34 +0800)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 25 Jun 2013 11:26:04 +0000 (12:26 +0100)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=65990
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
dbus/dbus-connection.c
dbus/dbus-message.c

index 5c732e2..efc1cfb 100644 (file)
@@ -336,8 +336,8 @@ struct DBusConnection
 #ifndef DBUS_DISABLE_CHECKS
   unsigned int have_connection_lock : 1; /**< Used to check locking */
 #endif
-  
-#ifndef DBUS_DISABLE_CHECKS
+
+#if !defined(DBUS_DISABLE_CHECKS) || !defined(DBUS_DISABLE_ASSERT)
   int generation; /**< _dbus_current_generation that should correspond to this connection */
 #endif 
 };
@@ -1354,7 +1354,7 @@ _dbus_connection_new_for_transport (DBusTransport *transport)
   connection->disconnected_message_arrived = FALSE;
   connection->disconnected_message_processed = FALSE;
   
-#ifndef DBUS_DISABLE_CHECKS
+#if !defined(DBUS_DISABLE_CHECKS) || !defined(DBUS_DISABLE_ASSERT)
   connection->generation = _dbus_current_generation;
 #endif
   
index 696991f..01dcaa8 100644 (file)
@@ -777,6 +777,12 @@ _dbus_message_iter_check (DBusMessageRealIter *iter)
 
   return TRUE;
 }
+#else
+static dbus_bool_t
+_dbus_message_iter_check (DBusMessageRealIter *iter)
+{
+  return TRUE;
+}
 #endif /* DBUS_DISABLE_CHECKS */
 
 /**