summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-11-30 19:28:27 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2008-11-30 19:28:27 (GMT)
commitbcb017f35338cc088fca90e942cf249ec868c2f0 (patch)
tree4fa0099fb6b1394637d898266562b230a36ef3a1 /PC
parent98b1b02fbf634257bd638dda021372df5b486fc1 (diff)
downloadcpython-bcb017f35338cc088fca90e942cf249ec868c2f0.zip
cpython-bcb017f35338cc088fca90e942cf249ec868c2f0.tar.gz
cpython-bcb017f35338cc088fca90e942cf249ec868c2f0.tar.bz2
Issue #4365: Add crtassem.h constants to the msvcrt module.
Diffstat (limited to 'PC')
-rwxr-xr-xPC/msvcrtmodule.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c
index 95e369b..cad22b1 100755
--- a/PC/msvcrtmodule.c
+++ b/PC/msvcrtmodule.c
@@ -22,6 +22,12 @@
#include <conio.h>
#include <sys/locking.h>
+#ifdef _MSC_VER
+#if _MSC_VER >= 1500
+#include <crtassem.h>
+#endif
+#endif
+
// Force the malloc heap to clean itself up, and free unused blocks
// back to the OS. (According to the docs, only works on NT.)
static PyObject *
@@ -298,6 +304,7 @@ static struct PyMethodDef msvcrt_functions[] = {
PyMODINIT_FUNC
initmsvcrt(void)
{
+ int st;
PyObject *d;
PyObject *m = Py_InitModule("msvcrt", msvcrt_functions);
if (m == NULL)
@@ -310,4 +317,21 @@ initmsvcrt(void)
insertint(d, "LK_NBRLCK", _LK_NBRLCK);
insertint(d, "LK_RLCK", _LK_RLCK);
insertint(d, "LK_UNLCK", _LK_UNLCK);
+
+ /* constants for the crt versions */
+#ifdef _VC_ASSEMBLY_PUBLICKEYTOKEN
+ st = PyModule_AddStringConstant(m, "VC_ASSEMBLY_PUBLICKEYTOKEN",
+ _VC_ASSEMBLY_PUBLICKEYTOKEN);
+ if (st < 0)return;
+#endif
+#ifdef _CRT_ASSEMBLY_VERSION
+ st = PyModule_AddStringConstant(m, "CRT_ASSEMBLY_VERSION",
+ _CRT_ASSEMBLY_VERSION);
+ if (st < 0)return;
+#endif
+#ifdef __LIBRARIES_ASSEMBLY_NAME_PREFIX
+ st = PyModule_AddStringConstant(m, "LIBRARIES_ASSEMBLY_NAME_PREFIX",
+ __LIBRARIES_ASSEMBLY_NAME_PREFIX);
+ if (st < 0)return;
+#endif
}