Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/EionRobb/skype4pidgin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Pöschel <github@basicmaster.de>2018-09-09 03:27:06 +0300
committerStefan Pöschel <github@basicmaster.de>2018-09-09 03:27:06 +0300
commit0603c20bddfad34d654e021b882d21b5f74507ca (patch)
tree7c88864693881a439f7715403941ad28aa63f9a5
parentb7bdd75e9967279489669f78ac141d3915b8eafb (diff)
Add MinGW32 printf %zu workaround
-rw-r--r--skypeweb/libskypeweb.h12
-rw-r--r--skypeweb/skypeweb_contacts.c2
2 files changed, 13 insertions, 1 deletions
diff --git a/skypeweb/libskypeweb.h b/skypeweb/libskypeweb.h
index e38739d..190a8c5 100644
--- a/skypeweb/libskypeweb.h
+++ b/skypeweb/libskypeweb.h
@@ -28,6 +28,7 @@
#include <glib.h>
+#include <inttypes.h>
#include <errno.h>
#include <string.h>
#include <glib/gi18n.h>
@@ -45,6 +46,17 @@
# endif /* __GNUC__ >= 4 */
#endif /* G_GNUC_NULL_TERMINATED */
+// workaround for MinGW32 which doesn't support "%zu"; see also https://stackoverflow.com/a/44383330
+#ifdef _WIN32
+# ifdef _WIN64
+# define PRI_SIZET PRIu64
+# else
+# define PRI_SIZET PRIu32
+# endif
+#else
+# define PRI_SIZET "zu"
+#endif
+
#include "purplecompat.h"
#ifdef _WIN32
diff --git a/skypeweb/skypeweb_contacts.c b/skypeweb/skypeweb_contacts.c
index 36aa53f..eb0cbd2 100644
--- a/skypeweb/skypeweb_contacts.c
+++ b/skypeweb/skypeweb_contacts.c
@@ -616,7 +616,7 @@ skypeweb_xfer_send_contents_reader(PurpleHttpConnection *con, gchar *buf, size_t
PurpleXfer *xfer = swft->xfer;
gsize read;
- purple_debug_info("skypeweb", "Asked %zu bytes from offset %zu\n", len, offset);
+ purple_debug_info("skypeweb", "Asked %" PRI_SIZET " bytes from offset %" PRI_SIZET "\n", len, offset);
purple_xfer_set_bytes_sent(xfer, offset);
read = purple_xfer_read_file(xfer, (guchar *)buf, len);
purple_debug_info("skypeweb", "Read %" G_GSIZE_FORMAT " bytes\n", read);