Commits

Armin Rigo  committed ba68574

Fix: even if there are libraries listed, fall back to look in
the standard C library if the symbol is not found elsewhere.

  • Participants
  • Parent commits 68cacc8

Comments (0)

Files changed (1)

File pypy/rpython/lltypesystem/ll2ctypes.py

     libraries = eci.testonly_libraries + eci.libraries + eci.frameworks
 
     FUNCTYPE = lltype.typeOf(funcptr).TO
-    if not libraries:
-        cfunc = get_on_lib(standard_c_lib, funcname)
-        # XXX magic: on Windows try to load the function from 'kernel32' too
-        if cfunc is None and hasattr(ctypes, 'windll'):
-            cfunc = get_on_lib(ctypes.windll.kernel32, funcname)
-    else:
-        cfunc = None
+    cfunc = None
+    if libraries:
         not_found = []
         for libname in libraries:
             libpath = None
                 not_found.append(libname)
 
     if cfunc is None:
+        cfunc = get_on_lib(standard_c_lib, funcname)
+        # XXX magic: on Windows try to load the function from 'kernel32' too
+        if cfunc is None and hasattr(ctypes, 'windll'):
+            cfunc = get_on_lib(ctypes.windll.kernel32, funcname)
+
+    if cfunc is None:
         # function name not found in any of the libraries
         if not libraries:
             place = 'the standard C library (missing libraries=...?)'