From 6fd5364bdc3a2b459175377e9e16c86cff054232 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 11 Apr 2011 11:47:14 -0400 Subject: [PATCH] Assert int types --- src/hb-private.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/hb-private.h b/src/hb-private.h index 9f4f8b7d7..eecb4419f 100644 --- a/src/hb-private.h +++ b/src/hb-private.h @@ -79,6 +79,18 @@ HB_BEGIN_DECLS #define ASSERT_STATIC(_cond) _ASSERT_STATIC0 (__LINE__, (_cond)) +/* Lets assert int types. Saves trouble down the road. */ + +ASSERT_STATIC (sizeof (int8_t) == 1); +ASSERT_STATIC (sizeof (uint8_t) == 1); +ASSERT_STATIC (sizeof (int16_t) == 2); +ASSERT_STATIC (sizeof (uint16_t) == 2); +ASSERT_STATIC (sizeof (int32_t) == 4); +ASSERT_STATIC (sizeof (uint32_t) == 4); +ASSERT_STATIC (sizeof (int64_t) == 8); +ASSERT_STATIC (sizeof (uint64_t) == 8); + + /* Misc */