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
|
#ifndef ISC_UTIL_H
|
||||||
#define ISC_UTIL_H 1
|
#define ISC_UTIL_H 1
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
/*! \file isc/util.h
|
/*! \file isc/util.h
|
||||||
* NOTE:
|
* NOTE:
|
||||||
*
|
*
|
||||||
@@ -264,7 +266,11 @@ extern void mock_assert(const int result, const char* const expression,
|
|||||||
/*%
|
/*%
|
||||||
* Alignment
|
* Alignment
|
||||||
*/
|
*/
|
||||||
|
#ifdef __GNUC__
|
||||||
#define ISC_ALIGN(x, a) (((x) + (a) - 1) & ~((typeof(x))(a) - 1))
|
#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
|
* Misc
|
||||||
|
|||||||
Reference in New Issue
Block a user