[Box Backup-dev] COMMIT r379 - box/chris/win32/vc2005-compile-fixes/lib/win32

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Sat, 4 Feb 2006 14:56:16 +0000 (GMT)


Author: chris
Date: 2006-02-04 14:56:13 +0000 (Sat, 04 Feb 2006)
New Revision: 379

Modified:
   box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp
   box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h
Log:
* emu.cpp, emu.h
- Use the emulated functions, which return file names in UTF-8, when
  compiling with MinGW, rather than the standard ones in <dirent.h>


Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp	2006-02-04 14:54:57 UTC (rev 378)
+++ box/chris/win32/vc2005-compile-fixes/lib/win32/emu.cpp	2006-02-04 14:56:13 UTC (rev 379)
@@ -620,14 +620,6 @@
 	return 0;
 }
 
-
-
-
-
-// MinGW provides opendir(), etc. via <dirent.h>
-// MSVC does not provide these, so emulation is needed
-
-#ifndef __MINGW32__
 // --------------------------------------------------------------------------
 //
 // Function
@@ -739,9 +731,10 @@
 	return NULL;
 }
 
-//this kinda makes it not thread friendly!
-//but I don't think it needs to be.
+// this kinda makes it not thread friendly!
+// but I don't think it needs to be.
 char tempbuff[MAX_PATH];
+
 // --------------------------------------------------------------------------
 //
 // Function
@@ -821,7 +814,6 @@
 	}
 	return -1;
 }
-#endif // !__MINGW32__
 
 // --------------------------------------------------------------------------
 //

Modified: box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h	2006-02-04 14:54:57 UTC (rev 378)
+++ box/chris/win32/vc2005-compile-fixes/lib/win32/emu.h	2006-02-04 14:56:13 UTC (rev 379)
@@ -272,33 +272,31 @@
 	return _mkdir(pathname);
 }
 
-#ifdef __MINGW32__
-	#include <dirent.h>
-#else
-	inline int strcasecmp(const char *s1, const char *s2)
-	{
-		return _stricmp(s1,s2);
-	}
+#ifndef __MINGW32__
+inline int strcasecmp(const char *s1, const char *s2)
+{
+	return _stricmp(s1,s2);
+}
+#endif
 
-	struct dirent
-	{
-		char *d_name;
-	};
+struct dirent
+{
+	char *d_name;
+};
 
-	struct DIR
-	{
-		intptr_t		fd;	// filedescriptor
-		// struct _finddata_t	info;
-		struct _wfinddata_t	info;
-		// struct _finddata_t 	info;
-		struct dirent		result;	// d_name (first time null)
-		wchar_t			*name;	// null-terminated byte string
-	};
+struct DIR
+{
+	intptr_t		fd;	// filedescriptor
+	// struct _finddata_t	info;
+	struct _wfinddata_t	info;
+	// struct _finddata_t 	info;
+	struct dirent		result;	// d_name (first time null)
+	wchar_t			*name;	// null-terminated byte string
+};
 
-	DIR *opendir(const char *name);
-	struct dirent *readdir(DIR *dp);
-	int closedir(DIR *dp);
-#endif
+DIR *opendir(const char *name);
+struct dirent *readdir(DIR *dp);
+int closedir(DIR *dp);
 
 HANDLE openfile(const char *filename, int flags, int mode);