diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2020-12-27 10:44:22 +0000 |
---|---|---|
committer | Charles Pigott <charlespigott@googlemail.com> | 2020-12-27 10:55:42 +0000 |
commit | 860c270c73048b4930ac8cbebcd60be746eb9782 (patch) | |
tree | a88a8acb208cf426ae8fac05dda202c57b59426a /src/stdafx.h | |
parent | 395a5d9991b500c681ff384f8d3b4e153e687abb (diff) | |
download | openttd-860c270c73048b4930ac8cbebcd60be746eb9782.tar.xz |
Codechange: Replace assert_compile macro with static_assert
Diffstat (limited to 'src/stdafx.h')
-rw-r--r-- | src/stdafx.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/stdafx.h b/src/stdafx.h index c99d7a277..dca0e6c6f 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -348,14 +348,12 @@ typedef unsigned char byte; # define PERSONAL_DIR "" #endif -#define assert_compile(expr) static_assert(expr, #expr) - /* Check if the types have the bitsizes like we are using them */ -assert_compile(sizeof(uint64) == 8); -assert_compile(sizeof(uint32) == 4); -assert_compile(sizeof(uint16) == 2); -assert_compile(sizeof(uint8) == 1); -assert_compile(SIZE_MAX >= UINT32_MAX); +static_assert(sizeof(uint64) == 8); +static_assert(sizeof(uint32) == 4); +static_assert(sizeof(uint16) == 2); +static_assert(sizeof(uint8) == 1); +static_assert(SIZE_MAX >= UINT32_MAX); #ifndef M_PI_2 #define M_PI_2 1.57079632679489661923 |