Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Detect IPPROTO_* via configure #112

Merged
merged 1 commit into from

2 participants

@rwbarton

On Android these are not macros, but rather defined in an enum.

@rwbarton rwbarton Detect IPPROTO_* via configure
On Android these are not macros, but rather defined in an enum.
f8f78a8
@tibbe tibbe merged commit f8f78a8 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 9, 2013
  1. @rwbarton

    Detect IPPROTO_* via configure

    rwbarton authored
    On Android these are not macros, but rather defined in an enum.
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 6 deletions.
  1. +6 −6 Network/Socket.hsc
  2. +5 −0 configure.ac
View
12 Network/Socket.hsc
@@ -920,12 +920,12 @@ packSocketOption so =
Just UseLoopBack -> Just ((#const SOL_SOCKET), (#const SO_USELOOPBACK))
#endif
#endif // SOL_SOCKET
-#ifdef IPPROTO_IP
+#if HAVE_DECL_IPPROTO_IP
#ifdef IP_TTL
Just TimeToLive -> Just ((#const IPPROTO_IP), (#const IP_TTL))
#endif
-#endif // IPPROTO_IP
-#ifdef IPPROTO_TCP
+#endif // HAVE_DECL_IPPROTO_IP
+#if HAVE_DECL_IPPROTO_TCP
#ifdef TCP_MAXSEG
Just MaxSegment -> Just ((#const IPPROTO_TCP), (#const TCP_MAXSEG))
#endif
@@ -935,12 +935,12 @@ packSocketOption so =
#ifdef TCP_CORK
Just Cork -> Just ((#const IPPROTO_TCP), (#const TCP_CORK))
#endif
-#endif // IPPROTO_TCP
-#ifdef IPPROTO_IPV6
+#endif // HAVE_DECL_IPPROTO_TCP
+#if HAVE_DECL_IPPROTO_IPV6
#if HAVE_DECL_IPV6_V6ONLY
Just IPv6Only -> Just ((#const IPPROTO_IPV6), (#const IPV6_V6ONLY))
#endif
-#endif // IPPROTO_IPV6
+#endif // HAVE_DECL_IPPROTO_IPV6
_ -> Nothing
-- | Return the option level and option value if they exist,
View
5 configure.ac
@@ -140,6 +140,11 @@ dnl * test for IPV6_V6ONLY flags that not all implementations have
dnl -------------------------------------------------------
AC_CHECK_DECLS([IPV6_V6ONLY])
+dnl -------------------------------------------------------
+dnl * test for IPPROTO_* macros/constants
+dnl -------------------------------------------------------
+AC_CHECK_DECLS([IPPROTO_IP, IPPROTO_TCP, IPPROTO_IPV6])
+
dnl --------------------------------------------------
dnl * test for Linux sendfile(2)
dnl --------------------------------------------------
Something went wrong with that request. Please try again.