diff options
Diffstat (limited to 'src/utils/type.c')
-rw-r--r-- | src/utils/type.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/utils/type.c b/src/utils/type.c index a46be5a..09b9c36 100644 --- a/src/utils/type.c +++ b/src/utils/type.c @@ -1,24 +1,20 @@ #include "type.h" -#include <assert.h> +static_assert(sizeof(bool) == (8 / 8), "Bad size"); -void checkTypes() { - assert(sizeof(bool) == (8 / 8)); +static_assert(sizeof(i8) == (8 / 8), "Bad size"); +static_assert(sizeof(i16) == (16 / 8), "Bad size"); +static_assert(sizeof(i32) == (32 / 8), "Bad size"); +static_assert(sizeof(i64) == (64 / 8), "Bad size"); - assert(sizeof(i8) == (8 / 8)); - assert(sizeof(i16) == (16 / 8)); - assert(sizeof(i32) == (32 / 8)); - assert(sizeof(i64) == (64 / 8)); - - assert(sizeof(u8) == (8 / 8)); - assert(sizeof(u16) == (16 / 8)); - assert(sizeof(u32) == (32 / 8)); - assert(sizeof(u64) == (64 / 8)); +static_assert(sizeof(u8) == (8 / 8), "Bad size"); +static_assert(sizeof(u16) == (16 / 8), "Bad size"); +static_assert(sizeof(u32) == (32 / 8), "Bad size"); +static_assert(sizeof(u64) == (64 / 8), "Bad size"); #ifdef FLOAT_16_SUPPORT - assert(sizeof(f16) == (16 / 8)); +static_assert(sizeof(f16) == (16 / 8), "Bad size"); #endif - assert(sizeof(f32) == (32 / 8)); - assert(sizeof(f64) == (64 / 8)); - assert(sizeof(f128) == (128 / 8)); -} +static_assert(sizeof(f32) == (32 / 8), "Bad size"); +static_assert(sizeof(f64) == (64 / 8), "Bad size"); +static_assert(sizeof(f128) == (128 / 8), "Bad size"); |