summaryrefslogtreecommitdiffstats
path: root/include/xalloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/xalloc.h')
-rw-r--r--include/xalloc.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/xalloc.h b/include/xalloc.h
index fc2f886dd..27efa30c5 100644
--- a/include/xalloc.h
+++ b/include/xalloc.h
@@ -13,11 +13,13 @@
#include <stdlib.h>
#include <err.h>
+#include "c.h"
+
#ifndef XALLOC_EXIT_CODE
# define XALLOC_EXIT_CODE EXIT_FAILURE
#endif
-static inline __attribute__((alloc_size(1)))
+static inline __ul_alloc_size(1)
void *xmalloc(const size_t size)
{
void *ret = malloc(size);
@@ -27,7 +29,7 @@ void *xmalloc(const size_t size)
return ret;
}
-static inline __attribute__((alloc_size(2)))
+static inline __ul_alloc_size(2)
void *xrealloc(void *ptr, const size_t size)
{
void *ret = realloc(ptr, size);
@@ -37,7 +39,7 @@ void *xrealloc(void *ptr, const size_t size)
return ret;
}
-static inline __attribute__((alloc_size(1,2)))
+static inline __ul_calloc_size(1, 2)
void *xcalloc(const size_t nelems, const size_t size)
{
void *ret = calloc(nelems, size);