~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/python-compat.h

  • Committer: John Arbash Meinel
  • Date: 2008-10-21 15:49:29 UTC
  • mto: This revision was merged to the branch mainline in revision 3792.
  • Revision ID: john@arbash-meinel.com-20081021154929-0i32nlelpfz9m2f7
Extend the compatibility code for MSVC not having most of the stat macros.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#endif
36
36
 
37
37
#if defined(_WIN32) || defined(WIN32)
38
 
    /* Needed for htonl */
39
 
    #include "Winsock.h"
40
 
 
41
38
    /* Defining WIN32_LEAN_AND_MEAN makes including windows quite a bit
42
39
     * lighter weight.
43
40
     */
44
41
    #define WIN32_LEAN_AND_MEAN
45
42
    #include <windows.h>
46
43
 
 
44
    /* Needed for htonl */
 
45
    #include "Winsock.h"
 
46
 
 
47
    /* sys/stat.h doesn't have any of these macro definitions for MSVC, so
 
48
     * we'll define whatever is missing that we actually use.
 
49
     */
 
50
    #if !defined(S_ISDIR)
 
51
        #define S_ISDIR(m) (((m) & 0170000) == 0040000)
 
52
    #endif
 
53
    #if !defined(S_ISREG)
 
54
        #define S_ISREG(m) (((m) & 0170000) == 0100000)
 
55
    #endif
 
56
    #if !defined(S_IXUSR)
 
57
        #define S_IXUSR 0000100/* execute/search permission, owner */
 
58
    #endif
47
59
    /* sys/stat.h doesn't have S_ISLNK on win32, so we fake it by just always
48
60
     * returning False
49
61
     */