From aa2036a70d6a4964fe6e80e6206e157edb409edf Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 21 Feb 2010 12:50:32 +0000 Subject: [PATCH] 2010-02-21 Tatsuhiro Tsujikawa Fixed compile error with mingw32 cross compiler. Defined a2_sockopt_t as void* for the target systems other than mingw32. * src/SocketCore.cc * src/a2netcompat.h --- ChangeLog | 7 +++++++ src/SocketCore.cc | 4 ++-- src/a2netcompat.h | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d3734311..f1c6e6da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-02-21 Tatsuhiro Tsujikawa + + Fixed compile error with mingw32 cross compiler. Defined + a2_sockopt_t as void* for the target systems other than mingw32. + * src/SocketCore.cc + * src/a2netcompat.h + 2010-02-20 Tatsuhiro Tsujikawa Removed 'always true' condition diff --git a/src/SocketCore.cc b/src/SocketCore.cc index 4be28b30..a89af87f 100644 --- a/src/SocketCore.cc +++ b/src/SocketCore.cc @@ -418,14 +418,14 @@ void SocketCore::establishConnection(const std::string& host, uint16_t port) void SocketCore::setSockOpt (int level, int optname, void* optval, socklen_t optlen) { - if(setsockopt(sockfd, level, optname, optval, optlen) < 0) { + if(setsockopt(sockfd, level, optname, (a2_sockopt_t)optval, optlen) < 0) { throw DL_ABORT_EX(StringFormat(EX_SOCKET_SET_OPT, errorMsg()).str()); } } void SocketCore::setMulticastTtl(unsigned char ttl) { - setSockOpt(IPPROTO_IP, IP_MULTICAST_TTL, (a2_sockopt_t)&ttl, sizeof(ttl)); + setSockOpt(IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)); } void SocketCore::joinMulticastGroup(const std::string& ipaddr, uint16_t port) diff --git a/src/a2netcompat.h b/src/a2netcompat.h index 5ea33b02..11938fb7 100644 --- a/src/a2netcompat.h +++ b/src/a2netcompat.h @@ -55,7 +55,7 @@ # undef HAVE_GAI_STRERROR # undef gai_strerror #else -# define a2_sockopt_t int * +# define a2_sockopt_t void * #endif // __MINGW32__ #ifdef HAVE_NETDB_H