Author: Wim Lavrijsen <[email protected]>
Branch: reflex-support
Changeset: r45736:fce0d480d104
Date: 2011-07-19 02:54 -0700
http://bitbucket.org/pypy/pypy/changeset/fce0d480d104/
Log: enable global and now mode for dlopen
diff --git a/pypy/module/cppyy/interp_cppyy.py
b/pypy/module/cppyy/interp_cppyy.py
--- a/pypy/module/cppyy/interp_cppyy.py
+++ b/pypy/module/cppyy/interp_cppyy.py
@@ -18,8 +18,8 @@
NULL_VOIDP = lltype.nullptr(rffi.VOIDP.TO)
def load_lib(space, name):
- # TODO: allow open in RTLD_GLOBAL mode
- cdll = libffi.CDLL(name) #, 0x100 | 0x02)
+ # TODO: the following uses a hacked CDLL that won't work on Windows
+ cdll = libffi.CDLL(name, 0x100 | 0x02)
return W_CPPLibrary(space, cdll)
load_lib.unwrap_spec = [ObjSpace, str]
diff --git a/pypy/rlib/libffi.py b/pypy/rlib/libffi.py
--- a/pypy/rlib/libffi.py
+++ b/pypy/rlib/libffi.py
@@ -419,11 +419,11 @@
# XXX: it partially duplicate the code in clibffi.py
class CDLL(object):
- def __init__(self, libname):
+ def __init__(self, libname, mode=-1):
"""Load the library, or raises DLOpenError."""
self.lib = rffi.cast(DLLHANDLE, 0)
with rffi.scoped_str2charp(libname) as ll_libname:
- self.lib = dlopen(ll_libname)
+ self.lib = dlopen(ll_libname, mode)
def __del__(self):
if self.lib:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit