Skip to content

Commit

Permalink
Fixed "inline" keyword to compile.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jul 12, 2002
1 parent 2cf91a6 commit 48cc608
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 24 deletions.
5 changes: 3 additions & 2 deletions SDL_sound_internal.h
Expand Up @@ -35,8 +35,9 @@

#include "SDL.h"

#if (defined(_MSC_VER) && !defined(inline))
# define inline __inline__
/* SDL 1.2.4 defines this, but better safe than sorry. */
#if (!defined(__inline__))
# define __inline__
#endif

#if (defined DEBUG_CHATTER)
Expand Down
2 changes: 1 addition & 1 deletion decoders/mpglib/mpg123_sdlsound.h
Expand Up @@ -34,7 +34,7 @@

#ifdef __GNUC__
#define INLINE inline
#elif (defined _MSC_VER)
#elif ((defined _MSC_VER) || (defined __inline__))
#define INLINE __inline__
#else
#define INLINE
Expand Down
17 changes: 9 additions & 8 deletions decoders/shn.c
Expand Up @@ -323,11 +323,11 @@ static int ulong_get(shn_t *shn, SDL_RWops *rw, Sint32 *word)
} /* ulong_get */


static inline int uint_get(int nbit, shn_t *shn, SDL_RWops *rw, Sint32 *word)
static __inline__ int uint_get(int nbit, shn_t *shn, SDL_RWops *rw, Sint32 *w)
{
return((shn->version == 0) ?
uvar_get(nbit, shn, rw, word) :
ulong_get(shn, rw, word));
uvar_get(nbit, shn, rw, w) :
ulong_get(shn, rw, w));
} /* uint_get */


