AC_TYPE_UINT8_T and co

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

 



 -- Macro: AC_TYPE_UINT8_T
     If `stdint.h' or `inttypes.h' defines the type `uint8_t', define
     `HAVE_UINT8_T'.  Otherwise, define `uint8_t' to an unsigned
     integer type that is exactly 8 bits wide, if such a type exists.

but for some reason HAVE_UINT8_T is not defined! (Today's CVS)

% cat configure.ac
AC_INIT([autotype],[1.0])
AC_CONFIG_HEADERS([config.h])
AC_TYPE_UINT8_T
AC_OUTPUT
% autoreconf
% ./configure
...
checking for uint8_t... yes
...
config.status: creating config.h
% grep UINT config.h
/* #undef _UINT8_T */

The attached patch fixes this..
(Also removes what appear to be spurious #(  )


Also, AC_TYPE_SIZE_T does not claim to define HAVE_SIZE_T, (as it
uses _AC_CHECK_TYPE_OLD) - would defining HAVE_SIZE_T be considered
an improvement?


Cheers,

Patrick
Index: types.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/types.m4,v
retrieving revision 1.52
diff -u -r1.52 types.m4
--- types.m4	13 Apr 2007 07:52:58 -0000	1.52
+++ types.m4	28 May 2007 16:18:30 -0000
@@ -631,13 +631,16 @@
 	       [ac_cv_c_int$1_t=$ac_type])])])
        test "$ac_cv_c_int$1_t" != no && break
      done])
-  case $ac_cv_c_int$1_t in #(
-  no|yes) ;; #(
+  case $ac_cv_c_int$1_t in
+  no|yes) ;;
   *)
     AC_DEFINE_UNQUOTED([int$1_t], [$ac_cv_c_int$1_t],
       [Define to the type of a signed integer type of width exactly $1 bits
        if such a type exists and the standard includes do not define it.]);;
   esac
+  if test "$ac_cv_c_int$1_t" != no; then
+    AC_DEFINE_UNQUOTED([HAVE_INT$1_T], [1], [Define if int$i_t exists.])
+  fi
 ])# _AC_TYPE_INT
 
 # _AC_TYPE_UNSIGNED_INT(NBITS)
@@ -657,8 +660,8 @@
 	    [ac_cv_c_uint$1_t=$ac_type])])
        test "$ac_cv_c_uint$1_t" != no && break
      done])
-  case $ac_cv_c_uint$1_t in #(
-  no|yes) ;; #(
+  case $ac_cv_c_uint$1_t in
+  no|yes) ;;
   *)
     m4_bmatch([$1], [^\(8\|32\|64\)$],
       [AC_DEFINE([_UINT$1_T], 1,
@@ -670,6 +673,9 @@
       [Define to the type of an unsigned integer type of width exactly $1 bits
        if such a type exists and the standard includes do not define it.]);;
   esac
+  if test "$ac_cv_c_uint$1_t" != no; then
+    AC_DEFINE_UNQUOTED([HAVE_UINT$1_T], [1], [Define if uint$i_t exists.])
+  fi
 ])# _AC_TYPE_UNSIGNED_INT
 
 # AC_TYPE_SIGNAL
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux