From 3d7cde654c4c6f3bdad32f5521f28f5802a7c377 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 24 Aug 2018 21:46:47 +0200 Subject: [PATCH] autotools: use C99 printf format specifiers on Windows. Fixes #1497 Since we now require a C99 compatible printf and use gnulib on Windows, we also mark our printf functions as gnu_printf. GCC complains about the Windows specific I64 specifiers we still write to glibconfig.h with the autotools build. To fix this switch all I64(x) to ll(x). This also makes the glibconfig.h output for those macros match the ones we get when using meson. --- configure.ac | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index cc4e017fc..fea9083d6 100644 --- a/configure.ac +++ b/configure.ac @@ -142,7 +142,7 @@ case "$host" in case "$host" in x86_64-*-*) LIB_EXE_MACHINE_FLAG=X64 - glib_pollfd_format='%#I64x' + glib_pollfd_format='%#llx' ;; esac @@ -514,7 +514,7 @@ AS_IF([test x$ac_cv_sizeof_long_long = x8], [ # long long is a 64 bit integer. AC_MSG_CHECKING(for format to printf and scanf a guint64) AC_CACHE_VAL(glib_cv_long_long_format,[ - for format in ll q I64; do + for format in ll q; do AC_TRY_RUN([#include int main() { @@ -3096,8 +3096,8 @@ long) glib_msize_type='LONG' ;; "long long") - gsize_modifier='"I64"' - gsize_format='"I64u"' + gsize_modifier='"ll"' + gsize_format='"llu"' glib_msize_type='INT64' ;; esac @@ -3119,8 +3119,8 @@ long) glib_mssize_type='LONG' ;; "long long") - gssize_modifier='"I64"' - gssize_format='"I64i"' + gssize_modifier='"ll"' + gssize_format='"lli"' glib_mssize_type='INT64' ;; esac @@ -3149,9 +3149,9 @@ $ac_cv_sizeof_long) ;; $ac_cv_sizeof_long_long) glib_intptr_type_define='long long' - gintptr_modifier='"I64"' - gintptr_format='"I64i"' - guintptr_format='"I64u"' + gintptr_modifier='"ll"' + gintptr_format='"lli"' + guintptr_format='"llu"' glib_gpi_cast='(gint64)' glib_gpui_cast='(guint64)' ;;