Add MSVC build scripts & fix for MSVC#11
Conversation
|
Thanks. I'll comment in openwall/yespower#4 first, then we can revisit this one. We also need to decide on what to do with #10. |
- Makefile: make the "check" target exit non-zero on a test mismatch instead of merely printing FAILED. - CI: rely on "make check" / "build.ps1 -Target check" exit codes rather than reimplementing the test/diff logic in YAML; compile-cover the OpenMP/SysV-shm path on Linux by building initrom and userom. - build.ps1: add the copyright/license header.
|
@solardiz Done, applied similar changes as requested on openwall/yespower#4 |
|
|
||
| #ifdef TEST | ||
| #include <stdio.h> | ||
| #ifdef _MSC_VER |
There was a problem hiding this comment.
Please invert the condition here (and swap the blocks).
| We do most of our testing on Linux systems with gcc. The supplied | ||
| Makefile assumes that you use gcc. | ||
|
|
||
| On Windows. |
There was a problem hiding this comment.
I guess this "On Windows." line is not correctly indented. We use one tab for other headings in README, and this probably uses 4 spaces. (I only noticed this after merging the yespower PR, as GitHub UI does not show the distinction - it assumes tab width of 4, but I normally use 8.)
There was a problem hiding this comment.
Also, please include two empty lines (not one) before this heading for consistency with the rest of them in this file.
There was a problem hiding this comment.
Yes, also VScode sucks to detect it ( only linux / nano editor were capable to detect it so far )
- phc.c: invert the _MSC_VER condition so the POSIX include block comes first (#ifndef _MSC_VER), with the MSVC shim under #else. - README: fix the "On Windows." heading to use a tab like other headings instead of 4 spaces. Per review on openwall/yescrypt PR openwall#11.
- phc.c: invert the _MSC_VER condition so the POSIX include block comes first (#ifndef _MSC_VER), with the MSVC shim under #else. - README: fix the "On Windows." heading to use a tab like other headings instead of 4 spaces. Per review on openwall/yescrypt PR openwall#11.
|
@solardiz Done |
|
Merged, thanks! I also realized we completely forgot to update |
Adding build scripts for Windows MSVC and applied some fixes for MSVC compiler ( which doesn't support many of C lang keywords and unix apis )
This is implemented because Rust and Node.js still requires MSVC targets for c bindings ( maybe they would add support for clang-cl at the future, but I think it would not happen at least on upcoming years ), and since gcc / clang still remains experimental for windows support :(
Source fixes for MSVC (all guarded so GCC behavior is unchanged):
It builds on Windows like https://github.com/quadcpu/yescrypt/actions/runs/27431709479/job/81083451845