Patched to compile, and work with pre-Vista versions of the Platform SDK.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 01 Apr 2007 03:04:20 +0000
changeset 875 6a5f06dbd423
parent 874 ad804f24633f
child 876 0d8e41a5c831
Patched to compile, and work with pre-Vista versions of the Platform SDK.
platform/windows.c
--- a/platform/windows.c	Sat Mar 31 23:44:42 2007 +0000
+++ b/platform/windows.c	Sun Apr 01 03:04:20 2007 +0000
@@ -41,6 +41,10 @@
 /* just in case... */
 #define PHYSFS_INVALID_FILE_ATTRIBUTES   0xFFFFFFFF
 
+/* Not defined before the Vista SDK. */
+#define PHYSFS_IO_REPARSE_TAG_SYMLINK    0xA000000C
+
+
 #define UTF8_TO_UNICODE_STACK_MACRO(w_assignto, str) { \
     if (str == NULL) \
         w_assignto = NULL; \
@@ -578,10 +582,10 @@
 } /* __PHYSFS_platformExists */
 
 
-static int isSymlinkAttrs(DWORD attr, DWORD tag)
+static int isSymlinkAttrs(const DWORD attr, const DWORD tag)
 {
-    return ( (attr & FILE_ATTRIBUTE_REPARSE_POINT) &&
-             ((tag & IO_REPARSE_TAG_SYMLINK) == IO_REPARSE_TAG_SYMLINK) );
+    return ( (attr & FILE_ATTRIBUTE_REPARSE_POINT) && 
+             (tag == PHYSFS_IO_REPARSE_TAG_SYMLINK) );
 } /* isSymlinkAttrs */
 
 
@@ -719,7 +723,7 @@
     {
         do
         {
-            const DWORD attrs = entw.dwFileAttributes;
+            const DWORD attr = entw.dwFileAttributes;
             const DWORD tag = entw.dwReserved0;
             const WCHAR *fn = entw.cFileName;
             if ((fn[0] == '.') && (fn[1] == '\0'))
@@ -742,7 +746,7 @@
     {
         do
         {
-            const DWORD attrs = ent.dwFileAttributes;
+            const DWORD attr = ent.dwFileAttributes;
             const DWORD tag = ent.dwReserved0;
             const char *fn = ent.cFileName;
             if ((fn[0] == '.') && (fn[1] == '\0'))