aboutsummaryrefslogtreecommitdiffstats
path: root/xmalloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'xmalloc.h')
-rw-r--r--xmalloc.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmalloc.h b/xmalloc.h
index 70ed0a0b..fd84ebed 100644
--- a/xmalloc.h
+++ b/xmalloc.h
@@ -17,8 +17,12 @@ extern "C" {
#define XMALLOCTYPE char
#endif
+#if !defined __GNUC__ || __GNUC__ < 2
+# define __attribute__(xyz) /* Ignore. */
+#endif
+
/** Allocate \a n characters of memory, abort program on failure. */
-XMALLOCTYPE *xmalloc(size_t n);
+XMALLOCTYPE *xmalloc(size_t n) __attribute__((malloc));
/** Reallocate \a n characters of memory, abort program on failure. */
XMALLOCTYPE *xrealloc(/*@null@*/ void *, size_t n);