From 690e4f1d549e6e3dca85da8b0e369595f8e48472 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 13 Feb 2018 19:44:14 -0600 Subject: [PATCH] Add static_assert size checks to types.hpp (synced from 7e31eda638a1520045572465891e4e998baac175) --- src/ox/std/types.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ox/std/types.hpp b/src/ox/std/types.hpp index ee12eba9f..7c768d58d 100644 --- a/src/ox/std/types.hpp +++ b/src/ox/std/types.hpp @@ -27,6 +27,15 @@ typedef int64_t intmax_t; typedef uint64_t uintmax_t; #endif +static_assert(sizeof(int8_t) == 1, "int8_t is wrong size"); +static_assert(sizeof(int16_t) == 2, "int16_t is wrong size"); +static_assert(sizeof(int32_t) == 4, "int32_t is wrong size"); +static_assert(sizeof(int64_t) == 8, "int64_t is wrong size"); + +static_assert(sizeof(uint8_t) == 1, "uint8_t is wrong size"); +static_assert(sizeof(uint16_t) == 2, "uint16_t is wrong size"); +static_assert(sizeof(uint32_t) == 4, "uint32_t is wrong size"); +static_assert(sizeof(uint64_t) == 8, "uint64_t is wrong size"); namespace ox {