Index: nanohttp.c
===================================================================
--- nanohttp.c	(revision 3738)
+++ nanohttp.c	(working copy)
@@ -95,7 +95,7 @@
  * A couple portability macros
  */
 #ifndef _WINSOCKAPI_
-#ifndef __BEOS__
+#if !defined(__BEOS__) || defined(__HAIKU__)
 #define closesocket(s) close(s)
 #endif
 #define SOCKET int
@@ -844,7 +844,7 @@
 	status = ioctl(s, FIONBIO, &enable);
     }
 #else /* VMS */
-#if defined(__BEOS__)
+#if defined(__BEOS__) && !defined(__HAIKU__)
 	{
 		bool noblock = true;
 		status = setsockopt(s, SOL_SOCKET, SO_NONBLOCK, &noblock, sizeof(noblock));
Index: nanoftp.c
===================================================================
--- nanoftp.c	(revision 3738)
+++ nanoftp.c	(working copy)
@@ -89,7 +89,7 @@
  * A couple portability macros
  */
 #ifndef _WINSOCKAPI_
-#ifndef __BEOS__
+#if !defined(__BEOS__) || defined(__HAIKU__)
 #define closesocket(s) close(s)
 #endif
 #define SOCKET int
