Skip to content

rewrite from C++ to C#2

Merged
r2unit merged 3 commits intodevelfrom
refactor
Mar 29, 2026
Merged

rewrite from C++ to C#2
r2unit merged 3 commits intodevelfrom
refactor

Conversation

@r2unit
Copy link
Copy Markdown
Owner

@r2unit r2unit commented Mar 29, 2026

Summary

  • Full rewrite of the codebase from C++ (C++20) to plain C (C11), maintaining identical functionality
  • Replaced all C++ dependencies: tomlplusplus -> tomlc99 (vendored), spdlog -> custom log.h macros, googletest -> custom test.h framework
  • Updated CI workflows to remove old vendor clone steps since tomlc99 is now committed directly

Details

All 11 modules rewritten: util, config, tui, git, sync, watcher, daemon, setup, upgrade, cli, main. Classes became structs with hs_ prefixed free functions and explicit _free() cleanup. std::string replaced with char* + strdup/malloc/free, std::vector replaced with macro-based hs_vec generic dynamic arrays, std::thread/std::mutex replaced with pthreads, std::atomic<bool> replaced with C11 atomic_bool. All 4 test suites pass (43 tests), zero compiler warnings, binary works identically.

r2unit added 3 commits March 29, 2026 22:45
replace all C++ source files with plain C11 equivalents.
same functionality, same module structure, same tests.

- replace std::string/vector with char* and hs_vec macros
- replace classes with structs + free functions (hs_ prefix)
- replace spdlog with simple log macros (log.h)
- replace toml++ with tomlc99
- replace googletest with minimal test.h framework
- replace std::filesystem with POSIX APIs
- replace std::thread/mutex with pthreads
- update CMakeLists.txt for C11, PKGBUILD for new deps
@r2unit r2unit merged commit a31e48f into devel Mar 29, 2026
@r2unit r2unit deleted the refactor branch March 29, 2026 20:50
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.

1 participant