#ifdef _MSC_VER
#include <Winsock2.h>
+#include <ws2tcpip.h>
#else
#ifndef MINGW
#include <netdb.h>
#include <stdarg.h>
#include <errno.h>
#include <signal.h>
+#ifdef WINDOWS
+#include <malloc.h> /* for alloca(), on other OSes it's in stdlib.h */
+#endif
#ifndef _MSC_VER
#include <unistd.h> /* KLB_FIX */
#endif
#endif
#ifdef SOLARIS
#include <sys/sockio.h>
+#include <sys/filio.h>
#include <sys/loadavg.h>
#include <semaphore.h>
#endif
+#if HAVE_UCRED_H
+#include <ucred.h>
+#endif
#ifdef CYGWIN
#include <windows.h>
#include <cygwin/if.h>
#include <vfork.h>
#endif
-#if HAVE_CTYPE_H
#include <ctype.h>
-#endif
#if HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
+#if HAVE_ENDIAN_H
+#include <endian.h>
+#endif
+#if HAVE_SYS_ENDIAN_H
+#include <sys/endian.h>
+#endif
+
#include "plibc.h"
#include <locale.h>