Skip to content

Commit

Permalink
[project @ 2004-11-30 08:48:28 by stolz]
Browse files Browse the repository at this point in the history
Test for gethostent(), since it's not available on all platforms

Closes SF-bug#:	[ 1059296 ] gethostent is not available for NetBSD-1.6.2
Submitted by:	Roland Illig
  • Loading branch information
stolz committed Nov 30, 2004
1 parent d817e3a commit b904620
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Network/BSD.hsc
Expand Up @@ -33,7 +33,7 @@ module Network.BSD (
getHostByAddr, -- :: HostAddress -> Family -> IO HostEntry
hostAddress, -- :: HostEntry -> HostAddress

#if !defined(cygwin32_TARGET_OS) && !defined(mingw32_TARGET_OS) && !defined(_WIN32)
#if defined(HAVE_GETHOSTENT) && !defined(cygwin32_TARGET_OS) && !defined(mingw32_TARGET_OS) && !defined(_WIN32)
setHostEntry, -- :: Bool -> IO ()
getHostEntry, -- :: IO HostEntry
endHostEntry, -- :: IO ()
Expand Down Expand Up @@ -382,7 +382,7 @@ getHostByAddr family addr = do
foreign import ccall safe "gethostbyaddr"
c_gethostbyaddr :: Ptr HostAddress -> CInt -> CInt -> IO (Ptr HostEntry)

#if !defined(cygwin32_TARGET_OS) && !defined(mingw32_TARGET_OS) && !defined(_WIN32)
#if defined(HAVE_GETHOSTENT) && !defined(cygwin32_TARGET_OS) && !defined(mingw32_TARGET_OS) && !defined(_WIN32)
getHostEntry :: IO HostEntry
getHostEntry = do
throwNoSuchThingIfNull "getHostEntry" "unable to retrieve host entry"
Expand Down
2 changes: 2 additions & 0 deletions configure.ac
Expand Up @@ -45,4 +45,6 @@ AC_EGREP_HEADER(sendfile, sys/socket.h,
[ AC_DEFINE([HAVE_BSD_SENDFILE], [1], [Define to 1 if you have a BSDish sendfile(2) implementation.]) AC_MSG_RESULT(yes) ],
AC_MSG_RESULT(no))

AC_CHECK_FUNCS(gethostent)

AC_OUTPUT

0 comments on commit b904620

Please sign in to comment.