]> Savannah Git Hosting - gnulib.git/commitdiff
inttypes: Fix PRI*PTR and SCN*PTR on 64-bit native Windows.
authorBruno Haible <bruno@clisp.org>
Tue, 21 Jul 2020 07:53:29 +0000 (09:53 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 21 Jul 2020 07:53:29 +0000 (09:53 +0200)
* m4/inttypes.m4 (gl_INTTYPES_PRI_SCN): On 64-bit native Windows, make
sure PRIPTR_PREFIX is defined to "ll", not "l".

ChangeLog
m4/inttypes.m4

index 7ebfe9ebdc136279ea10682f5d8a05981727cb44..654ad7c1ff5af19040c1b8a929fbf5b9e3b045ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-07-21  Bruno Haible  <bruno@clisp.org>
+
+       inttypes: Fix PRI*PTR and SCN*PTR on 64-bit native Windows.
+       * m4/inttypes.m4 (gl_INTTYPES_PRI_SCN): On 64-bit native Windows, make
+       sure PRIPTR_PREFIX is defined to "ll", not "l".
+
 2020-07-21  Bruno Haible  <bruno@clisp.org>
 
        printf-posix: Make an autoconf test more future-proof.
index 224d0cdd8e244919c8b34b82f7917af5ffc4c68d..f9f5f86e0f7c8fa8438cbadd0027c39290ecb21d 100644 (file)
@@ -1,4 +1,4 @@
-# inttypes.m4 serial 29
+# inttypes.m4 serial 30
 dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -39,8 +39,17 @@ AC_DEFUN([gl_INTTYPES_PRI_SCN],
 
   PRIPTR_PREFIX=
   if test -n "$STDINT_H"; then
-    dnl Using the gnulib <stdint.h>. It always defines intptr_t to 'long'.
-    PRIPTR_PREFIX='"l"'
+    dnl Using the gnulib <stdint.h>. It defines intptr_t to 'long' or
+    dnl 'long long', depending on _WIN64.
+    AC_COMPILE_IFELSE(
+      [AC_LANG_PROGRAM([[
+         #ifdef _WIN64
+         LLP64
+         #endif
+         ]]),
+      ],
+      [PRIPTR_PREFIX='"l"'],
+      [PRIPTR_PREFIX='"ll"'])
   else
     dnl Using the system's <stdint.h>.
     for glpfx in '' l ll I64; do