]> code.delx.au - pulseaudio/commitdiff
add malloc related gcc attribute macros
authorLennart Poettering <lennart@poettering.net>
Mon, 1 Sep 2008 17:13:37 +0000 (19:13 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 1 Sep 2008 17:13:37 +0000 (19:13 +0200)
src/pulse/gccmacro.h

index e4062033e028ef87fe5d087c9b88780b24d57b11..0533b10915c581e06848a6844e834b3b598ee3bf 100644 (file)
 #endif
 #endif
 
+#ifndef PA_GCC_ALLOC_SIZE
+#if defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 3)
+#define PA_GCC_ALLOC_SIZE(x) __attribute__ ((__alloc_size__(x)))
+#define PA_GCC_ALLOC_SIZE2(x,y) __attribute__ ((__alloc_size__(x,y)))
+#else
+/** Macro for usage of GCC's alloc_size attribute */
+#define PA_GCC_ALLOC_SIZE(x)
+#define PA_GCC_ALLOC_SIZE2(x,y)
+#endif
+#endif
+
+#ifndef PA_GCC_MALLOC
+#ifdef __GNUCC__
+#define PA_GCC_MALLOC __attribute__ ((malloc))
+#else
+/** Macro for usage of GCC's malloc attribute */
+#define PA_GCC_MALLOC
+#endif
+#endif
+
 #endif