Expand All @@ -347,7 +347,7 @@ static void SHN_quit(void)
* Look through the whole file for a SHN magic number. This is costly, so
* it should only be done if the user SWEARS they have a Shorten stream...
*/
static inline int extended_shn_magic_search(Sound_Sample *sample)
static __inline__ int extended_shn_magic_search(Sound_Sample *sample)
{
SDL_RWops *rw = ((Sound_SampleInternal *) sample->opaque)->rw;
Uint32 word = 0;
Expand All @@ -369,7 +369,8 @@ static inline int extended_shn_magic_search(Sound_Sample *sample)


/* look for the magic number in the RWops and see what kind of file this is. */
static inline int determine_shn_version(Sound_Sample *sample, const char *ext)
static __inline__ int determine_shn_version(Sound_Sample *sample,
const char *ext)
{
SDL_RWops *rw = ((Sound_SampleInternal *) sample->opaque)->rw;
Uint32 magic;
Expand Down Expand Up @@ -433,7 +434,7 @@ static void init_shn_offset(Sint32 **offset, int nchan, int nblock, int ftype)
} /* init_shn_offset */


static inline Uint16 cvt_shnftype_to_sdlfmt(Sint16 shntype)
static __inline__ Uint16 cvt_shnftype_to_sdlfmt(Sint16 shntype)
{
switch (shntype)
{
Expand Down Expand Up @@ -465,7 +466,7 @@ static inline Uint16 cvt_shnftype_to_sdlfmt(Sint16 shntype)
} /* cvt_shnftype_to_sdlfmt */


static inline int skip_bits(shn_t *shn, SDL_RWops *rw)
static __inline__ int skip_bits(shn_t *shn, SDL_RWops *rw)
{
int i;
Sint32 skip;
Expand Down Expand Up @@ -543,7 +544,7 @@ static int verb_ReadLE16(shn_t *shn, SDL_RWops *rw, Uint16 *word)
} /* verb_ReadLE16 */


static inline int parse_riff_header(shn_t *shn, Sound_Sample *sample)
static __inline__ int parse_riff_header(shn_t *shn, Sound_Sample *sample)
{
Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
SDL_RWops *rw = internal->rw;
Expand Down
2 changes: 1 addition & 1 deletion decoders/smpeg.c
Expand Up @@ -94,7 +94,7 @@ static void _SMPEG_quit(void)
} /* _SMPEG_quit */


static inline void output_version(void)
static __inline__ void output_version(void)
{
static int first_time = 1;

Expand Down
4 changes: 2 additions & 2 deletions decoders/voc.c
Expand Up @@ -142,7 +142,7 @@ static void VOC_quit(void)
} /* VOC_quit */


static inline int voc_readbytes(SDL_RWops *src, vs_t *v, void *p, int size)
static __inline__ int voc_readbytes(SDL_RWops *src, vs_t *v, void *p, int size)
{
if (SDL_RWread(src, p, size, 1) != 1)
{
Expand All @@ -154,7 +154,7 @@ static inline int voc_readbytes(SDL_RWops *src, vs_t *v, void *p, int size)
} /* voc_readbytes */


static inline int voc_check_header(SDL_RWops *src)
static __inline__ int voc_check_header(SDL_RWops *src)
{
/* VOC magic header */
Uint8 signature[20]; /* "Creative Voice File\032" */
Expand Down
20 changes: 10 additions & 10 deletions decoders/wav.c
Expand Up @@ -72,7 +72,7 @@ const Sound_DecoderFunctions __Sound_DecoderFunctions_WAV =


/* Better than SDL_ReadLE16, since you can detect i/o errors... */
static inline int read_le16(SDL_RWops *rw, Uint16 *ui16)
static __inline__ int read_le16(SDL_RWops *rw, Uint16 *ui16)
{
int rc = SDL_RWread(rw, ui16, sizeof (Uint16), 1);
BAIL_IF_MACRO(rc != 1, ERR_IO_ERROR, 0);
Expand All @@ -82,7 +82,7 @@ static inline int read_le16(SDL_RWops *rw, Uint16 *ui16)


/* Better than SDL_ReadLE32, since you can detect i/o errors... */
static inline int read_le32(SDL_RWops *rw, Uint32 *ui32)
static __inline__ int read_le32(SDL_RWops *rw, Uint32 *ui32)
{
int rc = SDL_RWread(rw, ui32, sizeof (Uint32), 1);
BAIL_IF_MACRO(rc != 1, ERR_IO_ERROR, 0);
Expand All @@ -92,7 +92,7 @@ static inline int read_le32(SDL_RWops *rw, Uint32 *ui32)


/* This is just cleaner on the caller's end... */
static inline int read_uint8(SDL_RWops *rw, Uint8 *ui8)
static __inline__ int read_uint8(SDL_RWops *rw, Uint8 *ui8)
{
int rc = SDL_RWread(rw, ui8, sizeof (Uint8), 1);
BAIL_IF_MACRO(rc != 1, ERR_IO_ERROR, 0);
Expand Down Expand Up @@ -322,7 +322,7 @@ static int read_fmt_normal(SDL_RWops *rw, fmt_t *fmt)
#define SMALLEST_ADPCM_DELTA 16


static inline int read_adpcm_block_headers(Sound_Sample *sample)
static __inline__ int read_adpcm_block_headers(Sound_Sample *sample)
{
Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
SDL_RWops *rw = internal->rw;
Expand Down Expand Up @@ -358,9 +358,9 @@ static inline int read_adpcm_block_headers(Sound_Sample *sample)
} /* read_adpcm_block_headers */


static inline void do_adpcm_nibble(Uint8 nib,
ADPCMBLOCKHEADER *header,
Sint32 lPredSamp)
static __inline__ void do_adpcm_nibble(Uint8 nib,
ADPCMBLOCKHEADER *header,
Sint32 lPredSamp)
{
static const Sint32 max_audioval = ((1<<(16-1))-1);
static const Sint32 min_audioval = -(1<<(16-1));
Expand Down Expand Up @@ -396,7 +396,7 @@ static inline void do_adpcm_nibble(Uint8 nib,
} /* do_adpcm_nibble */


static inline int decode_adpcm_sample_frame(Sound_Sample *sample)
static __inline__ int decode_adpcm_sample_frame(Sound_Sample *sample)
{
Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
wav_t *w = (wav_t *) internal->decoder_private;
Expand Down Expand Up @@ -435,7 +435,7 @@ static inline int decode_adpcm_sample_frame(Sound_Sample *sample)
} /* decode_adpcm_sample_frame */


static inline void put_adpcm_sample_frame1(void *_buf, fmt_t *fmt)
static __inline__ void put_adpcm_sample_frame1(void *_buf, fmt_t *fmt)
{
Uint16 *buf = (Uint16 *) _buf;
ADPCMBLOCKHEADER *headers = fmt->fmt.adpcm.blockheaders;
Expand All @@ -445,7 +445,7 @@ static inline void put_adpcm_sample_frame1(void *_buf, fmt_t *fmt)
} /* put_adpcm_sample_frame1 */


static inline void put_adpcm_sample_frame2(void *_buf, fmt_t *fmt)
static __inline__ void put_adpcm_sample_frame2(void *_buf, fmt_t *fmt)
{
Uint16 *buf = (Uint16 *) _buf;
ADPCMBLOCKHEADER *headers = fmt->fmt.adpcm.blockheaders;
Expand Down

0 comments on commit 48cc608

Please sign in to comment.