From 4ebfb5424e55ebca71330b9bbdba176cd384fe56 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sun, 21 Dec 2014 10:18:06 -0600 Subject: [PATCH] newlib-stdint.h: Use glibc's logic for uintptr_t and intptr_t 2014-12-21 Joel Sherrill * config/newlib-stdint.h: Use logic from glibc-stdint.h to define intptr_t and uintptr_t. This makes the type definitions consistent with newlib's . --- gcc/config/newlib-stdint.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gcc/config/newlib-stdint.h b/gcc/config/newlib-stdint.h index 47445e4..120f43d 100644 --- a/gcc/config/newlib-stdint.h +++ b/gcc/config/newlib-stdint.h @@ -60,10 +60,5 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define UINT_FAST32_TYPE (INT_TYPE_SIZE >= 32 ? "unsigned int" : UINT_LEAST32_TYPE) #define UINT_FAST64_TYPE (INT_TYPE_SIZE >= 64 ? "unsigned int" : UINT_LEAST64_TYPE) -/* Newlib uses the unsigned type corresponding to ptrdiff_t for - uintptr_t; this is the same as size_t for most newlib-using - targets. */ -#define INTPTR_TYPE PTRDIFF_TYPE -#ifndef UINTPTR_TYPE -#define UINTPTR_TYPE SIZE_TYPE -#endif +#define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") +#define UINTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int") -- 1.9.3