[Python-checkins] r54947 - in python/trunk: Modules/_struct.c Python/import.c Python/pythonrun.c

kristjan.jonsson python-checkins at python.org
Wed Apr 25 02:17:42 CEST 2007


Author: kristjan.jonsson
Date: Wed Apr 25 02:17:39 2007
New Revision: 54947

Modified:
   python/trunk/Modules/_struct.c
   python/trunk/Python/import.c
   python/trunk/Python/pythonrun.c
Log:
Make pythoncore compile cleanly with VisualStudio 2005.  Used an explicit typecast to get a 64 bit integer, and undefined the Yield macro that conflicts with winbase.h

Modified: python/trunk/Modules/_struct.c
==============================================================================
--- python/trunk/Modules/_struct.c	(original)
+++ python/trunk/Modules/_struct.c	Wed Apr 25 02:17:39 2007
@@ -849,7 +849,7 @@
 	} 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 @@
 	} 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);

Modified: python/trunk/Python/import.c
==============================================================================
--- python/trunk/Python/import.c	(original)
+++ python/trunk/Python/import.c	Wed Apr 25 02:17:39 2007
@@ -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"

Modified: python/trunk/Python/pythonrun.c
==============================================================================
--- python/trunk/Python/pythonrun.c	(original)
+++ python/trunk/Python/pythonrun.c	Wed Apr 25 02:17:39 2007
@@ -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"


More information about the Python-checkins mailing list