From a9dffbc96e353c26d0320871028ff8902f6a0a99 Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Fri, 1 Aug 2014 15:18:23 +0100 Subject: [PATCH] can't use the terneries in that way because the result in different types then. --- include/tr/socket.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/include/tr/socket.h b/include/tr/socket.h index af12cc6..65c0d79 100644 --- a/include/tr/socket.h +++ b/include/tr/socket.h @@ -75,12 +75,8 @@ TR_INSTANCE_INIT(TR_Socket); #define TR_socketCname(socket) (((TR_Socket)(socket))->cname) #define TR_socketTtl(socket) (((TR_Socket)(socket))->ttl) -#define TR_socketAddr(socket) \ - (((TR_Socket)(socket))->addr.info.sa_family == AF_INET \ - ? ((TR_Socket)(socket))->addr.in \ - : ((TR_Socket)(socket))->addr.info.sa_family == AF_INET6 \ - ? ((TR_Socket)(socket))->addr.in6 \ - : NULL) +#define TR_socketAddr(socket) \ + ((unsigned char *)&((TR_Socket)(socket))->addr) #define TR_socketAddrlen(socket) (((TR_Socket)(socket))->addrlen) #define TR_socketHandle(socket) (((TR_Socket)(socket))->handle)