From 0d9f5f9606374883742efd189451f6fb81440139 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sun, 6 Nov 2005 17:33:51 +0000 Subject: Fixed error with inet_ntoa() git-svn-id: http://svn.pjsip.org/repos/pjproject/main@15 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/src/pj/sock_bsd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'pjlib/src/pj/sock_bsd.c') diff --git a/pjlib/src/pj/sock_bsd.c b/pjlib/src/pj/sock_bsd.c index 21c10d19..8f1fa1df 100644 --- a/pjlib/src/pj/sock_bsd.c +++ b/pjlib/src/pj/sock_bsd.c @@ -103,10 +103,14 @@ PJ_DEF(pj_uint32_t) pj_htonl(pj_uint32_t hostlong) * to string in standard numbers and dots notation. */ PJ_DEF(char*) pj_inet_ntoa(pj_in_addr inaddr) -{ +{ +#if !defined(PJ_LINUX) && !defined(PJ_LINUX_KERNEL) + return inet_ntoa(*(struct in_addr*)&inaddr); +#else struct in_addr addr; addr.s_addr = inaddr.s_addr; - return inet_ntoa(addr); + return inet_ntoa(addr); +#endif } /* -- cgit v1.2.3