From 096939b819f38a983e0cdf97cf467d68209862c5 Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Wed, 25 Nov 2020 19:46:40 +0100 Subject: [PATCH] mescc: define int64_t and uint64_t only if it's possible to define them as exactly 64 bits. * include/stdint.h[__SIZEOF_LONG_LONG__ != 8]: Remove typedefs for int64_t, uint16_t. --- include/stdint.h | 4 ++-- include/sys/types.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/stdint.h b/include/stdint.h index b306fa67..0f85d6b0 100644 --- a/include/stdint.h +++ b/include/stdint.h @@ -55,10 +55,10 @@ typedef unsigned short uint16_t; typedef short int16_t; typedef unsigned uint32_t; typedef int int32_t; -#if __SIZEOF_LONG_LONG__ +#if __SIZEOF_LONG_LONG__ == 8 typedef unsigned long long uint64_t; typedef long long int64_t; -#endif // __SIZEOF_LONG_LONG__ +#endif // __SIZEOF_LONG_LONG__ == 8 typedef int intmax_t; typedef unsigned uintmax_t; diff --git a/include/sys/types.h b/include/sys/types.h index a1b0726c..7c2cc9be 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -69,11 +69,13 @@ typedef unsigned gid_t; typedef unsigned long ino_t; #endif +#if __SIZEOF_LONG_LONG__ == 8 #ifndef __MES_INO64_T #define __MES_INO64_T #undef ino64_t typedef unsigned long long ino64_t; #endif +#endif // __SIZEOF_LONG_LONG__ == 8 #if !defined (__MES_INTPTR_T) && !defined (__intptr_t_defined) #define __MES_INTPTR_T @@ -90,11 +92,13 @@ typedef unsigned long uintptr_t; typedef long off_t; #endif +#if __SIZEOF_LONG_LONG__ == 8 #ifndef __MES_OFF64_T #define __MES_OFF64_T #undef off64_t typedef unsigned long long off64_t; #endif +#endif // __SIZEOF_LONG_LONG__ == 8 #ifndef __MES_PID_T #define __MES_PID_T