On non-GNUC systems, use uintmax_t in the ISC_ALIGN macro
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user