##// END OF EJS Templates
base85: add version to help detect breaking binary changes
Jun Wu -
r32356:7948adb5 default
parent child Browse files
Show More
@@ -157,6 +157,8 b' static PyMethodDef methods[] = {'
157 {NULL, NULL}
157 {NULL, NULL}
158 };
158 };
159
159
160 static const int version = 1;
161
160 #ifdef IS_PY3K
162 #ifdef IS_PY3K
161 static struct PyModuleDef base85_module = {
163 static struct PyModuleDef base85_module = {
162 PyModuleDef_HEAD_INIT,
164 PyModuleDef_HEAD_INIT,
@@ -168,15 +170,20 b' static struct PyModuleDef base85_module '
168
170
169 PyMODINIT_FUNC PyInit_base85(void)
171 PyMODINIT_FUNC PyInit_base85(void)
170 {
172 {
173 PyObject *m;
171 b85prep();
174 b85prep();
172
175
173 return PyModule_Create(&base85_module);
176 m = PyModule_Create(&base85_module);
177 PyModule_AddIntConstant(m, "version", version);
178 return m;
174 }
179 }
175 #else
180 #else
176 PyMODINIT_FUNC initbase85(void)
181 PyMODINIT_FUNC initbase85(void)
177 {
182 {
178 Py_InitModule3("base85", methods, base85_doc);
183 PyObject *m;
184 m = Py_InitModule3("base85", methods, base85_doc);
179
185
180 b85prep();
186 b85prep();
187 PyModule_AddIntConstant(m, "version", version);
181 }
188 }
182 #endif
189 #endif
General Comments 0
You need to be logged in to leave comments. Login now