summaryrefslogtreecommitdiff
path: root/gobject/gobjectmodule.c
diff options
context:
space:
mode:
authorJohn Ehresman <jpe@wingware.com>2010-04-13 16:22:45 -0400
committerJohn Ehresman <jpe@wingware.com>2010-04-15 12:16:49 -0400
commitc45311ac3845f42488590acc83c90034066efbde (patch)
tree9081a4c9d8dc7f504c508843117bb889a60568be /gobject/gobjectmodule.c
parent2e1c1f48b9ada382f99206789360f0d39f89bcb5 (diff)
downloadpygobject-c45311ac3845f42488590acc83c90034066efbde.tar.gz
Don't pregenerate numerical constants in constants.py; adapted from a John Stower patch
Diffstat (limited to 'gobject/gobjectmodule.c')
-rw-r--r--gobject/gobjectmodule.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index 9a10be56..267546fb 100644
--- a/gobject/gobjectmodule.c
+++ b/gobject/gobjectmodule.c
@@ -2530,6 +2530,22 @@ pygobject_register_api(PyObject *d)
static void
pygobject_register_constants(PyObject *m)
{
+ /* PyFloat_ return a new ref, and add object takes the ref */
+ PyModule_AddObject(m, "G_MINFLOAT", PyFloat_FromDouble(G_MINFLOAT));
+ PyModule_AddObject(m, "G_MAXFLOAT", PyFloat_FromDouble(G_MAXFLOAT));
+ PyModule_AddObject(m, "G_MINDOUBLE", PyFloat_FromDouble(G_MINDOUBLE));
+ PyModule_AddObject(m, "G_MAXDOUBLE", PyFloat_FromDouble(G_MAXDOUBLE));
+
+ PyModule_AddIntConstant(m, "G_MINSHORT", G_MINSHORT);
+ PyModule_AddIntConstant(m, "G_MAXSHORT", G_MAXSHORT);
+ PyModule_AddIntConstant(m, "G_MAXUSHORT", G_MAXUSHORT);
+ PyModule_AddIntConstant(m, "G_MININT", G_MININT);
+ PyModule_AddIntConstant(m, "G_MAXINT", G_MAXINT);
+ PyModule_AddIntConstant(m, "G_MAXUINT", G_MAXUINT);
+ PyModule_AddIntConstant(m, "G_MINLONG", G_MINLONG);
+ PyModule_AddIntConstant(m, "G_MAXLONG", G_MAXLONG);
+ PyModule_AddObject(m, "G_MAXULONG", PyLong_FromUnsignedLong(G_MAXULONG));
+
PyModule_AddIntConstant(m, "SIGNAL_RUN_FIRST", G_SIGNAL_RUN_FIRST);
PyModule_AddIntConstant(m, "SIGNAL_RUN_LAST", G_SIGNAL_RUN_LAST);
PyModule_AddIntConstant(m, "SIGNAL_RUN_CLEANUP", G_SIGNAL_RUN_CLEANUP);