diff options
author | Brian Curtin <brian@python.org> | 2012-05-13 11:19:23 -0500 |
---|---|---|
committer | Brian Curtin <brian@python.org> | 2012-05-13 11:19:23 -0500 |
commit | 24c2b4159481ae98df26a6dc727e4405d3d95b1d (patch) | |
tree | 1d4e9a544c7a38d47eca636f32738ce97f5b2d91 /PC/msvcrtmodule.c | |
parent | 8bad7bed5c43f8bbd989a94d83b1e70e6d048796 (diff) | |
download | cpython-24c2b4159481ae98df26a6dc727e4405d3d95b1d.tar.gz |
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 f277b0a64d..04d2088d29 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; } |