]> granicus.if.org Git - python/commitdiff
Some VS 6.0 compatibility fixes from Hirokazu Yamamoto which are also useful for...
authorChristian Heimes <christian@cheimes.de>
Fri, 4 Jan 2008 13:33:00 +0000 (13:33 +0000)
committerChristian Heimes <christian@cheimes.de>
Fri, 4 Jan 2008 13:33:00 +0000 (13:33 +0000)
Include/abstract.h
Modules/errnomodule.c
Modules/selectmodule.c
Modules/socketmodule.h
Objects/longobject.c
PC/msvcrtmodule.c

index 468afe9ce252fdffca3a6665e2341b3b8fd59eda..dc216921b60da4927211c52ae3b5a7ef37cf84a4 100644 (file)
@@ -570,11 +570,11 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
           error (i.e. the object does not have a buffer interface or
           it is not working).
 
-          If fortran is 'F', then if the object is multi-dimensional,
+          If fort is 'F', then if the object is multi-dimensional,
           then the data will be copied into the array in
           Fortran-style (first dimension varies the fastest).  If
-          fortran is 'C', then the data will be copied into the array
-          in C-style (last dimension varies the fastest).  If fortran
+          fort is 'C', then the data will be copied into the array
+          in C-style (last dimension varies the fastest).  If fort
           is 'A', then it does not matter and the copy will be made
           in whatever way is more efficient.
 
@@ -585,7 +585,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
         /* Copy the data from the src buffer to the buffer of destination
          */
 
-     PyAPI_FUNC(int) PyBuffer_IsContiguous(Py_buffer *view, char fortran);
+     PyAPI_FUNC(int) PyBuffer_IsContiguous(Py_buffer *view, char fort);
 
 
      PyAPI_FUNC(void) PyBuffer_FillContiguousStrides(int ndims, 
@@ -595,7 +595,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
                                                    char fort);
 
                /*  Fill the strides array with byte-strides of a contiguous
-            (Fortran-style if fortran is 'F' or C-style otherwise)
+            (Fortran-style if fort is 'F' or C-style otherwise)
             array of the given shape with the given number of bytes
             per element.
         */
index b1beb0004bf6c5e720027e6e5f8f61222c9d8b64..ab4b5f19bd677bfda7384bda44285ba83757a53d 100644 (file)
@@ -5,6 +5,7 @@
 
 /* Windows socket errors (WSA*)  */
 #ifdef MS_WINDOWS
+#define WIN32_LEAN_AND_MEAN
 #include <winsock.h>
 #endif
 
index c4ebecc1cf31a22e45ea9d577e5d9cf2a00786dc..168197bfccd9071eb4b720436d9a220d65143f11 100644 (file)
@@ -44,6 +44,7 @@ extern void bzero(void *, int);
 #endif
 
 #ifdef MS_WINDOWS
+#  define WIN32_LEAN_AND_MEAN
 #  include <winsock.h>
 #else
 #  define SOCKET int
index 135b7166bf7b2f844c7c88d18a482bd265597669..1df1ae62b9e962822aecb91a972d8f66a1a3aa80 100644 (file)
@@ -22,6 +22,7 @@
 # define HAVE_GETNAMEINFO
 # define ENABLE_IPV6
 #else
+# define WIN32_LEAN_AND_MEAN
 # include <winsock.h>
 #endif
 #endif
index 40aaba1e181e71dc3e3067bd435c5f33d454b7ce..dc7ce87afceb25e07682475938db7fc4fa4e1631 100644 (file)
@@ -3530,7 +3530,7 @@ long_getnewargs(PyLongObject *v)
 
 static PyObject *
 long_getN(PyLongObject *v, void *context) {
-       return PyLong_FromLong((intptr_t)context);
+       return PyLong_FromLong((Py_intptr_t)context);
 }
 
 static PyObject *
index a137ed0bb9059e30d815465f4f7dcc826562b47e..eeee99f1c0d434399d34d0be5b34efe04c257a22 100755 (executable)
@@ -145,6 +145,7 @@ msvcrt_getch(PyObject *self, PyObject *args)
        return PyString_FromStringAndSize(s, 1);
 }
 
+#if _MSC_VER >= 1300
 static PyObject *
 msvcrt_getwch(PyObject *self, PyObject *args)
 {
@@ -160,6 +161,7 @@ msvcrt_getwch(PyObject *self, PyObject *args)
        u[0] = ch;
        return PyUnicode_FromUnicode(u, 1);
 }
+#endif
 
 static PyObject *
 msvcrt_getche(PyObject *self, PyObject *args)
@@ -177,6 +179,7 @@ msvcrt_getche(PyObject *self, PyObject *args)
        return PyString_FromStringAndSize(s, 1);
 }
 
+#if _MSC_VER >= 1300
 static PyObject *
 msvcrt_getwche(PyObject *self, PyObject *args)
 {
@@ -192,6 +195,7 @@ msvcrt_getwche(PyObject *self, PyObject *args)
        s[0] = ch;
        return PyUnicode_FromUnicode(s, 1);
 }
+#endif
 
 static PyObject *
 msvcrt_putch(PyObject *self, PyObject *args)
@@ -207,6 +211,7 @@ msvcrt_putch(PyObject *self, PyObject *args)
 }
 
 
+#if _MSC_VER >= 1300
 static PyObject *
 msvcrt_putwch(PyObject *self, PyObject *args)
 {
@@ -225,6 +230,7 @@ msvcrt_putwch(PyObject *self, PyObject *args)
        Py_RETURN_NONE;
 
 }
+#endif
 
 static PyObject *
 msvcrt_ungetch(PyObject *self, PyObject *args)
@@ -240,6 +246,7 @@ msvcrt_ungetch(PyObject *self, PyObject *args)
        return Py_None;
 }
 
+#if _MSC_VER >= 1300
 static PyObject *
 msvcrt_ungetwch(PyObject *self, PyObject *args)
 {
@@ -253,6 +260,7 @@ msvcrt_ungetwch(PyObject *self, PyObject *args)
        Py_INCREF(Py_None);
        return Py_None;
 }
+#endif
 
 static void
 insertint(PyObject *d, char *name, int value)
@@ -341,10 +349,12 @@ static struct PyMethodDef msvcrt_functions[] = {
        {"CrtSetReportMode",    msvcrt_setreportmode, METH_VARARGS},
        {"set_error_mode",      msvcrt_seterrormode, METH_VARARGS},
 #endif
+#if _MSC_VER >= 1300
        {"getwch",              msvcrt_getwch, METH_VARARGS},
        {"getwche",             msvcrt_getwche, METH_VARARGS},
        {"putwch",              msvcrt_putwch, METH_VARARGS},
        {"ungetwch",            msvcrt_ungetwch, METH_VARARGS},
+#endif
        {NULL,                  NULL}
 };