INN commit: trunk (configure.ac include/clibrary.h)

INN Commit rra at isc.org
Wed Jul 27 18:27:54 UTC 2011


    Date: Wednesday, July 27, 2011 @ 11:27:54
  Author: iulius
Revision: 9291

use new AC_CHECK_TYPE autoconf syntax

Autoconf versions prior to 2.13 provide a now deprecated version
of the AC_CHECK_TYPE macro.  It was doing more than a CHECK, and
was also defining missing types with #define instead of typedef.

Swith to the preferred syntax with AC_CHECK_TYPES and typedef.

Modified:
  trunk/configure.ac
  trunk/include/clibrary.h

--------------------+
 configure.ac       |   12 +++---------
 include/clibrary.h |   13 +++++++++++++
 2 files changed, 16 insertions(+), 9 deletions(-)

Modified: configure.ac
===================================================================
--- configure.ac	2011-07-25 20:47:42 UTC (rev 9290)
+++ configure.ac	2011-07-27 18:27:54 UTC (rev 9291)
@@ -421,17 +421,11 @@
 AC_TYPE_SIZE_T
 AC_TYPE_SSIZE_T
 AC_TYPE_UID_T
-AC_CHECK_TYPE([ptrdiff_t], ,
-    [AC_DEFINE([ptrdiff_t], [long],
-        [Define to long if <sys/types.h> does not define.])])
-AC_CHECK_TYPE([sig_atomic_t], ,
-    [AC_DEFINE([sig_atomic_t], [int],
-        [Define to int if <signal.h> does not define.])],
+AC_CHECK_TYPES([ptrdiff_t])
+AC_CHECK_TYPES([sig_atomic_t], , ,
 [#include <sys/types.h>
 #include <signal.h>])
-AC_CHECK_TYPE([socklen_t], ,
-    [AC_DEFINE([socklen_t], [int],
-        [Define to int if <sys/socket.h> does not define.])],
+AC_CHECK_TYPES([socklen_t], , ,
 [#include <sys/types.h>
 #include <sys/socket.h>])
 AC_CHECK_TYPES([union semun], , ,

Modified: include/clibrary.h
===================================================================
--- include/clibrary.h	2011-07-25 20:47:42 UTC (rev 9290)
+++ include/clibrary.h	2011-07-27 18:27:54 UTC (rev 9291)
@@ -129,6 +129,19 @@
 extern int              vsnprintf(char *, size_t, const char *, va_list);
 #endif
 
+/* In case <sys/types.h> does not define ptrdiff_t. */
+#if !HAVE_PTRDIFF_T
+typedef ptrdiff_t       long;
+#endif
+/* In case <signal.h> does not define sig_atomic_t. */
+#if !HAVE_SIG_ATOMIC_T
+typedef sig_atomic_t    int;
+#endif
+/* In case <sys/socket.h> does not define socklen_t. */
+#if !HAVE_SOCKLEN_T
+typedef socklen_t       int;
+#endif
+
 END_DECLS
 
 /* "Good enough" replacements for standard functions. */




More information about the inn-committers mailing list