diff options
author | Armin Rigo <arigo@tunes.org> | 2015-05-16 21:04:52 +0200 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2015-05-16 21:04:52 +0200 |
commit | 92aeb09339ffa7c092d72a784826bc75f7d0b026 (patch) | |
tree | 705b6e2676509a2090f87f2283b4e75a3bb733ba /c/cffi1_module.c | |
parent | 18f51d8c3865007d4e25b2ef8fff65f8096f0906 (diff) | |
download | cffi-92aeb09339ffa7c092d72a784826bc75f7d0b026.tar.gz |
Add RTLD_xxx flags to the CompiledFFI type
Diffstat (limited to 'c/cffi1_module.c')
-rw-r--r-- | c/cffi1_module.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/c/cffi1_module.c b/c/cffi1_module.c index 1fd6965..09ff624 100644 --- a/c/cffi1_module.c +++ b/c/cffi1_module.c @@ -18,6 +18,7 @@ static PyTypeObject Lib_Type; /* forward */ static int init_ffi_lib(PyObject *m) { PyObject *x; + int i; if (PyType_Ready(&FFI_Type) < 0) return -1; @@ -38,6 +39,15 @@ static int init_ffi_lib(PyObject *m) (PyObject *)&CData_Type) < 0) return -1; + for (i = 0; all_dlopen_flags[i].name != NULL; i++) { + x = PyInt_FromLong(all_dlopen_flags[i].value); + if (x == NULL || PyDict_SetItemString(FFI_Type.tp_dict, + all_dlopen_flags[i].name, + x) < 0) + return -1; + Py_DECREF(x); + } + x = (PyObject *)&FFI_Type; Py_INCREF(x); if (PyModule_AddObject(m, "FFI", x) < 0) |