summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xine-utils/attributes.h6
-rw-r--r--src/xine-utils/xineutils.h6
2 files changed, 7 insertions, 5 deletions
diff --git a/src/xine-utils/attributes.h b/src/xine-utils/attributes.h
index 2085be571..3d6e66359 100644
--- a/src/xine-utils/attributes.h
+++ b/src/xine-utils/attributes.h
@@ -89,4 +89,10 @@
# define XINE_FORMAT_PRINTF_ARG(fmt)
#endif
+#ifdef SUPPORT_ATTRIBUTE_MALLOC
+# define XINE_MALLOC __attribute__((__malloc__))
+#else
+# define XINE_MALLOC
+#endif
+
#endif /* ATTRIBUTE_H_ */
diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h
index 01afc1631..2099bf7f3 100644
--- a/src/xine-utils/xineutils.h
+++ b/src/xine-utils/xineutils.h
@@ -621,11 +621,7 @@ void xine_profiler_print_results (void) XINE_PROTECTED;
* Allocate and clean memory size_t 'size', then return the pointer
* to the allocated memory.
*/
-#if !defined(__GNUC__) || __GNUC__ < 3
-void *xine_xmalloc(size_t size) XINE_PROTECTED;
-#else
-void *xine_xmalloc(size_t size) __attribute__ ((__malloc__)) XINE_PROTECTED;
-#endif
+void *xine_xmalloc(size_t size) XINE_MALLOC XINE_PROTECTED;
/*
* Same as above, but memory is aligned to 'alignement'.