]> granicus.if.org Git - postgresql/commitdiff
Fix configure check for %z printf support after INT64_MODIFIER changes.
authorAndres Freund <andres@anarazel.de>
Thu, 18 Sep 2014 07:59:10 +0000 (09:59 +0200)
committerAndres Freund <andres@anarazel.de>
Thu, 18 Sep 2014 07:59:10 +0000 (09:59 +0200)
The PGAC_FUNC_SNPRINTF_SIZE_T_SUPPORT test was broken by
ce486056ecd28050. Among others it made the UINT64_FORMAT macro to be
defined in c.h, instead of directly being defined by configure.

This lead to the replacement printf being used on all platforms for a
while. Which seems to work, because this was only used due to
different profiles ;)

Fix by relying on INT64_MODIFIER instead.

config/c-library.m4
configure

index 4821a612921322527f75035ffdde8d21545ee015..f40db6a1ee7ad9a165d714a9c69aaf6f1b761bd7 100644 (file)
@@ -327,7 +327,8 @@ int main()
    */
   bufz[0] = '\0';  /* in case snprintf fails to emit anything */
   snprintf(bufz, sizeof(bufz), "%zu", ~((size_t) 0));
-  snprintf(buf64, sizeof(buf64), UINT64_FORMAT, (PG_INT64_TYPE) ~((size_t) 0));
+  snprintf(buf64, sizeof(buf64), "%" INT64_MODIFIER "u",
+    (unsigned PG_INT64_TYPE) ~((size_t) 0));
   if (strcmp(bufz, buf64) != 0)
     return 1;
   return 0;
index 4918f95736e4931cb3b35cc8f1ee69ccdb5a30a5..dac8e49084ec13d4997e9f738909993ec251224e 100755 (executable)
--- a/configure
+++ b/configure
@@ -13201,7 +13201,8 @@ int main()
    */
   bufz[0] = '\0';  /* in case snprintf fails to emit anything */
   snprintf(bufz, sizeof(bufz), "%zu", ~((size_t) 0));
-  snprintf(buf64, sizeof(buf64), UINT64_FORMAT, (PG_INT64_TYPE) ~((size_t) 0));
+  snprintf(buf64, sizeof(buf64), "%" INT64_MODIFIER "u",
+    (unsigned PG_INT64_TYPE) ~((size_t) 0));
   if (strcmp(bufz, buf64) != 0)
     return 1;
   return 0;