mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Add several dl.RTLD_ constants. Closes bug 110842.
This commit is contained in:
parent
ddef8887db
commit
df23f33f9b
1 changed files with 38 additions and 2 deletions
|
@ -181,6 +181,21 @@ static PyMethodDef dl_methods[] = {
|
||||||
{NULL, NULL} /* sentinel */
|
{NULL, NULL} /* sentinel */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* 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
|
void
|
||||||
initdl(void)
|
initdl(void)
|
||||||
{
|
{
|
||||||
|
@ -202,8 +217,29 @@ initdl(void)
|
||||||
PyDict_SetItemString(d, "error", x);
|
PyDict_SetItemString(d, "error", x);
|
||||||
x = PyInt_FromLong((long)RTLD_LAZY);
|
x = PyInt_FromLong((long)RTLD_LAZY);
|
||||||
PyDict_SetItemString(d, "RTLD_LAZY", x);
|
PyDict_SetItemString(d, "RTLD_LAZY", x);
|
||||||
|
#define INSINT(X) insint(d,#X,X)
|
||||||
#ifdef RTLD_NOW
|
#ifdef RTLD_NOW
|
||||||
x = PyInt_FromLong((long)RTLD_NOW);
|
INSINT(RTLD_NOW);
|
||||||
PyDict_SetItemString(d, "RTLD_NOW", x);
|
#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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue