A Defer statement for C
License
moon-chilled/Defer
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This library implements a 'Defer' statement in c, allowing statements to run at function return time, generally to do cleanup. It is similar to 'defer' in Go and to 'scope(exit)' in D, but note that it does not care about lexical scopes. Integrating it into your codebase is simple; see demo.c for example usage. Note: this is likely to be noticeably faster with compilers that support the GNU C extensions; if you are on windows and performance is something you care about, try Clang or MinGW. Note: at the moment, a maximum of 32 deferred statements per function is supported. To change this number, #define DEFER_MAX_DEFERRED_STATEMENTS to a different value before including defer.h (or via a compiler flag).
About
A Defer statement for C
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published