aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2005-10-03 17:22:38 +0000
committerJeff Johnston <jjohnstn@redhat.com>2005-10-03 17:22:38 +0000
commit8afb8202d457c054d411988ffd980eea466045a9 (patch)
treedabd60b918f8444f290ff9b1c355e9dbca0cc75c
parent14491fd0e0714d98351f632dbd64d6b6b6e428dd (diff)
downloadnewlib-8afb8202d457c054d411988ffd980eea466045a9.zip
newlib-8afb8202d457c054d411988ffd980eea466045a9.tar.gz
newlib-8afb8202d457c054d411988ffd980eea466045a9.tar.bz2
2005-10-03 Jeff Johnston <jjohnstn@redhat.com>
* libc/sys/linux/include/stdint.h: Include <sys/types.h> and incorporate Ralf's change below.
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/sys/linux/include/stdint.h23
2 files changed, 23 insertions, 5 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index e6eafdb..d8de2f1 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2005-10-03 Jeff Johnston <jjohnstn@redhat.com>
+
+ * libc/sys/linux/include/stdint.h: Include <sys/types.h> and
+ incorporate Ralf's change below.
+
2005-10-03 Ralf Corsepius <ralf.corsepius@rtems.org>
* libc/include/stdint.h:
diff --git a/newlib/libc/sys/linux/include/stdint.h b/newlib/libc/sys/linux/include/stdint.h
index e76339e..d1197f6 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 <sys/types.h>
+
#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