Christian Tismer avatar Christian Tismer committed 5ea3649

got continuelets ready for windows.

There were two things where I stumbled quite a while.

1) _compile_c_file was sloppy with the defined order of arguments, where masm had different behavior.

2) it was needed to add external definitions, but it was not clear to me that this already works and nothing than an entry in export_symbols was needed.
(transplanted from b64cba156148599f77c3e1b6c5f7d5764609463d)

Comments (0)

Files changed (2)

pypy/rlib/_rffi_stacklet.py

 
 cdir = py.path.local(pypydir) / 'translator' / 'c'
 
-_sep_mods = []
-if sys.platform == 'win32':
-    _sep_mods = [cdir / "src/stacklet/switch_x86_msvc.asm"]
-    
 eci = ExternalCompilationInfo(
     include_dirs = [cdir],
     includes = ['src/stacklet/stacklet.h'],
     separate_module_sources = ['#include "src/stacklet/stacklet.c"\n'],
-    separate_module_files = _sep_mods
 )
+if sys.platform == 'win32':
+    eci.separate_module_files += (cdir / "src/stacklet/switch_x86_msvc.asm", )
+    eci.export_symbols += (
+        'stacklet_newthread',
+        'stacklet_deletethread',
+        'stacklet_new',
+        'stacklet_switch',
+        'stacklet_destroy',
+        '_stacklet_translate_pointer',
+        )
 
 rffi_platform.verify_eci(eci.convert_sources_to_files())
 

pypy/translator/platform/windows.py

 
     def _compile_c_file(self, cc, cfile, compile_args):
         oname = cfile.new(ext='obj')
+        # notabene: (tismer)
+        # This function may be called for .c but also .asm files.
+        # The c compiler accepts any order of arguments, while
+        # the assembler still has the old behavior that all options
+        # must come first, and after the file name all options are ignored.
+        # So please be careful with the oder of parameters! ;-)
         args = ['/nologo', '/c'] + compile_args + ['/Fo%s' % (oname,), str(cfile)]
         self._execute_c_compiler(cc, args, oname)
         return oname
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.