Hi all,
In order to compile mutt-1.5.13 on a machine with an old compiler
suite (based on GCC 3.3), I had to add an include directive to file
mutt_socket.c. Otherwise, GCC would complain that struct timeval is an
incomplete type. The error appears in the following function, where
`tv' is declared:
----
int raw_socket_poll (CONNECTION* conn)
{
fd_set rfds;
struct timeval tv = { 0, 0 };
if (conn->fd < 0)
return -1;
FD_ZERO (&rfds);
FD_SET (conn->fd, &rfds);
return select (conn->fd + 1, &rfds, NULL, NULL, &tv);
}
----
Here's what fixed it for me:
----
$ diff -u mutt_socket.c{~,}
--- mutt_socket.c~ Sun Aug 6 00:17:37 2006
+++ mutt_socket.c Wed Oct 4 21:13:20 2006
@@ -38,6 +38,7 @@
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
+#include <sys/time.h>
#include <sys/socket.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
----
I tried the same patch on a more modern system (Fedora Core 4 on
AMD64, which is based on GCC 4.0.2), and compilation went fine. So I
assume including this patch wouldn't do any harm (assuming there is
any interest for making Mutt compatible with antique compiler suites).
--
David Haguenauer
Attachment:
pgp3yXshG9Gbr.pgp
Description: PGP signature