Commit 9f3b1f13 authored by Sam Hocevar's avatar Sam Hocevar

* configure.ac: Added a compiler check for __attribute__((__packed__)).

parent 1fb282c6
dnl Autoconf settings for vlc dnl Autoconf settings for vlc
dnl $Id: configure.ac,v 1.18 2003/07/01 15:06:36 sam Exp $ dnl $Id: configure.ac,v 1.19 2003/07/01 17:14:58 sam Exp $
AC_INIT(vlc,0.6.0) AC_INIT(vlc,0.6.0)
...@@ -719,6 +719,16 @@ if test "${ac_cv_c_attribute_format}" != "no"; then ...@@ -719,6 +719,16 @@ if test "${ac_cv_c_attribute_format}" != "no"; then
AC_DEFINE(HAVE_ATTRIBUTE_FORMAT, 1, Support for __attribute__((format())) with function pointers) AC_DEFINE(HAVE_ATTRIBUTE_FORMAT, 1, Support for __attribute__((format())) with function pointers)
fi fi
dnl Check for __attribute__(())
AC_CACHE_CHECK([for __attribute__((packed))],
[ac_cv_c_attribute_packed],
[ac_cv_c_attribute_packed=no
AC_TRY_COMPILE(, [struct __attribute__((__packed__)) foo { int a; } b;],
[ac_cv_c_attribute_packed=yes])])
if test "${ac_cv_c_attribute_packed}" = "no"; then
AC_DEFINE(HAVE_ATTRIBUTE_PACKED, 1, Support for __attribute__((packed)) for structs)
fi
dnl dnl
dnl Check the CPU dnl Check the CPU
dnl dnl
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* codecs.h: codec related structures needed by the demuxers and decoders * codecs.h: codec related structures needed by the demuxers and decoders
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: codecs.h,v 1.3 2002/12/03 17:00:15 fenrir Exp $ * $Id: codecs.h,v 1.4 2003/07/01 17:14:58 sam Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -28,7 +28,11 @@ ...@@ -28,7 +28,11 @@
#ifndef _WAVEFORMATEX_ #ifndef _WAVEFORMATEX_
#define _WAVEFORMATEX_ #define _WAVEFORMATEX_
typedef struct __attribute__((__packed__)) _WAVEFORMATEX { typedef struct
#ifdef HAVE_ATTRIBUTE_PACKED
__attribute__((__packed__))
#endif
_WAVEFORMATEX {
uint16_t wFormatTag; uint16_t wFormatTag;
uint16_t nChannels; uint16_t nChannels;
uint32_t nSamplesPerSec; uint32_t nSamplesPerSec;
...@@ -41,7 +45,10 @@ typedef struct __attribute__((__packed__)) _WAVEFORMATEX { ...@@ -41,7 +45,10 @@ typedef struct __attribute__((__packed__)) _WAVEFORMATEX {
#if !defined(_BITMAPINFOHEADER_) && !defined(WIN32) #if !defined(_BITMAPINFOHEADER_) && !defined(WIN32)
#define _BITMAPINFOHEADER_ #define _BITMAPINFOHEADER_
typedef struct __attribute__((__packed__)) typedef struct
#ifdef HAVE_ATTRIBUTE_PACKED
__attribute__((__packed__))
#endif
{ {
uint32_t biSize; uint32_t biSize;
uint32_t biWidth; uint32_t biWidth;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ogg.c * ogg.c
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: ogg.c,v 1.7 2003/06/29 20:58:16 gbazin Exp $ * $Id: ogg.c,v 1.8 2003/07/01 17:14:58 sam Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
...@@ -69,20 +69,29 @@ vlc_module_end(); ...@@ -69,20 +69,29 @@ vlc_module_end();
#define PACKET_IS_SYNCPOINT 0x08 #define PACKET_IS_SYNCPOINT 0x08
typedef struct __attribute__((__packed__)) typedef struct
#ifdef HAVE_ATTRIBUTE_PACKED
__attribute__((__packed__))
#endif
{ {
int32_t i_width; int32_t i_width;
int32_t i_height; int32_t i_height;
} ogg_stream_header_video_t; } ogg_stream_header_video_t;
typedef struct __attribute__((__packed__)) typedef struct
#ifdef HAVE_ATTRIBUTE_PACKED
__attribute__((__packed__))
#endif
{ {
int16_t i_channels; int16_t i_channels;
int16_t i_block_align; int16_t i_block_align;
int32_t i_avgbytespersec; int32_t i_avgbytespersec;
} ogg_stream_header_audio_t; } ogg_stream_header_audio_t;
typedef struct __attribute__((__packed__)) typedef struct
#ifdef HAVE_ATTRIBUTE_PACKED
__attribute__((__packed__))
#endif
{ {
uint8_t i_packet_type; uint8_t i_packet_type;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment