aboutsummaryrefslogtreecommitdiffstats
path: root/main/dbus/fix-int64-print.patch
blob: 713739df99fad003f77f9aad4763e79e7046b5a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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");
     }