diff options
author | Brian Curtin <brian@python.org> | 2012-05-13 16:19:23 (GMT) |
---|---|---|
committer | Brian Curtin <brian@python.org> | 2012-05-13 16:19:23 (GMT) |
commit | 401f9f3d32dcebf5ead8079d46a83fe7c7631581 (patch) | |
tree | 899600f4dad86565fd3585499e2332d2a3599d42 /PC/msvcrtmodule.c | |
parent | 708d88c33441b29760b9246d61844eb59c1d0f3a (diff) | |
download | cpython-401f9f3d32dcebf5ead8079d46a83fe7c7631581.zip cpython-401f9f3d32dcebf5ead8079d46a83fe7c7631581.tar.gz cpython-401f9f3d32dcebf5ead8079d46a83fe7c7631581.tar.bz2 |
Fix #13210. Port the Windows build from VS2008 to VS2010.
Diffstat (limited to 'PC/msvcrtmodule.c')
-rwxr-xr-x | PC/msvcrtmodule.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c index f277b0a..04d2088 100755 --- a/PC/msvcrtmodule.c +++ b/PC/msvcrtmodule.c @@ -27,6 +27,8 @@ #ifdef _MSC_VER #if _MSC_VER >= 1500 && _MSC_VER < 1600 #include <crtassem.h> +#elif _MSC_VER >= 1600 +#include <crtversion.h> #endif #endif @@ -464,7 +466,7 @@ PyMODINIT_FUNC PyInit_msvcrt(void) { int st; - PyObject *d; + PyObject *d, *version; PyObject *m = PyModule_Create(&msvcrtmodule); if (m == NULL) return NULL; @@ -494,6 +496,7 @@ PyInit_msvcrt(void) #endif /* constants for the crt versions */ + (void)st; #ifdef _VC_ASSEMBLY_PUBLICKEYTOKEN st = PyModule_AddStringConstant(m, "VC_ASSEMBLY_PUBLICKEYTOKEN", _VC_ASSEMBLY_PUBLICKEYTOKEN); @@ -510,5 +513,15 @@ PyInit_msvcrt(void) if (st < 0) return NULL; #endif + /* constants for the 2010 crt versions */ +#if defined(_VC_CRT_MAJOR_VERSION) && defined (_VC_CRT_MINOR_VERSION) && defined(_VC_CRT_BUILD_VERSION) && defined(_VC_CRT_RBUILD_VERSION) + version = PyUnicode_FromFormat("%d.%d.%d.%d", _VC_CRT_MAJOR_VERSION, + _VC_CRT_MINOR_VERSION, + _VC_CRT_BUILD_VERSION, + _VC_CRT_RBUILD_VERSION); + st = PyModule_AddObject(m, "CRT_ASSEMBLY_VERSION", version); + if (st < 0) return NULL; +#endif + return m; } |