From 8afb8202d457c054d411988ffd980eea466045a9 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Mon, 3 Oct 2005 17:22:38 +0000 Subject: 2005-10-03 Jeff Johnston * libc/sys/linux/include/stdint.h: Include and incorporate Ralf's change below. --- newlib/libc/sys/linux/include/stdint.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'newlib/libc/sys') diff --git a/newlib/libc/sys/linux/include/stdint.h b/newlib/libc/sys/linux/include/stdint.h index e76339ebe..d1197f66c 100644 --- a/newlib/libc/sys/linux/include/stdint.h +++ b/newlib/libc/sys/linux/include/stdint.h @@ -14,6 +14,8 @@ #ifndef _STDINT_H #define _STDINT_H +#include + #ifdef __cplusplus extern "C" { #endif @@ -122,14 +124,25 @@ typedef uint64_t uint_least32_t; #endif #endif -#if __have_longlong64 -typedef signed long long intmax_t; -typedef unsigned long long uintmax_t; +/* Greatest-width integer types */ +/* Modern GCCs provide __INTMAX_TYPE__ */ +#if defined(__INTMAX_TYPE__) + typedef __INTMAX_TYPE__ intmax_t; +#elif __have_longlong64 + typedef signed long long intmax_t; #else -typedef signed long intmax_t; -typedef unsigned long uintmax_t; + typedef signed long intmax_t; #endif +/* Modern GCCs provide __UINTMAX_TYPE__ */ +#if defined(__UINTMAX_TYPE__) + typedef __UINTMAX_TYPE__ uintmax_t; +#elif __have_longlong64 + typedef unsigned long long uintmax_t; +#else + typedef unsigned long uintmax_t; +#endif + /* Limits of Specified-Width Integer Types */ #if __int8_t_defined -- cgit v1.2.3