[pygobject] Set constants under python 2.5 or before
- From: John Ehresman <jpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Set constants under python 2.5 or before
- Date: Wed, 21 Apr 2010 00:41:29 +0000 (UTC)
commit a579ccc8bea90937bf970be3d461e2b650b0c7d6
Author: John Ehresman <jpe wingware com>
Date: Tue Apr 20 20:01:53 2010 -0400
Set constants under python 2.5 or before
gobject/gobjectmodule.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index 6fc7b51..be0bc0b 100644
--- a/gobject/gobjectmodule.c
+++ b/gobject/gobjectmodule.c
@@ -2546,8 +2546,16 @@ pygobject_register_constants(PyObject *m)
PyModule_AddObject(m, "G_MININT64", PyLong_FromLongLong(G_MININT64));
PyModule_AddObject(m, "G_MAXINT64", PyLong_FromLongLong(G_MAXINT64));
PyModule_AddObject(m, "G_MAXUINT64", PyLong_FromUnsignedLongLong(G_MAXUINT64));
+#if PY_VERSION_HEX < 0x02050000 /* 2.3, 2.4 */
+ PyModule_AddObject(m, "G_MAXSIZE", PyLong_FromUnsignedLongLong(G_MAXSIZE));
+ PyModule_AddObject(m, "G_MAXSSIZE", PyLong_FromUnsignedLongLong(G_MAXSSIZE));
+#elif PY_VERSION_HEX < 0x02060000 /* 2.5 */
+ PyModule_AddObject(m, "G_MAXSIZE", _PyLong_FromSize_t(G_MAXSIZE));
+ PyModule_AddObject(m, "G_MAXSSIZE", _PyLong_FromSsize_t(G_MAXSSIZE));
+#else /* 2.6+ */
PyModule_AddObject(m, "G_MAXSIZE", PyLong_FromSize_t(G_MAXSIZE));
PyModule_AddObject(m, "G_MAXSSIZE", PyLong_FromSsize_t(G_MAXSSIZE));
+#endif
PyModule_AddObject(m, "G_MINOFFSET", PyLong_FromLongLong(G_MINOFFSET));
PyModule_AddObject(m, "G_MAXOFFSET", PyLong_FromLongLong(G_MAXOFFSET));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]