summaryrefslogtreecommitdiff
path: root/src/shared.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared.h')
-rw-r--r--src/shared.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/shared.h b/src/shared.h
new file mode 100644
index 0000000..ac214f7
--- /dev/null
+++ b/src/shared.h
@@ -0,0 +1,14 @@
1#ifndef __VXGG_REWRITE___SHARED_H___3880294315821___
2#define __VXGG_REWRITE___SHARED_H___3880294315821___
3
4#include <stddef.h>
5
6// Defines how `xcalloc()` should exit. `___VXGG___XCALLOC_EXIT_ON_ERROR___ > 0` calls `error()`, and thus functions registered with
7// `atexit()` and `on_exit()`. `___VXGG___XCALLOC_EXIT_ON_ERROR___ <= 0` calls `abort()` on error. `xcalloc()` will ALWAYS 'abort',
8// doing otherwise defeats the purpose of the function
9#define ___VXGG___XCALLOC_EXIT_ON_ERROR___ 1
10
11// `calloc()` with error checking. Calls `error()` or `abort()` on error depending on the value of `___VXGG___XCALLOC_EXIT_ON_ERROR___`
12void* xcalloc(size_t nmemb, size_t size);
13
14#endif \ No newline at end of file