2010-02-06 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / io-layer / socket-wrappers.h
index 3592da609f7c16ddf90b8faebf9c91e2e0d22784..b6700f3348d6f84bde56caa798275ab59250c4cf 100644 (file)
@@ -6,12 +6,21 @@
  */
 
 #include <config.h>
+#ifdef HAVE_SYS_SELECT_H
+#  include <sys/select.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#  include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#  include <sys/socket.h>
+#endif
 
 #ifndef HAVE_SOCKLEN_T
 #define socklen_t int
 #endif
 
-#ifdef PLATFORM_WIN32
+#ifdef HOST_WIN32
 #define _wapi_accept accept 
 #define _wapi_bind bind 
 #define _wapi_connect connect 
@@ -68,12 +77,15 @@ extern int _wapi_shutdown(guint32 handle, int how);
 extern guint32 _wapi_socket(int domain, int type, int protocol, void *unused,
                            guint32 unused2, guint32 flags);
 extern struct hostent *_wapi_gethostbyname(const char *hostname);
+
+#ifdef HAVE_SYS_SELECT_H
 extern int _wapi_select(int nfds, fd_set *readfds, fd_set *writefds,
                        fd_set *exceptfds, struct timeval *timeout);
 
 extern void _wapi_FD_CLR(guint32 handle, fd_set *set);
 extern int _wapi_FD_ISSET(guint32 handle, fd_set *set);
 extern void _wapi_FD_SET(guint32 handle, fd_set *set);
+#endif
 
-#endif /* PLATFORM_WIN32 */
+#endif /* HOST_WIN32 */