2010-02-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

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
pull/1/head
Tatsuhiro Tsujikawa 2010-02-21 12:50:32 +00:00
parent ab0662e580
commit aa2036a70d
3 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2010-02-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
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 <t-tujikawa@users.sourceforge.net>
Removed 'always true' condition

View File

@ -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)

View File

@ -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