[pypy-commit] pypy default: cpyext: Add two PyModule_Add* macros, directly copied from CPython.

amauryfa noreply at buildbot.pypy.org
Mon Oct 22 00:33:24 CEST 2012


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r58330:d10505b9c736
Date: 2012-10-21 14:28 +0200
http://bitbucket.org/pypy/pypy/changeset/d10505b9c736/

Log:	cpyext: Add two PyModule_Add* macros, directly copied from CPython.

diff --git a/pypy/module/cpyext/include/modsupport.h b/pypy/module/cpyext/include/modsupport.h
--- a/pypy/module/cpyext/include/modsupport.h
+++ b/pypy/module/cpyext/include/modsupport.h
@@ -35,6 +35,8 @@
 int PyModule_AddObject(PyObject *m, const char *name, PyObject *o);
 int PyModule_AddIntConstant(PyObject *m, const char *name, long value);
 int PyModule_AddStringConstant(PyObject *m, const char *name, const char *value);
+#define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
+#define PyModule_AddStringMacro(m, c) PyModule_AddStringConstant(m, #c, c)
 
 
 PyObject * Py_BuildValue(const char *, ...);


More information about the pypy-commit mailing list