aboutsummaryrefslogtreecommitdiff
path: root/src/common/sysdefs.h
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2011-01-18 21:23:50 +0200
committerLasse Collin <lasse.collin@tukaani.org>2011-01-18 21:23:50 +0200
commitf71c4e16e913f660977526f0ef8d2acdf458d7c9 (patch)
treecdcb4d197fffd82e6631fd8efe7ce73e7f753797 /src/common/sysdefs.h
parentScripts: Fix gzip and bzip2 support in xzdiff. (diff)
downloadxz-f71c4e16e913f660977526f0ef8d2acdf458d7c9.tar.xz
Add alloc_size and malloc attributes to a few functions.
Thanks to Cristian Rodríguez for the original patch.
Diffstat (limited to '')
-rw-r--r--src/common/sysdefs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/sysdefs.h b/src/common/sysdefs.h
index 51f06cf0..69370ba4 100644
--- a/src/common/sysdefs.h
+++ b/src/common/sysdefs.h
@@ -180,4 +180,10 @@ typedef unsigned char _Bool;
# define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
#endif
+#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4
+# define lzma_attr_alloc_size(x) __attribute__((__alloc_size__(x)))
+#else
+# define lzma_attr_alloc_size(x)
+#endif
+
#endif