#if __GNUC__ > 2
#define NORETURN __attribute__((__noreturn__))
#define CHECK_PRINTF(fmt, arg) __attribute__((format(printf, fmt, arg)))
-#define ALLOC_SIZE(n) __attribute__((alloc_size(n)))
-#define ALLOC_SIZE2(m, n) __attribute__((alloc_size(m, n)))
+#define ALLOC_SIZE(...) __attribute__((alloc_size(__VA_ARGS__)))
#define CONST __attribute__((const))
#define MALLOC __attribute__((malloc))
#define NMH_UNUSED(i) (void) i
#else
#define NORETURN
#define CHECK_PRINTF(fmt, arg)
-#define ALLOC_SIZE(n)
-#define ALLOC_SIZE2(m, n)
+#define ALLOC_SIZE(...)
#define CONST
#define MALLOC
#define NMH_UNUSED(i) i
void *mh_xrealloc(void *ptr, size_t size) ALLOC_SIZE(2);
/* Call calloc(3), exiting on NULL return. */
-void *mh_xcalloc(size_t nelem, size_t elsize) MALLOC ALLOC_SIZE2(1, 2);
+void *mh_xcalloc(size_t nelem, size_t elsize) MALLOC ALLOC_SIZE(1, 2);
/* Duplicate a NUL-terminated string, exit on failure. */
char *mh_xstrdup(const char *src) MALLOC;