#endif
#endif
-#ifdef S_IRUSR
+#if defined(S_IRUSR)&&defined(S_IWUSR)&&defined(S_IRGRP)&&defined(S_IROTH)
#define CREAT_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)
#else
#define CREAT_MODE 0644
#include <malloc.h>
+/* in Windows, this is a macro defined in malloc.h and not a function */
+#undef alloca
+
#if _lib_mallopt
#if __STD_C
int mallopt(int cmd, int value)
#include "vmhdr.h"
+/* for VirtualAlloc and friends */
+#if defined(_WIN32)
+#include <windows.h>
+#endif
+
/* Best-fit allocation method. This is based on a best-fit strategy
** using a splay tree for storage of lists of free blocks of the same
** size. Recent free blocks may be cached for fast reuse.