-#ifdef __BEOS__
-# include <sys/socket.h>
-# include <netinet/in.h>
- /* not net_server ? */
-# include <BeBuild.h>
- /* R5 didn't have usleep, fake it. Haiku and Zeta has it now. */
-# if B_BEOS_VERSION <= B_BEOS_VERSION_5
-# include <OS.h>
- /* doesn't set errno but that's enough */
-# define usleep(t) snooze((bigtime_t)(t))
-# endif
-# ifndef SA_RESTART
-# warning SA_RESTART not implemented; ffserver might misbehave.
-# define SA_RESTART 0
-# endif
+static inline int is_dos_path(const char *path)
+{
+#if HAVE_DOS_PATHS
+ if (path[0] && path[1] == ':')
+ return 1;
+#endif
+ return 0;
+}
+
+#if defined(__OS2__) || defined(__Plan9__)
+#define SHUT_RD 0
+#define SHUT_WR 1
+#define SHUT_RDWR 2
+#endif
+
+#if defined(_WIN32)
+#define SHUT_RD SD_RECEIVE
+#define SHUT_WR SD_SEND
+#define SHUT_RDWR SD_BOTH
+
+#ifndef S_IRUSR
+#define S_IRUSR S_IREAD
+#endif
+#ifndef S_IWUSR
+#define S_IWUSR S_IWRITE
+#endif
+#endif
+
+#if CONFIG_NETWORK
+#if !HAVE_SOCKLEN_T
+typedef int socklen_t;