m Change ASSERT_STATIC_EXPR_ZERO template arg type to bool

This commit is contained in:
Behdad Esfahbod 2020-06-29 00:34:07 -07:00
parent 1981d83d7f
commit 59cfffb1af
1 changed files with 3 additions and 3 deletions

View File

@ -442,9 +442,9 @@ static int HB_UNUSED _hb_errno = 0;
#define HB_STMT_END while (0) #define HB_STMT_END while (0)
/* Static-assert as expression. */ /* Static-assert as expression. */
template <unsigned int cond> class hb_assert_constant_t; template <bool cond> class hb_assert_constant_t;
template <> class hb_assert_constant_t<1> {}; template <> class hb_assert_constant_t<true> {};
#define ASSERT_STATIC_EXPR_ZERO(_cond) (0 * (unsigned int) sizeof (hb_assert_constant_t<_cond>)) #define ASSERT_STATIC_EXPR_ZERO(_cond) (0u * (unsigned int) sizeof (hb_assert_constant_t<_cond>))
/* Lets assert int types. Saves trouble down the road. */ /* Lets assert int types. Saves trouble down the road. */
static_assert ((sizeof (int8_t) == 1), ""); static_assert ((sizeof (int8_t) == 1), "");