#include "exit_if_null.h"
-#define CALLOC(n, type) \
-( \
- (type *) calloc(n, sizeof(type)) \
+#define CALLOC(n, T) \
+( \
+ (T *) calloc(n, sizeof(T)) \
)
-#define XCALLOC(n, type) exit_if_null(CALLOC(n, type))
+#define XCALLOC(n, T) exit_if_null(CALLOC(n, T))
#endif // include guard
#include "exit_if_null.h"
-#define MALLOC(n, type) \
-( \
- (type *) mallocarray(n, sizeof(type)) \
+#define MALLOC(n, T) \
+( \
+ (T *) mallocarray(n, sizeof(T)) \
)
-#define XMALLOC(n, type) exit_if_null(MALLOC(n, type))
+#define XMALLOC(n, T) exit_if_null(MALLOC(n, T))
ATTR_ALLOC_SIZE(1, 2)
#include "exit_if_null.h"
-#define REALLOC(p, n, type) \
-( \
- _Generic(p, type *: (type *) reallocarray(p, (n) ?: 1, sizeof(type))) \
+#define REALLOC(p, n, T) \
+( \
+ _Generic(p, T *: (T *) reallocarray(p, (n) ?: 1, sizeof(T))) \
)
-#define XREALLOC(p, n, type) exit_if_null(REALLOC(p, n, type))
+#define XREALLOC(p, n, T) exit_if_null(REALLOC(p, n, T))
#endif // include guard
#include "attr.h"
-#define REALLOCF(p, n, type) \
-( \
- _Generic(p, type *: (type *) reallocarrayf(p, (n) ?: 1, sizeof(type)))\
+#define REALLOCF(p, n, T) \
+( \
+ _Generic(p, T *: (T *) reallocarrayf(p, (n) ?: 1, sizeof(T))) \
)
#include "config.h"
-#define CMP(TYPE) \
+#define CMP(T) \
( \
- _Generic((TYPE) 0, \
+ _Generic((T) 0, \
int *: cmp_int, \
long *: cmp_long, \
unsigned int *: cmp_uint, \