changeset 401:c42ac9ee2ce4

Fixed "inline" keyword to compile.
author Ryan C. Gordon <icculus@icculus.org>
date Fri, 12 Jul 2002 23:16:24 +0000
parents 9d0b5ec9cc26
children 7ced6c44b827
files SDL_sound_internal.h decoders/mpglib/mpg123_sdlsound.h decoders/shn.c decoders/smpeg.c decoders/voc.c decoders/wav.c
diffstat 6 files changed, 26 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/SDL_sound_internal.h	Thu Jul 11 05:28:52 2002 +0000
+++ b/SDL_sound_internal.h	Fri Jul 12 23:16:24 2002 +0000
@@ -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)
--- a/decoders/mpglib/mpg123_sdlsound.h	Thu Jul 11 05:28:52 2002 +0000
+++ b/decoders/mpglib/mpg123_sdlsound.h	Fri Jul 12 23:16:24 2002 +0000
@@ -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
--- a/decoders/shn.c	Thu Jul 11 05:28:52 2002 +0000
+++ b/decoders/shn.c	Fri Jul 12 23:16:24 2002 +0000
@@ -323,11 +323,11 @@
 } /* 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 */
 
 
@@ -347,7 +347,7 @@
  * 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;
@@ -369,7 +369,8 @@
 
 
 /* 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;
@@ -433,7 +434,7 @@
 } /* init_shn_offset */
 
 
-static inline Uint16 cvt_shnftype_to_sdlfmt(Sint16 shntype)
+static __inline__ Uint16 cvt_shnftype_to_sdlfmt(Sint16 shntype)
 {
     switch (shntype)
     {
@@ -465,7 +466,7 @@
 } /* 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;
@@ -543,7 +544,7 @@
 } /* 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;
--- a/decoders/smpeg.c	Thu Jul 11 05:28:52 2002 +0000
+++ b/decoders/smpeg.c	Fri Jul 12 23:16:24 2002 +0000
@@ -94,7 +94,7 @@
 } /* _SMPEG_quit */
 
 
-static inline void output_version(void)
+static __inline__ void output_version(void)
 {
     static int first_time = 1;
 
--- a/decoders/voc.c	Thu Jul 11 05:28:52 2002 +0000
+++ b/decoders/voc.c	Fri Jul 12 23:16:24 2002 +0000
@@ -142,7 +142,7 @@
 } /* 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)
     {
@@ -154,7 +154,7 @@
 } /* 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" */
--- a/decoders/wav.c	Thu Jul 11 05:28:52 2002 +0000
+++ b/decoders/wav.c	Fri Jul 12 23:16:24 2002 +0000
@@ -72,7 +72,7 @@
 
 
 /* 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);
@@ -82,7 +82,7 @@
 
 
 /* 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);
@@ -92,7 +92,7 @@
 
 
 /* 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);
@@ -322,7 +322,7 @@
 #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;
@@ -358,9 +358,9 @@
 } /* 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));
@@ -396,7 +396,7 @@
 } /* 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;
@@ -435,7 +435,7 @@
 } /* 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;
@@ -445,7 +445,7 @@
 } /* 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;