Blob Blame History Raw
diff --git a/config.h.in b/config.h.in
index f01f64a..45309d0 100644
--- a/config.h.in
+++ b/config.h.in
@@ -54,5 +54,8 @@
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
+/* The size of `size_t', as computed by sizeof. */
+#undef SIZEOF_SIZE_T
+
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
diff --git a/configure.ac b/configure.ac
index 1feb7dd..79ffc2a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,6 +10,7 @@ AC_PROG_CC
 AC_PROG_CXX
 AC_CHECK_HEADERS([lzma.h])
 AC_CHECK_LIB(lzma, lzma_easy_buffer_encode)
+AC_CHECK_SIZEOF(size_t)
 #AM_PATH_PYTHON(,, [:])
 #AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
 #AX_PYTHON_DEVEL()
diff --git a/xdelta3-main.h b/xdelta3-main.h
index fcef08d..8d32938 100644
--- a/xdelta3-main.h
+++ b/xdelta3-main.h
@@ -352,7 +352,8 @@ xprintf (const char *fmt, ...)
   if (xprintf_message_func != NULL) {
     xprintf_message_func(buf);
   } else {
-    fwrite(buf, 1, size, stderr);
+    size_t ignore = fwrite(buf, 1, size, stderr);
+    (void) ignore;
   }
 }
 
diff --git a/xdelta3.h b/xdelta3.h
index 9c42318..e4d02b6 100644
--- a/xdelta3.h
+++ b/xdelta3.h
@@ -157,7 +157,11 @@ typedef uint64_t xoff_t;
 #define SIZEOF_XOFF_T 8
 #define SIZEOF_USIZE_T 4
 #ifndef WIN32
+#if SIZEOF_SIZE_T == 8
+#define Q "z"
+#else
 #define Q "ll"
+#endif
 #else
 #define Q "I64"
 #endif