From 74b8e76ec1d85feacaa5e96b60a9c7f21026508f Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Tue, 22 Jan 2008 15:25:18 +0000 Subject: 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) --- Include/modsupport.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Include') diff --git a/Include/modsupport.h b/Include/modsupport.h index 761d960991..d4dddef0b5 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" -- cgit v1.2.1