Trainraider/defer_h
Zig-style defer and errdefer for C99+. RAII-like resource cleanup with scope-based automatic execution. Supports error handling, control flow (return/break/continue), and complex nesting. Zero global state, thread-safe, and no heap usage. GNU C uses __attribute__((cleanup)), C99 uses stack allocated linked lists.
2 best points · 0 comments · 1 Hacker News post · 8 GitHub stars · View on GitHub
Hacker News discussions
- Show HN: Zig's defer/errdefer for c99 and gnu11 C via macros (2 points, 0 comments, by Major_Baby_425, 2025-11-23)