From 586a95dde36c1d4f1dfd2b7590db87f6d9d55d12 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Mon, 24 Mar 2025 15:53:14 -0500 Subject: Do some more work on the linked list --- src/shared.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/shared.h') diff --git a/src/shared.h b/src/shared.h index ee3e06b..af6c56e 100644 --- a/src/shared.h +++ b/src/shared.h @@ -5,6 +5,11 @@ #define STATIC_ARRAY_LEN(arr) (sizeof((arr))/sizeof((arr)[0])) +#define RETURNWERR(errval, retval) do {\ + errno = (errval);\ + return (retval);\ +} while (0) + // Defines how `x___alloc()` functions should exit. `___VXGG___XALLOC_EXIT_ON_ERROR___ > 0` calls `error()`, and thus functions // registered with `atexit()` and `on_exit()`. `___VXGG___XALLOC_EXIT_ON_ERROR___ <= 0` calls `abort()` on error. `x___alloc()` // type functions will ALWAYS 'abort', doing otherwise defeats the purpose of the function type -- cgit v1.2.3