$ show skeeto/w64devkit
w64devkit is a portable, self-contained C, C++, and Fortran development kit for Windows (x64 and x86). It is built entirely from source using a Docker-based multi-stage build system, producing a signed self-extracting 7z archive that requires no installation and runs as any user. The kit includes Mingw-w64 GCC, GDB, GNU Make, CMake, Ninja, BusyBox-w32, Vim, Ctags, Ccache, NSIS, 7-Zip, and a collection of custom utilities (debugbreak, recycle, uuidgen, peports, pkg-config, rexxd, vc++filt, w64devkit launcher). All custom utilities are compiled as tiny, CRT-free executables using -nostartfiles and -nostdlib, linking only kernel32 and custom libraries. The build process applies a curated set of quilt patches to upstream sources to improve Windows compatibility, cross-compilation, and console handling. The repository also includes a full reimplementation of the quilt patch management tool in C++20 (src/quilt.cpp) with built-in diff and patch engines. The codebase demonstrates high craftsmanship in low-level Windows programming, with careful attention to performance (SWAR optimizations, inline assembly), correctness (handling of link.exe bugs, edge cases), and minimal dependencies.
The LLM identified 3 files worth highlighting for reuse:
A self-contained implementation of the C11 threads API (thrd_create, mtx_lock, cnd_wait, etc.) using Windows SRW locks and condition variables. It provides a portable threading layer for Windows without requiring the C runtime library. The implementation is minimal, correct, and can be extracted into any Windows C project that needs C11 threads support.
Provides memset, memcpy, memmove, memcmp, and strlen implementations using x86 string instructions (REP STOSB, REP MOVSB, REP CMPSB, REP SCASB) via inline assembly. These are optimized for speed and avoid any CRT dependency. The code is small, self-contained, and can be reused in any project needing fast, CRT-free memory operations on x86/x64 Windows.
A high-performance hex dump utility (xxd replacement) with multiple output modes (hex, binary, include, postscript). It uses SWAR (SIMD Within A Register) techniques for fast ASCII/EBCDIC conversion and includes an extensive test suite with fuzz testing. The code is a single-file, CRT-free executable that demonstrates advanced bit-level optimization and careful handling of edge cases. It can be extracted as a standalone tool or serve as a reference for SWAR-based text processing.