~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-09-25 22:22:22 UTC
  • mto: This revision was merged to the branch mainline in revision 3740.
  • Revision ID: john@arbash-meinel.com-20080925222222-tnqd86ru8jv2q3jy
Move more compatibility code into python-compat.h

Update the definitions and extension compiling so that the faster iter
changes now builds on win32.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    #define PyInt_AsSsize_t(o) PyInt_AsLong(o)
35
35
#endif
36
36
 
 
37
#if defined(_WIN32) || defined(WIN32)
 
38
    /* Needed for htonl */
 
39
    #include "Winsock.h"
 
40
 
 
41
    /* Defining WIN32_LEAN_AND_MEAN makes including windows quite a bit
 
42
     * lighter weight.
 
43
     */
 
44
    #define WIN32_LEAN_AND_MEAN
 
45
    #include <windows.h>
 
46
 
 
47
    /* sys/stat.h doesn't have S_ISLNK on win32, so we fake it by just always
 
48
     * returning False
 
49
     */
 
50
    #define S_ISLNK(mode) (0)
 
51
#else /* Not win32 */
 
52
    /* For htonl */
 
53
    #include "arpa/inet.h"
37
54
#endif
 
55
 
 
56
 
 
57
#endif /* _BZR_PYTHON_COMPAT_H */