diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-05-09 15:16:17 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-05-09 15:16:17 +0200 |
commit | c99cd9519a56b2d7c60fa30e9fecd02f08336671 (patch) | |
tree | d897b2e3e31a2386a16dc6b5f4c3500ac66f601f /src/xine-utils/attributes.h | |
parent | ed72565137c93ab0385a10036d234f5f4dd1b960 (diff) | |
download | xine-lib-c99cd9519a56b2d7c60fa30e9fecd02f08336671.tar.gz xine-lib-c99cd9519a56b2d7c60fa30e9fecd02f08336671.tar.bz2 |
Cleanup handling of packed attribute.
- Add a configure test for the attribute, during xine build process.
- Define the attribute as supported when using GCC 2.95 or later
outside xine build process.
- Use the new XINE_PACKED define instead of the attribute directly.
- Check for SUPPORT_ATTRIBUTE_PACKED rather than doing strange
subdefines.
Diffstat (limited to 'src/xine-utils/attributes.h')
-rw-r--r-- | src/xine-utils/attributes.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/xine-utils/attributes.h b/src/xine-utils/attributes.h index cb861303d..29bb9f28f 100644 --- a/src/xine-utils/attributes.h +++ b/src/xine-utils/attributes.h @@ -32,27 +32,18 @@ #define ATTR_ALIGN(align) #endif -/* disable GNU __attribute__ extension, when not compiling with GNU C */ -#if defined(__GNUC__) || defined (__ICC) -#ifndef ATTRIBUTE_PACKED -#define ATTRIBUTE_PACKED 1 -#endif -#else -#undef ATTRIBUTE_PACKED -#ifndef __attribute__ -#define __attribute__(x) /**/ -#endif /* __attribute __*/ -#endif - #ifdef XINE_COMPILE # include "configure.h" #else +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95 ) +# define SUPPORT_ATTRIBUTE_PACKED 1 +# endif + # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3 ) # define SUPPORT_ATTRIBUTE_DEPRECATED 1 # define SUPPORT_ATTRIBUTE_FORMAT 1 # define SUPPORT_ATTRIBUTE_FORMAT_ARG 1 # define SUPPORT_ATTRIBUTE_MALLOC 1 -# define SUPPORT_ATTRIBUTE_PACKED 1 # define SUPPORT_ATTRIBUTE_UNUSED 1 # endif @@ -112,4 +103,10 @@ # define XINE_MALLOC #endif +#ifdef SUPPORT_ATTRIBUTE_PACKED +# define XINE_PACKED __attribute__((__packed__)) +#else +# define XINE_PACKED +#endif + #endif /* ATTRIBUTE_H_ */ |