From: Jean Privat Date: Mon, 15 Aug 2016 19:19:20 +0000 (-0400) Subject: Merge: Native Windows bootstrap X-Git-Url: http://nitlanguage.org?hp=-c Merge: Native Windows bootstrap This PR tweaks and hacks the core lib and the compiler to get a working bootstrap on Windows. After a regen of c_src, one could clone the repo and build c_src/nitc.exe using GCC on Windows with mingw or similar. There's a procedure using msys2 at . To achieve basic Windows compatibility, I applied the following algorithm: 1. For a missing C function, if there is an equivalent in ``, use an alternative static C implementation. 2. If it's a difference in a Nit only method, (like the path separator) add an alternative implementation selected at runtime. 3. If the difference spawns across more than one Nit method/class. Deactivate the code for Windows, replace by a no-op, and wait for a later fix hiding platform implementations behind an abstract API. Alternatively, we could use many `#ifdef` and keep the differences on the C side. There are still a lot of issues: * `c_src/nitc` can compile `hello_world` and `src/nitc.nit`. `hello_world` behaves as expected, but `src/nitc.nit` does not, there's some problems at parsing. (Maybe with the line endings.) * The compiler hangs randomly. This may be related to different blocking behavior when reading files, or a local setup issue. * I did not find a compatible GNU libregex, a solution is to use libboost regex. This could be declared in `lib/core/re.nit`, however would need to tweak some annotations and ensure that they work in nith. (`ldflags("-lmboost_regex-mt")@windows`) * `poll` and `Process` related features must be replaced/implemented for Windows. * There's a few warnings from the C compiler to check/silence. Pull-Request: #2264 Reviewed-by: Jean Privat Reviewed-by: Lucas Bajolet --- df70e67ff034b5610d16d17929bebb835d325646