Created
May 1, 2020 16:38
-
-
Save Bunn/ad4c1238936c9a30659a9310cb0a23b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static inline void func_to_cleanup(void (^*block)(void)) { | |
(*block)(); | |
} | |
#define concat(a,b) a##b | |
#define defer(deferBlock) __attribute__((cleanup(func_to_cleanup))) void (^__unused concat(defer_tmp_var, __COUNTER__))(void) = deferBlock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment