summaryrefslogtreecommitdiffstats
path: root/XAlloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'XAlloc.c')
-rw-r--r--XAlloc.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/XAlloc.c b/XAlloc.c
deleted file mode 100644
index 815cf47f..00000000
--- a/XAlloc.c
+++ /dev/null
@@ -1,42 +0,0 @@
-
-#include "XAlloc.h"
-#include "RichString.h"
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-void fail() {
- curs_set(1);
- endwin();
- abort();
-}
-
-void* xMalloc(size_t size) {
- void* data = malloc(size);
- if (!data && size > 0) {
- fail();
- }
- return data;
-}
-
-void* xCalloc(size_t nmemb, size_t size) {
- void* data = calloc(nmemb, size);
- if (!data && nmemb > 0 && size > 0) {
- fail();
- }
- return data;
-}
-
-void* xRealloc(void* ptr, size_t size) {
- void* data = realloc(ptr, size);
- if (!data && size > 0) {
- fail();
- }
- return data;
-}