/* This is for mkdir(); this may need to be changed for some platforms. */
#include <sys/stat.h> /* For mkdir() */
+#if defined(_WIN32)
+#include <windows.h>
+#endif
+
/* Parse an octal number, ignoring leading and trailing nonsense. */
static int
parseoct(const char *p, size_t n)
pathname[strlen(pathname) - 1] = '\0';
/* Try creating the directory. */
- r = mkdir(pathname, mode);
+ #if defined(_WIN32)
+ r = _mkdir(pathname);
+ #else
+ r = mkdir(pathname, mode);
+ #endif
if (r != 0) {
/* On failure, try creating parent directory. */
*p = '\0';
create_dir(pathname, 0755);
*p = '/';
- r = mkdir(pathname, mode);
+ #if defined(_WIN32)
+ r = _mkdir(pathname);
+ #else
+ r = mkdir(pathname, mode);
+ #endif
}
}
if (r != 0)