[pypy-commit] pypy kill-exported-symbols-list: fixfixfix

arigo noreply at buildbot.pypy.org
Thu Oct 23 12:41:32 CEST 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: kill-exported-symbols-list
Changeset: r74106:8358f7f90e35
Date: 2014-10-23 12:40 +0200
http://bitbucket.org/pypy/pypy/changeset/8358f7f90e35/

Log:	fixfixfix

diff --git a/rpython/rtyper/tool/test/test_mkrffi.py b/rpython/rtyper/tool/test/test_mkrffi.py
--- a/rpython/rtyper/tool/test/test_mkrffi.py
+++ b/rpython/rtyper/tool/test/test_mkrffi.py
@@ -1,6 +1,7 @@
 
 import ctypes
 from rpython.rtyper.tool.mkrffi import *
+from rpython.translator import cdir
 import py
 
 class random_structure(ctypes.Structure):
@@ -59,25 +60,21 @@
         from rpython.tool.udir import udir
         from rpython.translator.platform import platform
         from rpython.translator.tool.cbuild import ExternalCompilationInfo
-        
-        if platform.name == 'msvc':
-            export = '__declspec(dllexport) '
-        else:
-            export = ''
+
         c_source = """
-        {0} void *int_to_void_p(int arg) {{}}
+        #include "src/precommondefs.h"
 
-        {0} struct random_strucutre {{
-          int one;
-          int *two;
-        }};
+        RPY_EXPORTED
+        void *int_to_void_p(int arg) {}
 
-        {0} struct random_structure* int_int_to_struct_p(int one, int two) {{}}
-        """.format(export)
+        RPY_EXPORTED
+        struct random_structure* int_int_to_struct_p(int one, int two) {}
+        """
 
         c_file = udir.join('rffilib.c')
         c_file.write(c_source)
-        libname = platform.compile([c_file], ExternalCompilationInfo(),
+        eci = ExternalCompilationInfo(include_dirs=[cdir])
+        libname = platform.compile([c_file], eci,
                                    standalone=False)
         cls.lib = ctypes.CDLL(str(libname))
     
diff --git a/rpython/rtyper/tool/test/test_rffi_platform.py b/rpython/rtyper/tool/test/test_rffi_platform.py
--- a/rpython/rtyper/tool/test/test_rffi_platform.py
+++ b/rpython/rtyper/tool/test/test_rffi_platform.py
@@ -135,9 +135,7 @@
     assert value == 'Michael Merickel'
 
 def test_getintegerfunctionresult():
-    func = 'int sum(int a, int b) {return a + b;}'
-    if platform.name == 'msvc':
-        func = '__declspec(dllexport) ' + func
+    func = 'RPY_EXPORTED int sum(int a, int b) {return a + b;}'
     value = rffi_platform.getintegerfunctionresult('sum', [6, 7], func)
     assert value == 13
     if not platform.name == 'msvc':


More information about the pypy-commit mailing list