]> err.no Git - sope/blobdiff - sope-core/NGStreams/NGInternetSocketAddress.m
ported to recent FreeBSD
[sope] / sope-core / NGStreams / NGInternetSocketAddress.m
index 40efcfd5beea955d181d98c526f28d72cb9d22b7..7634e803a095352214e5e81d5979d551399d9c86 100644 (file)
@@ -48,7 +48,7 @@
 #include "NGInternetSocketDomain.h"
 #include "common.h"
 
-#if defined(HAVE_GETHOSTBYNAME_R) && !defined(linux)
+#if defined(HAVE_GETHOSTBYNAME_R) && !defined(linux) && !defined(__FreeBSD__)
 #define USE_GETHOSTBYNAME_R 1
 #endif
 
@@ -140,7 +140,7 @@ static inline NSString *_nameOfLocalhost(void) {
 #if USE_GETHOSTBYNAME_R
         struct hostent hostEntityBuffer;
         char buffer[8200];
-       
+
         hostEntity = gethostbyaddr_r((char *)&(sockAddr->sin_addr.s_addr),
                                      4,
                                      [[self domain] socketDomain],
@@ -277,14 +277,14 @@ static inline NSString *_nameOfLocalhost(void) {
       BOOL didFail   = NO;
       int  errorCode = 0;
       int  addrType  = AF_INET;
-#if defined(HAVE_GETHOSTBYNAME_R) && !defined(linux)
+#if defined(USE_GETHOSTBYNAME_R)
       char buffer[4096];
       struct hostent hostEntity;
 #else
       struct hostent *hostEntity; // only valid during lock
 #endif
 
-#if defined(HAVE_GETHOSTBYNAME_R) && !defined(linux)
+#if defined(USE_GETHOSTBYNAME_R)
       if (gethostbyname_r(chost, &hostEntity,
                           buffer, sizeof(buffer), &errorCode) == NULL) {
         didFail = YES;