include/SDL_audio.h
changeset 7546 f9ff5e066e49
parent 7191 75360622e65f
child 7581 c6b4fab28e00
     1.1 --- a/include/SDL_audio.h	Tue Jul 30 01:32:26 2013 -0400
     1.2 +++ b/include/SDL_audio.h	Mon Jul 29 23:28:25 2013 -0700
     1.3 @@ -183,6 +183,17 @@
     1.4  /**
     1.5   *  A structure to hold a set of audio conversion filters and buffers.
     1.6   */
     1.7 +#ifdef __GNUC__
     1.8 +/* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't
     1.9 +   pad it out to 88 bytes to guarantee ABI compatibility between compilers.
    1.10 +   vvv
    1.11 +   The next time we rev the ABI, make sure to size the ints and add padding.
    1.12 +*/
    1.13 +#define SDL_AUDIOCVT_PACKED __attribute__((packed))
    1.14 +#else
    1.15 +#define SDL_AUDIOCVT_PACKED
    1.16 +#endif
    1.17 +/* */
    1.18  typedef struct SDL_AudioCVT
    1.19  {
    1.20      int needed;                 /**< Set to 1 if conversion possible */
    1.21 @@ -196,7 +207,7 @@
    1.22      double len_ratio;           /**< Given len, final size is len*len_ratio */
    1.23      SDL_AudioFilter filters[10];        /**< Filter list */
    1.24      int filter_index;           /**< Current audio conversion function */
    1.25 -} SDL_AudioCVT;
    1.26 +} SDL_AUDIOCVT_PACKED SDL_AudioCVT;
    1.27  
    1.28  
    1.29  /* Function prototypes */