[patch] stdint.h: intmax_t/uintmax_t improvements

Jeff Johnston jjohnstn@redhat.com
Mon Oct 3 17:25:00 GMT 2005


Patch checked in.  I fixed up the spelling of appropriate.  I still have 
to go back and look at the fast types patch..i.e. I haven't forgotten 
about it.

Thanks,

-- Jeff J.

Ralf Corsepius wrote:

>Hi,
>
>Another stdint.h fragment ...
>
>Ralf
>
>  
>
>------------------------------------------------------------------------
>
>2005-09-28  Ralf Corsepius <ralf.corsepius@rtems.org>
>
>	* libc/include/stdint.h: 
>	Use __INTMAX_TYPE__ to derive intmax_t.
>	Use __UINTMAX_TYPE__ to derive uintmax_t.
>	Fix minor typo.
>
>
>Index: libc/include/stdint.h
>===================================================================
>RCS file: /cvs/src/src/newlib/libc/include/stdint.h,v
>retrieving revision 1.4
>diff -u -r1.4 stdint.h
>--- libc/include/stdint.h	27 Sep 2005 20:49:53 -0000	1.4
>+++ libc/include/stdint.h	28 Sep 2005 09:13:34 -0000
>@@ -148,16 +148,27 @@
> #endif
> #endif
> 
>-#if __have_longlong64
>-typedef signed long long intmax_t;
>-typedef unsigned long long uintmax_t;
>-#else
>-typedef signed long intmax_t;
>-typedef unsigned long uintmax_t;
>-#endif
>+/* 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;
>+#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
> 
> /*
>- * GCC doesn't provide an propriate macro for [u]intptr_t
>+ * GCC doesn't provide an apropriate macro for [u]intptr_t
>  * For now, use __PTRDIFF_TYPE__
>  */
> #if defined(__PTRDIFF_TYPE__)
>  
>



More information about the Newlib mailing list