Irssi compile error under Irix6.5.x - Mipspro7.3
tommy-carlos williams <[email protected]> Fri, 25 Jul 2003 10:21:19 +1000
| Newsgroups | gmane.network.irc.irssi.devel |
|---|---|
| Organization | devgeeks |
| Message-ID | <[email protected]> |
hi,
i was trying to compile irssi (irssi-0.8.6.CVS) on Irix 6.5.16m using
Mipspro 7.3 last night and came accross a little sticking point.
network.c
cc-1101 cc: ERROR File = network.c, Line = 30
"sockaddr_union" has already been declared in the current scope.
union sockaddr_union {
i checked on the net for the error to see if there was an obvious fix
for it (i am relatively new to Irix and Mipspro) and found mention of
it in a cvs entry for the Silc projects use of irssi.
i checked if this error had been fixed in the irssi-latest.tar.gz and
then in the latest CVS and it had not. i can only assume the Silc
developers did not feed this fix back to irssi.
therefore i made this patch against the latest CVS.
again, i am new to all this, put this patch does allow irssi to compile
happily on Irix 6.5.x under Mipspro 7.3. (and possibly other versions).
please let me know if i have submitted this incorrectly as there seems
to only be information on submitting crash-type bug reports on the
website.
thanks,
- tommy-carlos williams
network.c-irix6.5-mipspro.patch
(application/octet-stream, 2.9 KB)
Index: src/core/network.c
===================================================================
RCS file: /home/cvs/irssi/src/core/network.c,v
retrieving revision 1.47
diff -u -r1.47 network.c
--- src/core/network.c 9 Jul 2003 23:34:41 -0000 1.47
+++ src/core/network.c 24 Jul 2003 23:49:00 -0000
@@ -27,7 +27,7 @@
# define INADDR_NONE INADDR_BROADCAST
#endif
-union sockaddr_union {
+union irssi_sockaddr_union {
struct sockaddr sa;
struct sockaddr_in sin;
#ifdef HAVE_IPV6
@@ -76,7 +76,7 @@
#else
static
#endif
-void sin_set_ip(union sockaddr_union *so, const IPADDR *ip)
+void sin_set_ip(union irssi_sockaddr_union *so, const IPADDR *ip)
{
if (ip == NULL) {
#ifdef HAVE_IPV6
@@ -98,7 +98,7 @@
memcpy(&so->sin.sin_addr, &ip->ip, 4);
}
-void sin_get_ip(const union sockaddr_union *so, IPADDR *ip)
+void sin_get_ip(const union irssi_sockaddr_union *so, IPADDR *ip)
{
ip->family = so->sin.sin_family;
@@ -115,7 +115,7 @@
#else
static
#endif
-void sin_set_port(union sockaddr_union *so, int port)
+void sin_set_port(union irssi_sockaddr_union *so, int port)
{
#ifdef HAVE_IPV6
if (so->sin.sin_family == AF_INET6)
@@ -130,7 +130,7 @@
#else
static
#endif
-int sin_get_port(union sockaddr_union *so)
+int sin_get_port(union irssi_sockaddr_union *so)
{
#ifdef HAVE_IPV6
if (so->sin.sin_family == AF_INET6)
@@ -178,7 +178,7 @@
/* Connect to socket with ip address */
GIOChannel *net_connect_ip(IPADDR *ip, int port, IPADDR *my_ip)
{
- union sockaddr_union so;
+ union irssi_sockaddr_union so;
int handle, ret, opt = 1;
if (my_ip != NULL && ip->family != my_ip->family) {
@@ -281,7 +281,7 @@
address. */
GIOChannel *net_listen(IPADDR *my_ip, int *port)
{
- union sockaddr_union so;
+ union irssi_sockaddr_union so;
int ret, handle, opt = 1;
socklen_t len;
@@ -338,7 +338,7 @@
/* Accept a connection on a socket */
GIOChannel *net_accept(GIOChannel *handle, IPADDR *addr, int *port)
{
- union sockaddr_union so;
+ union irssi_sockaddr_union so;
int ret;
socklen_t addrlen;
@@ -398,7 +398,7 @@
/* Get socket address/port */
int net_getsockname(GIOChannel *handle, IPADDR *addr, int *port)
{
- union sockaddr_union so;
+ union irssi_sockaddr_union so;
socklen_t addrlen;
g_return_val_if_fail(handle != NULL, -1);
@@ -421,7 +421,7 @@
int net_gethostbyname(const char *addr, IPADDR *ip4, IPADDR *ip6)
{
#ifdef HAVE_IPV6
- union sockaddr_union *so;
+ union irssi_sockaddr_union *so;
struct addrinfo hints, *ai, *ailist;
int ret, count;
#else
@@ -444,7 +444,7 @@
count = 0;
for (ai = ailist; ai != NULL && count < 2; ai = ai->ai_next) {
- so = (union sockaddr_union *) ai->ai_addr;
+ so = (union irssi_sockaddr_union *) ai->ai_addr;
if (ai->ai_family == AF_INET6 && ip6->family == 0) {
sin_get_ip(so, ip6);
@@ -473,7 +473,7 @@
int net_gethostbyaddr(IPADDR *ip, char **name)
{
#ifdef HAVE_IPV6
- union sockaddr_union so;
+ union irssi_sockaddr_union so;
int host_error;
char hostname[NI_MAXHOST];
#else