]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Workaround the compile failure on macOS
authorOndřej Surý <ondrej@sury.org>
Tue, 26 Aug 2025 04:53:27 +0000 (06:53 +0200)
committerOndřej Surý <ondrej@sury.org>
Tue, 26 Aug 2025 04:53:27 +0000 (06:53 +0200)
The following check:

    __builtin_types_compatible_p(size_t, uint64_t)

doesn't work with default compiler on macOS.  Workaround the issue
by typing the size_t to matching unsigned int type.

lib/isc/include/isc/bit.h

index 0ef6a69c9026221e26292c2667cdbe154306247a..0a39c29eafb2ca10dd74ee1bec5798cbcc151e15 100644 (file)
        })
 
 #if SIZE_MAX == UINT64_MAX
-#define ISC_ROTATE_LEFTSIZE(x, n)  ISC_ROTATE_LEFT64(x, n)
-#define ISC_ROTATE_RIGHTSIZE(x, n) ISC_ROTATE_RIGHT64(x, n)
+#define ISC_ROTATE_LEFTSIZE(x, n)  ISC_ROTATE_LEFT64((uint64_t)x, n)
+#define ISC_ROTATE_RIGHTSIZE(x, n) ISC_ROTATE_RIGHT64((uint64_t)x, n)
 #elif SIZE_MAX == UINT32_MAX
-#define ISC_ROTATE_LEFTSIZE(x, n)  ISC_ROTATE_LEFT32(x, n)
-#define ISC_ROTATE_RIGHTSIZE(x, n) ISC_ROTATE_RIGHT32(x, n)
+#define ISC_ROTATE_LEFTSIZE(x, n)  ISC_ROTATE_LEFT32((uint32_t)x, n)
+#define ISC_ROTATE_RIGHTSIZE(x, n) ISC_ROTATE_RIGHT32((uint32_t)x, n)
 #else
 #error "size_t must be either 32 or 64-bits"
 #endif