]> granicus.if.org Git - python/commitdiff
Make pythoncore compile cleanly with VisualStudio 2005. Used an explicit typecast...
authorKristján Valur Jónsson <kristjan@ccpgames.com>
Wed, 25 Apr 2007 00:17:39 +0000 (00:17 +0000)
committerKristján Valur Jónsson <kristjan@ccpgames.com>
Wed, 25 Apr 2007 00:17:39 +0000 (00:17 +0000)
Modules/_struct.c
Python/import.c
Python/pythonrun.c

index a4c82f765331c62d1a545afa27be90ecc87c2f86..78e88b0312fe2dbda32ccd8f51a13d358330d9e9 100644 (file)
@@ -849,7 +849,7 @@ bu_longlong(const char *p, const formatdef *f)
        } while (--i > 0);
        /* Extend the sign bit. */
        if (SIZEOF_LONG_LONG > f->size)
-               x |= -(x & (1L << ((8 * f->size) - 1)));
+               x |= -(x & ((PY_LONG_LONG)1 << ((8 * f->size) - 1)));
        if (x >= LONG_MIN && x <= LONG_MAX)
                return PyInt_FromLong(Py_SAFE_DOWNCAST(x, PY_LONG_LONG, long));
        return PyLong_FromLongLong(x);
@@ -1085,7 +1085,7 @@ lu_longlong(const char *p, const formatdef *f)
        } while (i > 0);
        /* Extend the sign bit. */
        if (SIZEOF_LONG_LONG > f->size)
-               x |= -(x & (1L << ((8 * f->size) - 1)));
+               x |= -(x & ((PY_LONG_LONG)1 << ((8 * f->size) - 1)));
        if (x >= LONG_MIN && x <= LONG_MAX)
                return PyInt_FromLong(Py_SAFE_DOWNCAST(x, PY_LONG_LONG, long));
        return PyLong_FromLongLong(x);
index 9151762081f40e6a9a60759ed0dfc90e1514ba98..383b6b20b1cb249d8b16ea55e0027ca18939c05e 100644 (file)
@@ -4,6 +4,7 @@
 #include "Python.h"
 
 #include "Python-ast.h"
+#undef Yield /* undefine macro conflicting with winbase.h */
 #include "pyarena.h"
 #include "pythonrun.h"
 #include "errcode.h"
index 3e5ecfe3f621c365175beed4eaa7513c1e22f308..96602ff15b5d32cffd96ca4b1ff292e49b8b06a0 100644 (file)
@@ -4,6 +4,7 @@
 #include "Python.h"
 
 #include "Python-ast.h"
+#undef Yield /* undefine macro conflicting with winbase.h */
 #include "grammar.h"
 #include "node.h"
 #include "token.h"