From 2e40cc94dc5ed7753c7e8a3ff128d60dbb4e3e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 18 Apr 2019 11:49:10 +0200 Subject: [PATCH] On non-GNUC systems, use uintmax_t in the ISC_ALIGN macro --- lib/isc/include/isc/util.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/isc/include/isc/util.h b/lib/isc/include/isc/util.h index b16b024e74..53b31f1f74 100644 --- a/lib/isc/include/isc/util.h +++ b/lib/isc/include/isc/util.h @@ -12,6 +12,8 @@ #ifndef ISC_UTIL_H #define ISC_UTIL_H 1 +#include + /*! \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