X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_codecs.h;h=d217470698da1c63f28cc03f65f09a39bcd8915a;hb=47e69cf6132dfd1daa1ef8fb17fa6b2af5c16e18;hp=35da7d46c82181cf6e94145c4c7f047f590086a0;hpb=df61d33b06e2b3cbbe746b2f5a9bea5b370c24ff;p=vlc diff --git a/include/vlc_codecs.h b/include/vlc_codecs.h index 35da7d46c8..d217470698 100644 --- a/include/vlc_codecs.h +++ b/include/vlc_codecs.h @@ -21,13 +21,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#if !defined( __LIBVLC__ ) - #error You are not libvlc or one of its plugins. You cannot include this file -#endif - #ifndef _VLC_CODECS_H #define _VLC_CODECS_H 1 +#ifdef HAVE_ATTRIBUTE_PACKED +# define ATTR_PACKED __attribute__((__packed__)) +#else +# error FIXME +#endif + /* Structures exported to the demuxers and decoders */ #if !(defined _GUID_DEFINED || defined GUID_DEFINED) @@ -44,9 +46,7 @@ typedef struct _GUID #ifndef _WAVEFORMATEX_ #define _WAVEFORMATEX_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED _WAVEFORMATEX { uint16_t wFormatTag; uint16_t nChannels; @@ -61,9 +61,7 @@ _WAVEFORMATEX { #ifndef _WAVEFORMATEXTENSIBLE_ #define _WAVEFORMATEXTENSIBLE_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED _WAVEFORMATEXTENSIBLE { WAVEFORMATEX Format; union { @@ -79,9 +77,7 @@ _WAVEFORMATEXTENSIBLE { #ifndef _WAVEHEADER_ #define _WAVEHEADER_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED _WAVEHEADER { uint32_t MainChunkID; uint32_t Length; @@ -102,9 +98,7 @@ _WAVEHEADER { #if !defined(_BITMAPINFOHEADER_) && !defined(WIN32) #define _BITMAPINFOHEADER_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED { uint32_t biSize; uint32_t biWidth; @@ -120,9 +114,7 @@ typedef struct } BITMAPINFOHEADER, *PBITMAPINFOHEADER, *LPBITMAPINFOHEADER; typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED { BITMAPINFOHEADER bmiHeader; int bmiColors[1]; @@ -132,9 +124,7 @@ typedef struct #ifndef _RECT32_ #define _RECT32_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED { int left, top, right, bottom; } RECT32; @@ -148,9 +138,7 @@ typedef int64_t REFERENCE_TIME; #ifndef _VIDEOINFOHEADER_ #define _VIDEOINFOHEADER_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED { RECT32 rcSource; RECT32 rcTarget; @@ -164,9 +152,7 @@ typedef struct #ifndef _RGBQUAD_ #define _RGBQUAD_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED { uint8_t rgbBlue; uint8_t rgbGreen; @@ -178,9 +164,7 @@ typedef struct #ifndef _TRUECOLORINFO_ #define _TRUECOLORINFO_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED { uint32_t dwBitMasks[3]; RGBQUAD1 bmiColors[256]; @@ -190,9 +174,7 @@ typedef struct #ifndef _VIDEOINFO_ #define _VIDEOINFO_ typedef struct -#ifdef HAVE_ATTRIBUTE_PACKED - __attribute__((__packed__)) -#endif +ATTR_PACKED { RECT32 rcSource; RECT32 rcTarget;