INN commit: branches/2.5 (configure.ac include/clibrary.h)
INN Commit
rra at isc.org
Sat Aug 6 20:21:28 UTC 2011
Date: Saturday, August 6, 2011 @ 13:21:28
Author: iulius
Revision: 9313
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:
branches/2.5/configure.ac
branches/2.5/include/clibrary.h
--------------------+
configure.ac | 12 +++---------
include/clibrary.h | 13 +++++++++++++
2 files changed, 16 insertions(+), 9 deletions(-)
Modified: configure.ac
===================================================================
--- configure.ac 2011-08-06 20:19:21 UTC (rev 9312)
+++ configure.ac 2011-08-06 20:21:28 UTC (rev 9313)
@@ -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-08-06 20:19:21 UTC (rev 9312)
+++ include/clibrary.h 2011-08-06 20:21:28 UTC (rev 9313)
@@ -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 long ptrdiff_t;
+#endif
+/* In case <signal.h> does not define sig_atomic_t. */
+#if !HAVE_SIG_ATOMIC_T
+typedef int sig_atomic_t;
+#endif
+/* In case <sys/socket.h> does not define socklen_t. */
+#if !HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
END_DECLS
/* "Good enough" replacements for standard functions. */
More information about the inn-committers
mailing list