Quick idea

What would you guys think of this small patch in SDL ? :

Index: SDL_audio.h===================================================================
RCS file: /cvs/SDL/include/SDL/SDL_audio.h,v
retrieving revision 1.3
diff -u -r1.3 SDL_audio.h
— SDL_audio.h 1999/11/23 20:38:21 1.3
+++ SDL_audio.h 1999/12/08 17:42:34
@@ -36,6 +36,7 @@
#include <SDL/SDL_types.h>
#include <SDL/SDL_error.h>
#include <SDL/SDL_rwops.h>
+#include <SDL/SDL_endian.h>

#include <SDL/begin_code.h>
/* Set up for C function definitions, even when using C++ /
@@ -68,9 +69,13 @@
#define AUDIO_S16LSB 0x8010 /
Signed 16-bit samples /
#define AUDIO_U16MSB 0x1010 /
As above, but big-endian byte order /
#define AUDIO_S16MSB 0x9010 /
As above, but big-endian byte order */
+#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define AUDIO_U16 AUDIO_U16LSB
#define AUDIO_S16 AUDIO_S16LSB

+#else
+#define AUDIO_U16 AUDIO_U16MSB
+#define AUDIO_S16 AUDIO_S16MSB
+#endif

/* A structure to hold a set of audio conversion filters and buffers */
typedef struct SDL_AudioCVT {

This way the AUDIO_?16 macros would always default to the correct byte order
depending on the architecture, unless explicitly specified. I’m not sure if
other applications depend on this behavior…


Stephane Peter
Programmer
Loki Entertainment Software

“Microsoft has done to computers what McDonald’s has done to gastronomy”