summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fios.cpp1
-rw-r--r--src/fios.h4
-rw-r--r--src/newgrf_config.cpp4
-rw-r--r--src/strings.cpp5
4 files changed, 4 insertions, 10 deletions
diff --git a/src/fios.cpp b/src/fios.cpp
index c8d7fdf8d..2f4d37d84 100644
--- a/src/fios.cpp
+++ b/src/fios.cpp
@@ -21,7 +21,6 @@
# include <io.h>
#else
# include <unistd.h>
-# include <dirent.h>
#endif /* WIN32 */
/* Variables to display file lists */
diff --git a/src/fios.h b/src/fios.h
index 0663b781b..591297076 100644
--- a/src/fios.h
+++ b/src/fios.h
@@ -80,6 +80,10 @@ struct DIR {
DIR *opendir(const wchar_t *path);
struct dirent *readdir(DIR *d);
int closedir(DIR *d);
+#else
+/* Use system-supplied opendir/readdir/closedir functions */
+# include <sys/types.h>
+# include <dirent.h>
#endif /* defined(WIN32) */
/**
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index 6b13ecc2e..fce274a87 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -16,14 +16,10 @@
#include "fileio.h"
#include "fios.h"
-#include <sys/types.h>
#include <sys/stat.h>
#ifdef WIN32
# include <io.h>
-#else
-# include <unistd.h>
-# include <dirent.h>
#endif /* WIN32 */
diff --git a/src/strings.cpp b/src/strings.cpp
index d1ab5df0c..3c344239c 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -24,13 +24,8 @@
#include "industry.h"
#include "helpers.hpp"
-#ifdef WIN32
/* for opendir/readdir/closedir */
# include "fios.h"
-#else
-# include <sys/types.h>
-# include <dirent.h>
-#endif /* WIN32 */
char _userstring[128];