diff options
author | David Robillard <d@drobilla.net> | 2022-09-01 23:35:15 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-09-02 00:05:26 -0400 |
commit | bb3a59f1eff2ad2ac203d063cb714189955bbc93 (patch) | |
tree | 468b9ee9c5e723aa69c56ecdc856e64f738c72f4 /include/zix | |
parent | 6dc5d6cd358569f1e9654e0ecd5c385fe508b23d (diff) | |
download | zix-bb3a59f1eff2ad2ac203d063cb714189955bbc93.tar.gz zix-bb3a59f1eff2ad2ac203d063cb714189955bbc93.tar.bz2 zix-bb3a59f1eff2ad2ac203d063cb714189955bbc93.zip |
Factor out POSIX-style return pattern
Diffstat (limited to 'include/zix')
-rw-r--r-- | include/zix/common.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/zix/common.h b/include/zix/common.h index a097edd..59a61ac 100644 --- a/include/zix/common.h +++ b/include/zix/common.h @@ -42,6 +42,11 @@ ZIX_CONST_API ZixStatus zix_errno_status(int e); +/// Return success if `r` is non-zero, or `errno` as a status code otherwise +ZIX_PURE_API +ZixStatus +zix_errno_status_if(int r); + /// Function for comparing two elements typedef int (*ZixComparator)(const void* a, const void* b, |