Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix windows build on GHC 7.4 #25

Merged
merged 2 commits into from

2 participants

@hreinhardt

This probably also fixes issue #17

hreinhardt added some commits
@hreinhardt hreinhardt replace HAVE_WINSOCK_H with HAVE_WINSOCK2_H
since we are using winsock2.h we shouldn't use HAVE_WINSOCK_H.
ebdaf5d
@hreinhardt hreinhardt use #if instead of #ifdef for HAVE_DECL_IPV6_V6ONLY (continued)
In 2f4cafd not all occurences were changed
25927d0
@tibbe tibbe merged commit 25927d0 into haskell:stable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 3, 2012
  1. @hreinhardt

    replace HAVE_WINSOCK_H with HAVE_WINSOCK2_H

    hreinhardt authored
    since we are using winsock2.h we shouldn't use HAVE_WINSOCK_H.
Commits on Feb 8, 2012
  1. @hreinhardt

    use #if instead of #ifdef for HAVE_DECL_IPV6_V6ONLY (continued)

    hreinhardt authored
    In 2f4cafd not all occurences were changed
This page is out of date. Refresh to see the latest.
View
6 Network/BSD.hsc
@@ -166,7 +166,7 @@ instance Storable ServiceEntry where
return (ServiceEntry {
serviceName = s_name,
serviceAliases = s_aliases,
-#if defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS)
+#if defined(HAVE_WINSOCK2_H) && !defined(cygwin32_HOST_OS)
servicePort = PortNum (fromIntegral (s_port :: CShort)),
#else
-- s_port is already in network byte order, but it
@@ -263,7 +263,7 @@ instance Storable ProtocolEntry where
p_aliases <- (#peek struct protoent, p_aliases) p
>>= peekArray0 nullPtr
>>= mapM peekCString
-#if defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS)
+#if defined(HAVE_WINSOCK2_H) && !defined(cygwin32_HOST_OS)
-- With WinSock, the protocol number is only a short;
-- hoist it in as such, but represent it on the Haskell side
-- as a CInt.
@@ -359,7 +359,7 @@ instance Storable HostEntry where
return (HostEntry {
hostName = h_name,
hostAliases = h_aliases,
-#if defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS)
+#if defined(HAVE_WINSOCK2_H) && !defined(cygwin32_HOST_OS)
hostFamily = unpackFamily (fromIntegral (h_addrtype :: CShort)),
#else
hostFamily = unpackFamily h_addrtype,
View
10 Network/Socket.hsc
@@ -169,7 +169,7 @@ import Hugs.IO ( openFd )
# if HAVE_STRUCT_MSGHDR_MSG_CONTROL || HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
{-# CFILES cbits/ancilData.c #-}
# endif
-# if defined(HAVE_WINSOCK_H) && !defined(__CYGWIN__)
+# if defined(HAVE_WINSOCK2_H) && !defined(__CYGWIN__)
{-# CFILES cbits/initWinSock.c cbits/winSockErr.c #-}
# endif
#endif
@@ -423,7 +423,7 @@ socket family stype protocol = do
#endif
socket_status <- newMVar NotConnected
let sock = MkSocket fd family stype protocol socket_status
-#ifdef HAVE_DECL_IPV6_V6ONLY
+#if HAVE_DECL_IPV6_V6ONLY
when (family == AF_INET6) $ setSocketOption sock IPv6Only 0
#endif
return sock
@@ -505,7 +505,7 @@ connect sock@(MkSocket s _family _stype _protocol socketStatus) addr = do
r <- c_connect s p_addr (fromIntegral sz)
if r == -1
then do
-#if !(defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS))
+#if !(defined(HAVE_WINSOCK2_H) && !defined(cygwin32_HOST_OS))
err <- getErrno
case () of
_ | err == eINTR -> connectLoop
@@ -921,7 +921,7 @@ data SocketOption
#ifdef SO_USELOOPBACK
| UseLoopBack {- SO_USELOOPBACK -}
#endif
-#ifdef HAVE_DECL_IPV6_V6ONLY
+#if HAVE_DECL_IPV6_V6ONLY
| IPv6Only {- IPV6_V6ONLY -}
#endif
deriving Typeable
@@ -938,7 +938,7 @@ socketOptLevel so =
#ifdef TCP_NODELAY
NoDelay -> #const IPPROTO_TCP
#endif
-#ifdef HAVE_DECL_IPV6_V6ONLY
+#if HAVE_DECL_IPV6_V6ONLY
IPv6Only -> #const IPPROTO_IPV6
#endif
_ -> #const SOL_SOCKET
View
3  cbits/asyncAccept.c
@@ -5,7 +5,8 @@
#include "HsNet.h"
#include "HsFFI.h"
-#if defined(HAVE_WINSOCK_H) && !defined(__CYGWIN__) && !defined(__HUGS__)
+#if defined(HAVE_WINSOCK2_H) && !defined(__CYGWIN__) && !defined(__HUGS__)
+
/* all the way to the end */
/*
View
2  cbits/initWinSock.c
@@ -1,7 +1,7 @@
#include "HsNet.h"
#include "HsFFI.h"
-#if defined(HAVE_WINSOCK_H) && !defined(__CYGWIN__)
+#if defined(HAVE_WINSOCK2_H) && !defined(__CYGWIN__)
static int winsock_inited = 0;
static int winsock_uninited = 0;
View
2  cbits/winSockErr.c
@@ -1,7 +1,7 @@
#include "HsNet.h"
#include "HsFFI.h"
-#if defined(HAVE_WINSOCK_H) && !defined(__CYGWIN__)
+#if defined(HAVE_WINSOCK2_H) && !defined(__CYGWIN__)
#include <stdio.h>
/* to the end */
View
2  include/HsNet.h
@@ -174,7 +174,7 @@ hsnet_freeaddrinfo(struct addrinfo *ai)
}
#endif
-#if defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS)
+#if defined(HAVE_WINSOCK2_H) && !defined(cygwin32_HOST_OS)
# define WITH_WINSOCK 1
#endif
Something went wrong with that request. Please try again.