Rev 3791: Extend the compatibility code for MSVC not having most of the stat macros. in http://bzr.arbash-meinel.com/branches/bzr/1.9-dev/msvc_python24

John Arbash Meinel john at arbash-meinel.com
Tue Oct 21 16:49:42 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.9-dev/msvc_python24

------------------------------------------------------------
revno: 3791
revision-id: john at arbash-meinel.com-20081021154929-0i32nlelpfz9m2f7
parent: john at arbash-meinel.com-20081021153817-9uvj763ty2k9cm1q
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: msvc_python24
timestamp: Tue 2008-10-21 10:49:29 -0500
message:
  Extend the compatibility code for MSVC not having most of the stat macros.
-------------- next part --------------
=== modified file 'bzrlib/python-compat.h'
--- a/bzrlib/python-compat.h	2008-09-26 05:14:51 +0000
+++ b/bzrlib/python-compat.h	2008-10-21 15:49:29 +0000
@@ -35,15 +35,27 @@
 #endif
 
 #if defined(_WIN32) || defined(WIN32)
-    /* Needed for htonl */
-    #include "Winsock.h"
-
     /* Defining WIN32_LEAN_AND_MEAN makes including windows quite a bit
      * lighter weight.
      */
     #define WIN32_LEAN_AND_MEAN
     #include <windows.h>
 
+    /* Needed for htonl */
+    #include "Winsock.h"
+
+    /* sys/stat.h doesn't have any of these macro definitions for MSVC, so
+     * we'll define whatever is missing that we actually use.
+     */
+    #if !defined(S_ISDIR)
+        #define S_ISDIR(m) (((m) & 0170000) == 0040000)
+    #endif
+    #if !defined(S_ISREG)
+        #define S_ISREG(m) (((m) & 0170000) == 0100000)
+    #endif
+    #if !defined(S_IXUSR)
+        #define S_IXUSR 0000100/* execute/search permission, owner */
+    #endif
     /* sys/stat.h doesn't have S_ISLNK on win32, so we fake it by just always
      * returning False
      */



More information about the bazaar-commits mailing list