summaryrefslogtreecommitdiffstats
path: root/Modules/_struct.c
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2007-04-25 00:17:39 (GMT)
committerKristján Valur Jónsson <kristjan@ccpgames.com>2007-04-25 00:17:39 (GMT)
commit67387fb4aadbbe1dbb498398b0786ca01d92552e (patch)
treec300a2253ea35fcd0973a9e8a668481ab956dfeb /Modules/_struct.c
parent17b8e97e2e2c24322d45c33308212e0d6c32d934 (diff)
downloadcpython-67387fb4aadbbe1dbb498398b0786ca01d92552e.zip
cpython-67387fb4aadbbe1dbb498398b0786ca01d92552e.tar.gz
cpython-67387fb4aadbbe1dbb498398b0786ca01d92552e.tar.bz2
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
Diffstat (limited to 'Modules/_struct.c')
-rw-r--r--Modules/_struct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index a4c82f7..78e88b0 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -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);