This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Define __intmax_t, __uintmax_t in bits/types.h
- From: Florian Weimer <fweimer at redhat dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 30 Dec 2016 13:59:01 +0100
- Subject: Re: Define __intmax_t, __uintmax_t in bits/types.h
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.20.1612211316270.3841@digraph.polyomino.org.uk>
On 12/21/2016 02:17 PM, Joseph Myers wrote:
diff --git a/bits/types.h b/bits/types.h
index 01753bd..45b99fd 100644
--- a/bits/types.h
+++ b/bits/types.h
@@ -56,6 +56,17 @@ __extension__ typedef long long int __quad_t;
__extension__ typedef unsigned long long int __u_quad_t;
#endif
+/* Largest integral types. */
+#if __WORDSIZE == 64
+typedef long int __intmax_t;
+typedef unsigned long int __uintmax_t;
+#else
+__extension__
+typedef long long int __intmax_t;
+__extension__
+typedef unsigned long long int __uintmax_t;
+#endif
I wouldn't put __extension__ on its own line for consistency with the
other declarations in that file.
Otherwise, looks good to me.
Thanks,
Florian