]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
On non-GNUC systems, use uintmax_t in the ISC_ALIGN macro
authorOndřej Surý <ondrej@sury.org>
Thu, 18 Apr 2019 09:49:10 +0000 (11:49 +0200)
committerOndřej Surý <ondrej@sury.org>
Thu, 18 Apr 2019 10:55:25 +0000 (12:55 +0200)
lib/isc/include/isc/util.h

index b16b024e74ceec1c6e53b3a2ea9e8f3d63618257..53b31f1f74f28832efbc4ee416a1fa53716dd08a 100644 (file)
@@ -12,6 +12,8 @@
 #ifndef ISC_UTIL_H
 #define ISC_UTIL_H 1
 
+#include <inttypes.h>
+
 /*! \file isc/util.h
  * NOTE:
  *
@@ -264,7 +266,11 @@ extern void mock_assert(const int result, const char* const expression,
 /*%
  * Alignment
  */
-#define ISC_ALIGN(x, a) (((x) + (a) - 1) & ~((typeof(x))(a)-1))
+#ifdef __GNUC__
+#define ISC_ALIGN(x, a) (((x) + (a) - 1) & ~((typeof(x))(a) - 1))
+#else
+#define ISC_ALIGN(x, a) (((x) + (a) - 1) & ~((uintmax_t)(a) - 1))
+#endif
 
 /*%
  * Misc