aboutsummaryrefslogtreecommitdiffstats
path: root/gawkapi.h
diff options
context:
space:
mode:
Diffstat (limited to 'gawkapi.h')
-rw-r--r--gawkapi.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gawkapi.h b/gawkapi.h
index 484ab27e..8562b5f4 100644
--- a/gawkapi.h
+++ b/gawkapi.h
@@ -878,6 +878,12 @@ typedef struct gawk_api {
fatal(ext_id, "%s: malloc of %d bytes failed\n", message, size); \
} while(0)
+#define ezalloc(pointer, type, size, message) \
+ do { \
+ if ((pointer = (type) gawk_calloc(1, size)) == 0) \
+ fatal(ext_id, "%s: calloc of %d bytes failed\n", message, size); \
+ } while(0)
+
#define erealloc(pointer, type, size, message) \
do { \
if ((pointer = (type) gawk_realloc(pointer, size)) == 0) \