diff options
Diffstat (limited to 'main/dbus/fix-int64-print.patch')
-rw-r--r-- | main/dbus/fix-int64-print.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/main/dbus/fix-int64-print.patch b/main/dbus/fix-int64-print.patch new file mode 100644 index 0000000000..713739df99 --- /dev/null +++ b/main/dbus/fix-int64-print.patch @@ -0,0 +1,56 @@ +diff --git a/dbus/dbus-marshal-basic.c b/dbus/dbus-marshal-basic.c +index 74fe3f9..9315b6e 100644 +--- a/dbus/dbus-marshal-basic.c ++++ b/dbus/dbus-marshal-basic.c +@@ -29,6 +29,10 @@ + + #include <string.h> + ++#if !defined(PRIx64) && defined(DBUS_WIN) ++#define PRIx64 "%I64x" ++#endif ++ + #if defined(__GNUC__) && (__GNUC__ >= 4) + # define _DBUS_ASSERT_ALIGNMENT(type, op, val) \ + _DBUS_STATIC_ASSERT (__extension__ __alignof__ (type) op val) +@@ -1334,10 +1338,8 @@ _dbus_verbose_bytes (const unsigned char *data, + if (i > 7 && + _DBUS_ALIGN_ADDRESS (&data[i], 8) == &data[i]) + { +-#ifdef DBUS_INT64_PRINTF_MODIFIER +- _dbus_verbose (" u64: 0x%" DBUS_INT64_PRINTF_MODIFIER "x", ++ _dbus_verbose (" u64: 0x%" PRIx64, + *(dbus_uint64_t*)&data[i-8]); +-#endif + _dbus_verbose (" dbl: %g", + *(double*)&data[i-8]); + } +diff --git a/dbus/dbus-marshal-recursive-util.c b/dbus/dbus-marshal-recursive-util.c +index 3bc26a8..4d57f49 100644 +--- a/dbus/dbus-marshal-recursive-util.c ++++ b/dbus/dbus-marshal-recursive-util.c +@@ -31,6 +31,10 @@ + #include "dbus-internals.h" + #include <string.h> + ++#if !defined(PRIx64) && defined(DBUS_WIN) ++#define PRIx64 "%I64x" ++#endif ++ + static void + basic_value_zero (DBusBasicValue *value) + { +@@ -2644,12 +2648,10 @@ double_read_value (TestTypeNode *node, + + if (!_DBUS_DOUBLES_BITWISE_EQUAL (v, expected)) + { +-#ifdef DBUS_INT64_PRINTF_MODIFIER +- _dbus_warn ("Expected double %g got %g\n bits = 0x%" DBUS_INT64_PRINTF_MODIFIER "x vs.\n bits = 0x%" DBUS_INT64_PRINTF_MODIFIER "x)\n", ++ _dbus_warn ("Expected double %g got %g\n bits = 0x%" PRIx64 " vs.\n bits = 0x%" PRIx64 ")\n", + expected, v, + *(dbus_uint64_t*)(char*)&expected, + *(dbus_uint64_t*)(char*)&v); +-#endif + _dbus_assert_not_reached ("test failed"); + } + |