From: Hallvard Furuseth Date: Sat, 10 Sep 2011 08:11:55 +0000 (+0200) Subject: Check some mdb integer type assumptions X-Git-Tag: OPENLDAP_REL_ENG_2_4_27~148^2~42^2~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=69e53cf700bcceb5c531384ab97e10c2ecff922a;p=openldap Check some mdb integer type assumptions --- diff --git a/libraries/libmdb/mdb.c b/libraries/libmdb/mdb.c index fb0df164ff..9d925ca684 100644 --- a/libraries/libmdb/mdb.c +++ b/libraries/libmdb/mdb.c @@ -48,6 +48,7 @@ #include #include +#include #include #include #include @@ -63,6 +64,12 @@ #include "mdb.h" #include "midl.h" +#if (__BYTE_ORDER == __LITTLE_ENDIAN) == (__BYTE_ORDER == __BIG_ENDIAN) +# error "Unknown or unsupported endianness (__BYTE_ORDER)" +#elif (-6 & 5) || CHAR_BIT != 8 || UINT_MAX < 0xffffffff || ULONG_MAX % 0xFFFF +# error "Two's complement, reasonably sized integer types, please" +#endif + /** @defgroup internal MDB Internals * @{ */