Skip to content

Commit

Permalink
independent exporting from HAVE_DECL_IF_NAMETOINDEX.
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed Dec 28, 2017
1 parent 13512ac commit 3fa7caa
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 10 deletions.
3 changes: 0 additions & 3 deletions Network/BSD.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,8 @@ module Network.BSD {-# DEPRECATED "This platform dependent module is no longer
, endNetworkEntry
#endif

#if HAVE_DECL_IF_NAMETOINDEX
-- * Interface names
, ifNameToIndex
#endif

) where

import Control.Concurrent (MVar, newMVar, withMVar)
Expand Down
2 changes: 0 additions & 2 deletions Network/Socket.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ module Network.Socket
-- ** Scope ID
, ScopeID
#endif
#if HAVE_DECL_IF_NAMETOINDEX
, ifNameToIndex
, ifIndexToName
#endif
-- ** Protocol number
, ProtocolNumber
, defaultProtocol
Expand Down
4 changes: 0 additions & 4 deletions Network/Socket/If.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
#include "HsNetDef.h"

module Network.Socket.If (
#if HAVE_DECL_IF_NAMETOINDEX
ifNameToIndex
, ifIndexToName
#endif
) where

#if HAVE_DECL_IF_NAMETOINDEX
import Foreign.C.String (CString, withCString, peekCString)
import Foreign.C.Types (CUInt(..))
import Foreign.Marshal.Alloc (allocaBytes)
Expand Down Expand Up @@ -40,4 +37,3 @@ foreign import CALLCONV safe "if_nametoindex"

foreign import CALLCONV safe "if_indextoname"
c_if_indextoname :: CUInt -> CString -> IO CString
#endif
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ AC_CHECK_DECLS([IPV6_V6ONLY])
AC_CHECK_DECLS([IPPROTO_IP, IPPROTO_TCP, IPPROTO_IPV6])
AC_CHECK_DECLS([SO_PEERCRED])
dnl AC_CHECK_DECLS is used instead of AC_CHECK_FUNCS for Windows
AC_CHECK_DECLS([getaddrinfo, if_nametoindex])
AC_CHECK_DECLS([getaddrinfo])

AC_CHECK_MEMBERS([struct msghdr.msg_control, struct msghdr.msg_accrights])
AC_CHECK_MEMBERS([struct sockaddr.sa_len])
Expand Down

0 comments on commit 3fa7caa

Please sign in to comment.