From 69e53cf700bcceb5c531384ab97e10c2ecff922a Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Sat, 10 Sep 2011 10:11:55 +0200 Subject: [PATCH] Check some mdb integer type assumptions --- libraries/libmdb/mdb.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 * @{ */ -- 2.39.5