[21.5] Check for u_int*_t typedefs in configure.ac

Dr. Volker Zell Dr.Volker.Zell at oracle.com
Wed Dec 6 06:39:46 EST 2006


Hi

The following patch is for 21.5. An equivalent patch for 21.4 has
already been accepted.


2006-12-06  Dr. Volker Zell  <Dr.Volker.Zell at oracle.com>

        * configure.ac: Check for u_int*_t typedefs.

        * config.h.in: New HAVE_U_INT*_T defines.

        * database.c: Only use u_int*_t typedefs if not already
        defined.

--- configure.ac.orig	2006-12-06 11:25:31.135572800 +0100
+++ configure.ac	2006-12-06 12:27:46.036096000 +0100
@@ -5351,6 +5351,9 @@
      "$enable_database_dbm"  = "yes" && \
   AC_DEFINE(HAVE_DBM)
 
+dnl Check for u_int*_t typedefs.
+AC_CHECK_TYPES([u_int8_t, u_int16_t, u_int32_t, u_int64_t])
+
 dnl Check for Berkeley DB.
 if test "$enable_database_berkdb" != "no"; then
   AC_MSG_CHECKING(for Berkeley db.h)
@@ -5361,14 +5364,22 @@
 #ifdef HAVE_INTTYPES_H
 #define __BIT_TYPES_DEFINED__
 #include <inttypes.h>
+#if !HAVE_U_INT8_T
 typedef uint8_t  u_int8_t;
+#endif
+#if !HAVE_U_INT16_T
 typedef uint16_t u_int16_t;
+#endif
+#if !HAVE_U_INT32_T
 typedef uint32_t u_int32_t;
+#endif
 #ifdef WE_DONT_NEED_QUADS
+#if !HAVE_U_INT64_T
 typedef uint64_t u_int64_t;
 #endif
 #endif
 #endif
+#endif
 #include <$header>
 ])], db_h_file="$header"; break)
   done
--- config.h.in.orig	2006-12-06 11:18:41.426440000 +0100
+++ config.h.in	2006-12-06 12:26:23.337180800 +0100
@@ -523,6 +523,15 @@
 /* Compile in support for DBM databases?  May require libgdbm or libdbm. */
 #undef HAVE_DBM
 
+/* Define to 1 if the system has the type `u_int8_t'. */
+#undef HAVE_U_INT8_T
+/* Define to 1 if the system has the type `u_int16_t'. */
+#undef HAVE_U_INT16_T
+/* Define to 1 if the system has the type `u_int32_t'. */
+#undef HAVE_U_INT32_T
+/* Define to 1 if the system has the type `u_int64_t'. */
+#undef HAVE_U_INT64_T
+
 /* Compile in support for Berkeley DB style databases?  May require libdb. */
 #undef HAVE_BERKELEY_DB
 /* Full #include file path for Berkeley DB's db.h */
--- database.c.orig	2006-12-06 11:22:18.408444800 +0100
+++ database.c	2006-12-06 12:29:23.806683200 +0100
@@ -45,16 +45,24 @@
 /* glibc 2.1 doesn't have this problem with DB 2.x */
 #if !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1)
 #ifdef HAVE_INTTYPES_H
+#ifndef __BIT_TYPES_DEFINED__
 #define __BIT_TYPES_DEFINED__
+#endif
 #include <inttypes.h>
-#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__APPLE__)
+#if !HAVE_U_INT8_T
 typedef uint8_t  u_int8_t;
+#endif
+#if !HAVE_U_INT16_T
 typedef uint16_t u_int16_t;
+#endif
+#if !HAVE_U_INT32_T
 typedef uint32_t u_int32_t;
+#endif
 #ifdef WE_DONT_NEED_QUADS
+#if !HAVE_U_INT64_T
 typedef uint64_t u_int64_t;
+#endif
 #endif /* WE_DONT_NEED_QUADS */
-#endif /* __FreeBSD__ */
 #endif /* HAVE_INTTYPES_H */
 #endif /* !(defined __GLIBC__ && __GLIBC_MINOR__ >= 1) */
 /* Berkeley DB wants __STDC__ to be defined; else if does `#define const' */



More information about the XEmacs-Patches mailing list