#define LEVELFILE_EXTENSION "lvl"
#define TAPEFILE_EXTENSION "tap"
#define SCOREFILE_EXTENSION "sco"
+#endif
+
+#if defined(MSDOS) || defined(WIN32)
#define ERROR_FILENAME "error.out"
#endif
+#ifdef WIN32
+#ifndef S_IRGRP
+#define S_IRGRP S_IRUSR
+#endif
+#ifndef S_IROTH
+#define S_IROTH S_IRUSR
+#endif
+#ifndef S_IWGRP
+#define S_IWGRP S_IWUSR
+#endif
+#ifndef S_IWOTH
+#define S_IWOTH S_IWUSR
+#endif
+#ifndef S_IXGRP
+#define S_IXGRP S_IXUSR
+#endif
+#ifndef S_IXOTH
+#define S_IXOTH S_IXUSR
+#endif
+#endif
+
/* file permissions for newly written files */
#define MODE_R_ALL (S_IRUSR | S_IRGRP | S_IROTH)
#define MODE_W_ALL (S_IWUSR | S_IWGRP | S_IWOTH)
static void createDirectory(char *dir, char *text)
{
if (access(dir, F_OK) != 0)
+#ifdef WIN32
+ if (mkdir(dir) != 0)
+#else
if (mkdir(dir, USERDATA_DIR_MODE) != 0)
+#endif
Error(ERR_WARN, "cannot create %s directory '%s'", text, dir);
}
chmod(filename, SETUP_PERMS);
}
-#ifdef MSDOS
+#if defined(MSDOS) || defined(WIN32)
void initErrorFile()
{
char *filename;