I tried to build 1.3d and svn trunk today, and came across a couple of issues.
A patch is attached that remedies these problems, and I _think_ they won't break
anything.
1. configure.in
a) Added AC_CHECK_LIB for inet_ntoa in libnsl (it's where it lives on
Solaris)
b) Changed the checks for __func__ and __FUNCTION__ so it no longer tries to
declare an inner function (the void foo() {}). Inner functions are not
allowed in ISO C, so even though gcc accepts it, other compilers
(like Sun Studio) don't.
2. test/regress.c
a) Changed references for u_int32_t to uint32_t, since the latter is C99,
and is also what's tested for in the configure script.
--Magne
Index: test/regress.c
===================================================================
--- test/regress.c (revision 408)
+++ test/regress.c (working copy)
@@ -821,7 +821,7 @@
cleanup_test();
}
-int decode_int(u_int32_t *pnumber, struct evbuffer *evbuf);
+int decode_int(uint32_t *pnumber, struct evbuffer *evbuf);
void
read_once_cb(int fd, short event, void *arg)
@@ -872,10 +872,10 @@
evtag_int_test(void)
{
struct evbuffer *tmp = evbuffer_new();
- u_int32_t integers[TEST_MAX_INT] = {
+ uint32_t integers[TEST_MAX_INT] = {
0xaf0, 0x1000, 0x1, 0xdeadbeef, 0x00, 0xbef000
};
- u_int32_t integer;
+ uint32_t integer;
int i;
for (i = 0; i < TEST_MAX_INT; i++) {
Index: configure.in
===================================================================
--- configure.in (revision 408)
+++ configure.in (working copy)
@@ -38,6 +38,7 @@
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(resolv, inet_aton)
AC_CHECK_LIB(rt, clock_gettime)
+AC_CHECK_LIB(nsl, inet_ntoa)
dnl Checks for header files.
AC_HEADER_STDC
@@ -367,12 +368,12 @@
AC_MSG_CHECKING([whether our compiler supports __func__])
AC_TRY_COMPILE([],
- [void foo() { const char *cp = __func__; }],
+ [ const char *cp = __func__; ],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
AC_MSG_CHECKING([whether our compiler supports __FUNCTION__])
AC_TRY_COMPILE([],
- [void foo() { const char *cp = __FUNCTION__; }],
+ [ const char *cp = __FUNCTION__; ],
AC_MSG_RESULT([yes])
AC_DEFINE(__func__, __FUNCTION__,
[Define to appropriate substitue if compiler doesnt have __func__]),
_______________________________________________
Libevent-users mailing list
[email protected]
http://monkey.org/mailman/listinfo/libevent-users