#endif
])
+# Check the type of struct msghdr msg_iovlen.
+AC_MSG_CHECKING([sign of struct msghdr.msg_iovlen])
+AC_RUN_IFELSE([
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/socket.h>
+int main()
+{
+ struct msghdr h;
+ h.msg_iovlen = -1;
+ if(10/h.msg_iovlen == 0) return 0; /* unsigned */
+ return 1; /* signed */
+}
+], [
+# if compiled and exit status 0
+cv_msgiovlen_type="unsigned" ], [
+# not compiled or bad exit status
+cv_msgiovlen_type="int" ],
+# when cross compiling
+[ cv_msgiovlen_type="int" ])
+AC_MSG_RESULT($cv_msgiovlen_type)
+AC_DEFINE_UNQUOTED([TYPE_MSGIOVLEN], $cv_msgiovlen_type, [Define to 'int' or type of struct msghdr.msg_iovlen.])
+
# Checks for libraries.
AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname],
[enable SSL (will check /usr/local/ssl
+3 April 2007: Wouter
+ - detect sign of msghdr.msg_iovlen so that the cast to that type
+ in netevent (which is there to please lint) can be correct.
+ The type on several OSes ranges from int, int32, uint32, size_t.
+ Detects unsigned or signed using math trick.
+
2 April 2007: Wouter
- check sizes of udp received messages, not too short.
- review changes. Some memmoves can be memcpys: 4byte aligned.
hdr.msg_name = &repinfo->addr;
hdr.msg_namelen = repinfo->addrlen;
hdr.msg_iov = iov + 1;
- hdr.msg_iovlen = (typeof(hdr.msg_iovlen))(iovlen - 1);
+ hdr.msg_iovlen = (TYPE_MSGIOVLEN)(iovlen - 1);
hdr.msg_control = NULL;
hdr.msg_controllen = 0;
hdr.msg_flags = 0;