Skip to content

feat: Add Windows/MSVC cross-platform support#24

Open
4fuu wants to merge 23 commits intoz-libs:mainfrom
4fuu:feature/multi-platform-compat
Open

feat: Add Windows/MSVC cross-platform support#24
4fuu wants to merge 23 commits intoz-libs:mainfrom
4fuu:feature/multi-platform-compat

Conversation

@4fuu
Copy link
Contributor

@4fuu 4fuu commented Jan 13, 2026

The following is the content of this PR

  • Add a cross-platform compatibility layer and Windows support (src/compat/*, std/z_platform.h), covering paths/files/console behaviors.
  • Improve build/install flow (Make/CMake) and resolve standard library paths via install prefix.
  • Fix Windows-specific issues in REPL/utils/stdlib and address related build errors.

Other changes (not core compatibility/fix work):

  • Minor adjustments in parser/codegen/plugin manager.
  • Add a test (tests/async_test.zc) and update docs/config (README.md, .gitignore, AGENTS.md).

@4fuu
Copy link
Contributor Author

4fuu commented Jan 13, 2026

It’s worth noting that on Windows you can build the compiler with MSVC, but at the moment you still need GCC/MinGW to compile the C code generated by zc programs.

@Salvakiya
Copy link

I want to try this out more thoroughly this weekend. Initially I found the produced zc binary looks for src/std/z_platform.h when compiling and will fail if its not there. Might be cool if it were embedded into the binary somehow but otoh the distribution just requires that z_platform.h is reachable.

But hey this compiled my first try on windows! great job so far!

@Salvakiya
Copy link

@4fuu can you update this with main please

@4fuu
Copy link
Contributor Author

4fuu commented Jan 17, 2026

@Salvakiya
Thanks for checking this out!

z_platform.h will be distributed together with the other files under std, so it should be available as long as the standard library files are installed.

I’ve also merged the latest main into this branch now, and added Windows CI as well. Everything should be up to date at this point.

@4fuu
Copy link
Contributor Author

4fuu commented Jan 17, 2026

@Zuhaitz-dev just pinging in case this slipped through — I’ve merged the latest main, resolved conflicts, and added Windows CI.

Everything is green now. Would love to get your thoughts when you have a chance.

Copy link

@standaell1234-maker standaell1234-maker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4fuu:feature/multi-platform-compat

@Salvakiya
Copy link

A few thoughts after messing around with windows and MSVC compatability...

  1. it should be possible to embed all compatability headers into the transpiler executable in such a way that the codegen pastes the header content into the start of any transpiled code.

  2. overuse of #ifdef _WIN32 should be avoided. its possible to do a compatability layer and avoid doing this outside of the abstraction layer

  3. MSVC does not support typeof until C23. This greatly hinders MSVC support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants