diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-02-24 02:10:58 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-25 14:36:40 +0200 |
commit | 11dc4b81935e3dfee997c421d8d6fa166edd7a05 (patch) | |
tree | ccb08be54209a4900c740c9ed58e8f9c2910811d /include/misc.h |
Initial commit, Function declaration work somewhat
Diffstat (limited to 'include/misc.h')
-rw-r--r-- | include/misc.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/misc.h b/include/misc.h new file mode 100644 index 0000000..c83eeb2 --- /dev/null +++ b/include/misc.h @@ -0,0 +1,19 @@ +#ifndef AMALGAM_MISC_H +#define AMALGAM_MISC_H + +#define return_if_error(result) \ +do { \ + int return_if_result; \ + return_if_result = (result); \ + if((return_if_result) != 0) \ + return return_if_result; \ +} while(0) +#define cleanup_if_error(result) do { if((result) != 0) goto cleanup; } while(0) +#define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) + +typedef enum { + bool_false, + bool_true +} bool; + +#endif
\ No newline at end of file |