From debc021491530ff014166d48232b906d66a62b54 Mon Sep 17 00:00:00 2001 From: Serban Constantinescu Date: Tue, 8 Oct 2013 21:45:02 +0100 Subject: [PATCH] AArch64: Fix definitions for STDINT_LIMITS This patches fixes the definitions for STDINT_LIMITS on __LP64__ systems. Change-Id: I5eb1664e9ef7c303432a2b041c99cec663816b75 Signed-off-by: Serban Constantinescu --- libc/include/stdint.h | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/libc/include/stdint.h b/libc/include/stdint.h index 6e2f311d3..9bdfb0506 100644 --- a/libc/include/stdint.h +++ b/libc/include/stdint.h @@ -193,17 +193,33 @@ typedef uint64_t uint_fast64_t; # define __PRIFAST_RANK "" # define __PRIPTR_RANK "" + /* * intptr_t & uintptr_t */ #ifdef __LP64__ + typedef long intptr_t; typedef unsigned long uintptr_t; + +#ifdef __STDINT_LIMITS +# define INTPTR_MIN INT64_MIN +# define INTPTR_MAX INT64_MAX +# define UINTPTR_MAX UINT64_MAX +# define PTRDIFF_MIN INT64_MIN +# define PTRDIFF_MAX INT64_MAX +#endif +#ifdef __STDINT_MACROS +# define INTPTR_C(c) INT64_C(c) +# define UINTPTR_C(c) UINT64_C(c) +# define PTRDIFF_C(c) INT64_C(c) +#endif + #else + typedef int intptr_t; typedef unsigned int uintptr_t; -#endif #ifdef __STDINT_LIMITS # define INTPTR_MIN INT32_MIN @@ -212,13 +228,15 @@ typedef unsigned int uintptr_t; # define PTRDIFF_MIN INT32_MIN # define PTRDIFF_MAX INT32_MAX #endif - #ifdef __STDINT_MACROS # define INTPTR_C(c) INT32_C(c) # define UINTPTR_C(c) UINT32_C(c) # define PTRDIFF_C(c) INT32_C(c) #endif +#endif /* __LP64__ */ + + /* * intmax_t & uintmax_t */