From f71c4e16e913f660977526f0ef8d2acdf458d7c9 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Tue, 18 Jan 2011 21:23:50 +0200 Subject: Add alloc_size and malloc attributes to a few functions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Cristian Rodríguez for the original patch. --- src/common/sysdefs.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/common') 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 -- cgit v1.2.3