[Python-checkins] CVS: python/dist/src/Modules dlmodule.c,2.13,2.14
Martin v. Löwis
python-dev@python.org
Wed, 13 Sep 2000 09:26:14 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv12100
Modified Files:
dlmodule.c
Log Message:
Add several dl.RTLD_ constants. Closes bug 110842.
Index: dlmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/dlmodule.c,v
retrieving revision 2.13
retrieving revision 2.14
diff -C2 -r2.13 -r2.14
*** dlmodule.c 2000/09/01 23:29:26 2.13
--- dlmodule.c 2000/09/13 16:26:10 2.14
***************
*** 182,185 ****
--- 182,200 ----
};
+ /* From socketmodule.c
+ * Convenience routine to export an integer value.
+ *
+ * Errors are silently ignored, for better or for worse...
+ */
+ static void
+ insint(PyObject *d, char *name, int value)
+ {
+ PyObject *v = PyInt_FromLong((long) value);
+ if (!v || PyDict_SetItemString(d, name, v))
+ PyErr_Clear();
+
+ Py_XDECREF(v);
+ }
+
void
initdl(void)
***************
*** 203,209 ****
x = PyInt_FromLong((long)RTLD_LAZY);
PyDict_SetItemString(d, "RTLD_LAZY", x);
#ifdef RTLD_NOW
! x = PyInt_FromLong((long)RTLD_NOW);
! PyDict_SetItemString(d, "RTLD_NOW", x);
#endif
}
--- 218,245 ----
x = PyInt_FromLong((long)RTLD_LAZY);
PyDict_SetItemString(d, "RTLD_LAZY", x);
+ #define INSINT(X) insint(d,#X,X)
#ifdef RTLD_NOW
! INSINT(RTLD_NOW);
! #endif
! #ifdef RTLD_NOLOAD
! INSINT(RTLD_NOLOAD);
! #endif
! #ifdef RTLD_GLOBAL
! INSINT(RTLD_GLOBAL);
! #endif
! #ifdef RTLD_LOCAL
! INSINT(RTLD_LOCAL);
! #endif
! #ifdef RTLD_PARENT
! INSINT(RTLD_PARENT);
! #endif
! #ifdef RTLD_GROUP
! INSINT(RTLD_GROUP);
! #endif
! #ifdef RTLD_WORLD
! INSINT(RTLD_WORLD);
! #endif
! #ifdef RTLD_NODELETE
! INSINT(RTLD_NODELETE);
#endif
}