autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_TYPE_UINT8_T and co


From: Paul Eggert
Subject: Re: AC_TYPE_UINT8_T and co
Date: Thu, 31 May 2007 12:37:18 -0700
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Paul Eggert <address@hidden> writes:

> you can approximate it this way:

... which should be documented, so I installed this:

2007-05-31  Paul Eggert  <address@hidden>

        * doc/autoconf.texi (Particular Types): Give example of use for
        AC_TYPE_INT8_T etc.

--- doc/autoconf.texi   29 May 2007 05:36:29 -0000      1.1158
+++ doc/autoconf.texi   31 May 2007 19:35:41 -0000
@@ -5911,6 +5911,19 @@ If @file{stdint.h} or @file{inttypes.h} 
 @code{int8_t}, define @code{int8_t} to a signed
 integer type that is exactly 8 bits wide and that uses two's complement
 representation, if such a type exists.
+If you are worried about porting to hosts that lack such a type, you can
+use the results of this macro in C89-or-later code as follows:
+
address@hidden
+#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#if defined INT8_MAX || defined int8_t
+ @emph{code using int8_t}
+#else
+ @emph{complicated alternative using >8-bit 'signed char'}
+#endif
address@hidden example
 @end defmac

 @defmac AC_TYPE_INT16_T
@@ -6060,27 +6073,28 @@ If @file{stdint.h} or @file{inttypes.h} 
 @code{uint8_t}, define @code{uint8_t} to an
 unsigned integer type that is exactly 8 bits wide, if such a type
 exists.
+This is like @code{AC_TYPE_INT8_T}, except for unsigned integers.
 @end defmac

 @defmac AC_TYPE_UINT16_T
 @acindex{TYPE_UINT16_T}
 @cvindex HAVE_UINT16_T
 @cvindex uint16_t
-This is like @code{AC_TYPE_UINT8_T}, except for 16-bit unsigned integers.
+This is like @code{AC_TYPE_UINT8_T}, except for 16-bit integers.
 @end defmac

 @defmac AC_TYPE_UINT32_T
 @acindex{TYPE_UINT32_T}
 @cvindex HAVE_UINT32_T
 @cvindex uint32_t
-This is like @code{AC_TYPE_UINT8_T}, except for 32-bit unsigned integers.
+This is like @code{AC_TYPE_UINT8_T}, except for 32-bit integers.
 @end defmac

 @defmac AC_TYPE_UINT64_T
 @acindex{TYPE_UINT64_T}
 @cvindex HAVE_UINT64_T
 @cvindex uint64_t
-This is like @code{AC_TYPE_UINT8_T}, except for 64-bit unsigned integers.
+This is like @code{AC_TYPE_UINT8_T}, except for 64-bit integers.
 @end defmac

 @defmac AC_TYPE_UINTMAX_T




reply via email to

[Prev in Thread] Current Thread [Next in Thread]