summaryrefslogtreecommitdiffstats
path: root/tests/auto/dbus
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-05-06 23:41:14 -0700
committerThiago Macieira <thiago.macieira@intel.com>2016-05-09 05:30:43 +0000
commit8de2986a42ff452d2ca7f28d23ce1156be326b62 (patch)
tree1bc34c70fe224fa146c95452be02a1d459361e61 /tests/auto/dbus
parent558718ff4406638410364db7c1310cb38963d6df (diff)
tst_QDBusMarshall: make sure we compile on linked, old dbus
If we're linking to libdbus-1, qdbus_symbols_p.h #includes dbus/dbus.h, which may be old and not #define the Unix FD macros. tst_QDBusMarshall had the definition for one of the macros but not the other, so add the missing second one. Change-Id: Id69569111e7d4e619e22ffff144c35edcd6f348b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'tests/auto/dbus')
-rw-r--r--tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
index 57fd5084be..b628738fe3 100644
--- a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
+++ b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp
@@ -41,6 +41,11 @@
#include <QtDBus/private/qdbusconnection_p.h>
#include <QtDBus/private/qdbus_symbols_p.h>
+#ifndef DBUS_TYPE_UNIX_FD
+# define DBUS_TYPE_UNIX_FD int('h')
+# define DBUS_TYPE_UNIX_FD_AS_STRING "h"
+#endif
+
static const char serviceName[] = "org.qtproject.autotests.qpong";
static const char objectPath[] = "/org/qtproject/qpong";
static const char *interfaceName = serviceName;
@@ -1088,9 +1093,6 @@ static bool canSendUnixFd(DBusConnection *connection)
can_send_type = (can_send_type_t)qdbus_resolve_conditionally("dbus_connection_can_send_type");
#endif
-#ifndef DBUS_TYPE_UNIX_FD
-# define DBUS_TYPE_UNIX_FD int('h')
-#endif
return can_send_type && can_send_type(connection, DBUS_TYPE_UNIX_FD);
}