Clang doesn't define the __${FOO}_WIDTH__ preprocessor defines, breaking the build for, at least, the ARM target. Switch over to use __SIZEOF_${FOO}__ instead which both, gcc and Clang do define accordingly. Signed-off-by: Mathias Krause --- lib/limits.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/limits.h b/lib/limits.h index 650085c68e5d..5106e73dd5a2 100644 --- a/lib/limits.h +++ b/lib/limits.h @@ -12,29 +12,29 @@ # endif #endif -#if __SHRT_WIDTH__ == 16 +#if __SIZEOF_SHORT__ == 2 # define SHRT_MAX __INT16_MAX__ # define SHRT_MIN (-SHRT_MAX - 1) # define USHRT_MAX __UINT16_MAX__ #endif -#if __INT_WIDTH__ == 32 +#if __SIZEOF_INT__ == 4 # define INT_MAX __INT32_MAX__ # define INT_MIN (-INT_MAX - 1) # define UINT_MAX __UINT32_MAX__ #endif -#if __LONG_WIDTH__ == 64 +#if __SIZEOF_LONG__ == 8 # define LONG_MAX __INT64_MAX__ # define LONG_MIN (-LONG_MAX - 1) # define ULONG_MAX __UINT64_MAX__ -#elif __LONG_WIDTH__ == 32 +#elif __SIZEOF_LONG__ == 4 # define LONG_MAX __INT32_MAX__ # define LONG_MIN (-LONG_MAX - 1) # define ULONG_MAX __UINT32_MAX__ #endif -#if __LONG_LONG_WIDTH__ == 64 +#if __SIZEOF_LONG_LONG__ == 8 # define LLONG_MAX __INT64_MAX__ # define LLONG_MIN (-LLONG_MAX - 1) # define ULLONG_MAX __UINT64_MAX__ -- 2.47.3