]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
configure: Fix __builtin_mul_overflow() compiler support check
authorArjun Shankar <arjun@redhat.com>
Tue, 2 May 2023 11:58:18 +0000 (13:58 +0200)
committerOndřej Surý <ondrej@isc.org>
Tue, 2 May 2023 13:48:26 +0000 (15:48 +0200)
`UINT64_C(UINT64_MAX)' is redundant and leads to a compilation error
since UINT64_C involves token concatenation, causing the check to fail.

This change fixes that by using UINT64_MAX directly, and including the
appropriate header.

Signed-off-by: Arjun Shankar <arjun@redhat.com>
configure.ac

index e7f59f8e6d8ac0a49420459b429b25eba36b7d04..7b6446a1abe005f229f100def54bfb55281e9c82 100644 (file)
@@ -1247,8 +1247,10 @@ AC_LINK_IFELSE(
 AC_MSG_CHECKING([compiler support for __builtin_mul_overflow()])
 AC_LINK_IFELSE(
   [AC_LANG_PROGRAM(
-     [[#include <limits.h>]],
-     [[return (__builtin_mul_overflow(UINT64_C(UINT64_MAX), UINT64_C(UINT64_MAX), &(uint64_t){ 0 }));]]
+     [[#include <limits.h>
+       #include <stdint.h>
+     ]],
+     [[return (__builtin_mul_overflow(UINT64_MAX, UINT64_MAX, &(uint64_t){ 0 }));]]
    )],
   [AC_MSG_RESULT([yes])
    AC_DEFINE([HAVE_BUILTIN_MUL_OVERFLOW], [1], [define if the compiler supports __builtin_mul_overflow().])