diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-04-14 17:25:54 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-04-14 17:25:54 +0200 |
commit | d8728d7219ceb91d9bddda4064d91f83558b44b7 (patch) | |
tree | bc1b79f3aab723efd25bd4afd8551242775d7daa /src | |
parent | b10d5cccee5d2945b1924a732a9b7d9d79d91b0b (diff) | |
download | xine-lib-d8728d7219ceb91d9bddda4064d91f83558b44b7.tar.gz xine-lib-d8728d7219ceb91d9bddda4064d91f83558b44b7.tar.bz2 |
Check for __malloc__ attribute during configure stage, avoid conditional in xineutils.h for it, instead use XINE_MALLOC.
Diffstat (limited to 'src')
-rw-r--r-- | src/xine-utils/attributes.h | 6 | ||||
-rw-r--r-- | src/xine-utils/xineutils.h | 12 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/xine-utils/attributes.h b/src/xine-utils/attributes.h index 649c1aa43..e257a48dd 100644 --- a/src/xine-utils/attributes.h +++ b/src/xine-utils/attributes.h @@ -75,4 +75,10 @@ # define XINE_PACKED #endif +#ifdef SUPPORT_ATTRIBUTE_MALLOC +# define XINE_MALLOC __attributes__((__malloc__)) +#else +# define XINE_MALLOC +#endif + #endif /* ATTRIBUTE_H_ */ diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 20c3cb2dc..0be29ff63 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -624,17 +624,9 @@ 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; -#if !defined(__GNUC__) || __GNUC__ < 3 -void *xine_xcalloc(size_t nmemb, size_t size) XINE_PROTECTED; -#else -void *xine_xcalloc(size_t nmemb, size_t size) __attribute__ ((__malloc__)) XINE_PROTECTED; -#endif +void *xine_xcalloc(size_t nmemb, size_t size) XINE_MALLOC XINE_PROTECTED; /* * Same as above, but memory is aligned to 'alignement'. |