[pypy-commit] pypy default: use strigified _MSC_VER for the compiler version, like CPython

mattip pypy.commits at gmail.com
Sun Nov 10 18:16:35 EST 2019


Author: Matti Picus <matti.picus at gmail.com>
Branch: 
Changeset: r98011:f18d4c3047ec
Date: 2019-11-09 01:43 +0200
http://bitbucket.org/pypy/pypy/changeset/f18d4c3047ec/

Log:	use strigified _MSC_VER for the compiler version, like CPython

diff --git a/rpython/rlib/compilerinfo.py b/rpython/rlib/compilerinfo.py
--- a/rpython/rlib/compilerinfo.py
+++ b/rpython/rlib/compilerinfo.py
@@ -19,7 +19,7 @@
 
 if platform.name == 'msvc':
     # XXX hard-code the MSC version, I don't feel like computing it dynamically
-    _C_COMPILER_INFO = '"MSC v.%d 32 bit"' % (platform.version * 10 + 600)
+    _C_COMPILER_INFO = '"MSC v." Py_STR(_MSC_VER)'
 else:
     _C_COMPILER_INFO = '("GCC " __VERSION__)'
 
diff --git a/rpython/translator/c/src/commondefs.h b/rpython/translator/c/src/commondefs.h
--- a/rpython/translator/c/src/commondefs.h
+++ b/rpython/translator/c/src/commondefs.h
@@ -123,3 +123,7 @@
 #  define MS_WINDOWS    /* a synonym */
 #endif
 #endif
+
+/* stringify a constant */
+#define Py_XSTR(x)   #x
+#define Py_STR(x)  Py_XSTR(x)


More information about the pypy-commit mailing list