blob: a4e92da34b26b6eee9493accbcc268575aba6e22 [file] [log] [blame]
Andrew Geisslerc926e172021-05-07 16:11:35 -05001From 3d7cde654c4c6f3bdad32f5521f28f5802a7c377 Mon Sep 17 00:00:00 2001
2From: Christoph Reiter <reiter.christoph@gmail.com>
3Date: Fri, 24 Aug 2018 21:46:47 +0200
4Subject: [PATCH] autotools: use C99 printf format specifiers on Windows. Fixes
5 #1497
6
7Since we now require a C99 compatible printf and use gnulib on Windows,
8we also mark our printf functions as gnu_printf. GCC complains about the
9Windows specific I64 specifiers we still write to glibconfig.h with the
10autotools build.
11
12To fix this switch all I64(x) to ll(x).
13
14This also makes the glibconfig.h output for those macros match the ones
15we get when using meson.
16
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18Upstream-Status: Backport [https://github.com/GNOME/glib/commit/3d7cde654c]
19---
20 configure.ac | 18 +++++++++---------
21 1 file changed, 9 insertions(+), 9 deletions(-)
22
23--- a/glib/configure.ac
24+++ b/glib/configure.ac
25@@ -576,7 +576,7 @@ AS_IF([test x$ac_cv_sizeof_long_long = x
26 # long long is a 64 bit integer.
27 AC_MSG_CHECKING(for format to printf and scanf a guint64)
28 AC_CACHE_VAL(glib_cv_long_long_format,[
29- for format in ll q I64; do
30+ for format in ll q; do
31 AC_TRY_RUN([#include <stdio.h>
32 int main()
33 {
34@@ -2995,8 +2995,8 @@ long)
35 glib_msize_type='LONG'
36 ;;
37 "long long")
38- gsize_modifier='"I64"'
39- gsize_format='"I64u"'
40+ gsize_modifier='"ll"'
41+ gsize_format='"llu"'
42 glib_msize_type='INT64'
43 ;;
44 esac
45@@ -3018,8 +3018,8 @@ long)
46 glib_mssize_type='LONG'
47 ;;
48 "long long")
49- gssize_modifier='"I64"'
50- gssize_format='"I64i"'
51+ gssize_modifier='"ll"'
52+ gssize_format='"lli"'
53 glib_mssize_type='INT64'
54 ;;
55 esac
56@@ -3048,9 +3048,9 @@ $ac_cv_sizeof_long)
57 ;;
58 $ac_cv_sizeof_long_long)
59 glib_intptr_type_define='long long'
60- gintptr_modifier='"I64"'
61- gintptr_format='"I64i"'
62- guintptr_format='"I64u"'
63+ gintptr_modifier='"ll"'
64+ gintptr_format='"lli"'
65+ guintptr_format='"llu"'
66 glib_gpi_cast='(gint64)'
67 glib_gpui_cast='(guint64)'
68 ;;