diff options
author | Christian Heimes <christian@cheimes.de> | 2008-01-22 15:25:18 +0000 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-01-22 15:25:18 +0000 |
commit | 1a46bfa397b5cfe6b5466cce0b4c5a83ba685de1 (patch) | |
tree | 7b60a5d6dd2769235993d5e4c74fcf43d887bb2a /Include | |
parent | 106819fbcd55deeecb3a8a7679fbdc1932e3aa39 (diff) | |
download | cpython-1a46bfa397b5cfe6b5466cce0b4c5a83ba685de1.tar.gz |
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')
-rw-r--r-- | Include/modsupport.h | 3 |
1 files changed, 2 insertions, 1 deletions
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" |