summaryrefslogtreecommitdiffstats
path: root/Include/modsupport.h
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-01-22 15:25:18 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-01-22 15:25:18 (GMT)
commit74b8e76ec1d85feacaa5e96b60a9c7f21026508f (patch)
tree07b20fdd26c0d2f54bb4d8ea3fef22658542b44b /Include/modsupport.h
parent690c91220e06b6e3214c8a8efc214db276967b09 (diff)
downloadcpython-74b8e76ec1d85feacaa5e96b60a9c7f21026508f.zip
cpython-74b8e76ec1d85feacaa5e96b60a9c7f21026508f.tar.gz
cpython-74b8e76ec1d85feacaa5e96b60a9c7f21026508f.tar.bz2
Don't repeat yourself
Added the macros PyModule_AddIntMacro and PyModule_AddStringMacro. They shorten PyModule_AddIntConstant(m, "AF_INET", AF_INET) to PyModule_AddIntMacro(m, AF_INET)
Diffstat (limited to 'Include/modsupport.h')
-rw-r--r--Include/modsupport.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Include/modsupport.h b/Include/modsupport.h
index 761d960..d4dddef 100644
--- a/Include/modsupport.h
+++ b/Include/modsupport.h
@@ -40,7 +40,8 @@ PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list);
PyAPI_FUNC(int) PyModule_AddObject(PyObject *, const char *, PyObject *);
PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long);
PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char *);
-
+#define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
+#define PyModule_AddStringMacro(m, c) PyModule_AddStringConstant(m, #c, c)
#define PYTHON_API_VERSION 1013
#define PYTHON_API_STRING "1013"