(svn r8823) -Fix (r8821): wrapping opendir to ottd-specific function failed on non-windows because this wrapper was only active for win32 (thx Rubidium)
authorDarkvater
Tue, 20 Feb 2007 09:46:10 +0000
changeset 6088 f1149b4ff932
parent 6087 bfa159e740d9
child 6089 533364efa098
(svn r8823) -Fix (r8821): wrapping opendir to ottd-specific function failed on non-windows because this wrapper was only active for win32 (thx Rubidium)
src/fios.cpp
src/fios.h
src/newgrf_config.cpp
src/strings.cpp
--- a/src/fios.cpp	Tue Feb 20 06:39:09 2007 +0000
+++ b/src/fios.cpp	Tue Feb 20 09:46:10 2007 +0000
@@ -21,7 +21,6 @@
 # include <io.h>
 #else
 # include <unistd.h>
-# include <dirent.h>
 #endif /* WIN32 */
 
 /* Variables to display file lists */
--- a/src/fios.h	Tue Feb 20 06:39:09 2007 +0000
+++ b/src/fios.h	Tue Feb 20 09:46:10 2007 +0000
@@ -80,6 +80,10 @@
 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) */
 
 /**
--- a/src/newgrf_config.cpp	Tue Feb 20 06:39:09 2007 +0000
+++ b/src/newgrf_config.cpp	Tue Feb 20 09:46:10 2007 +0000
@@ -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 */
 
 
--- a/src/strings.cpp	Tue Feb 20 06:39:09 2007 +0000
+++ b/src/strings.cpp	Tue Feb 20 09:46:10 2007 +0000
@@ -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];