--- a/netserver/CMakeLists.txt Wed Oct 22 15:31:35 2008 +0000
+++ b/netserver/CMakeLists.txt Wed Oct 22 15:40:49 2008 +0000
@@ -14,6 +14,7 @@
set(hwserv_main ${hedgewars_SOURCE_DIR}/netserver/hedgewars-server.hs)
set(ghc_flags
+ -cpp
--make ${hwserv_main}
-i${hedgewars_SOURCE_DIR}/netserver
-o ${EXECUTABLE_OUTPUT_PATH}/hedgewars-server${CMAKE_EXECUTABLE_SUFFIX}
--- a/netserver/hedgewars-server.hs Wed Oct 22 15:31:35 2008 +0000
+++ b/netserver/hedgewars-server.hs Wed Oct 22 15:40:49 2008 +0000
@@ -12,7 +12,11 @@
import Miscutils
import HWProto
import Opts
+
+#ifndef WIN32
import System.Posix
+#endif
+
acceptLoop :: Socket -> TChan ClientInfo -> IO ()
acceptLoop servSock acceptChan = do
@@ -97,7 +101,9 @@
main = withSocketsDo $ do
+#ifndef WIN32
installHandler sigPIPE Ignore Nothing;
+#endif
putStrLn $ "Listening on port " ++ show (listenPort globalOptions)
serverSocket <- listenOn $ PortNumber (listenPort globalOptions)
startServer serverSocket `finally` sClose serverSocket