Commits

mattip committed beb4c02

create export library

Comments (0)

Files changed (4)

rpython/jit/backend/x86/codebuf.py

 from rpython.jit.backend.x86.regloc import LocationCodeBuilder
 from rpython.jit.backend.x86.arch import IS_X86_32, IS_X86_64, WORD
 from rpython.jit.backend.x86 import valgrind
-
 # XXX: Seems nasty to change the superclass of MachineCodeBlockWrapper
 # like this
 if IS_X86_32:

rpython/jit/backend/x86/test/test_fficall.py

 from rpython.jit.metainterp.test import test_fficall
 from rpython.jit.backend.x86.test.test_basic import Jit386Mixin
 
+
 class TestFfiCall(Jit386Mixin, test_fficall.FfiCallTests):
     # for the individual tests see
     # ====> ../../../metainterp/test/test_fficall.py

rpython/jit/metainterp/test/test_fficall.py

             assert res == rvalue or (res, rvalue) == (654321, None)
             self.check_operations_history(call_may_force=0,
                                           call_release_gil=expected_call_release_gil)
-
     def test_simple_call_int(self):
         self._run([types.signed] * 2, types.signed, [456, 789], -42)
 

rpython/rtyper/tool/test/test_rffi_platform.py

     assert a % struct.calcsize("P") == 0
 
 def test_external_lib():
-    # XXX this one seems to be a bit too platform-specific. Check
-    #     how to test it on windows correctly (using so_prefix?)
-    #     and what are alternatives to LD_LIBRARY_PATH
     eci = ExternalCompilationInfo()
     c_source = """
     int f(int a, int b)
         return (a + b);
     }
     """
+    if platform.cc == 'cl.exe':
+        c_source = '__declspec(dllexport) ' + c_source
+        libname = 'libc_lib'
+    else:
+        libname = 'c_lib'
     tmpdir = udir.join('external_lib').ensure(dir=1)
     c_file = tmpdir.join('libc_lib.c')
     c_file.write(c_source)
     l = platform.compile([c_file], eci, standalone=False)
     eci = ExternalCompilationInfo(
-        libraries = ['c_lib'],
+        libraries = [libname],
         library_dirs = [str(tmpdir)]
         )
     rffi_platform.verify_eci(eci)