From 710bbde09c45cf32e94e815f43ce48fd80c9d77b Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 7 Apr 2017 03:33:03 -0700 Subject: Ensure SDL_AUDIO_BITSIZE is defined for older SDL2 versions --- examples/alloopback.c | 7 +++++++ examples/alstream.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/examples/alloopback.c b/examples/alloopback.c index 95ac433f..16553f9b 100644 --- a/examples/alloopback.c +++ b/examples/alloopback.c @@ -38,6 +38,13 @@ #include "common/alhelpers.h" +#ifndef SDL_AUDIO_MASK_BITSIZE +#define SDL_AUDIO_MASK_BITSIZE (0xFF) +#endif +#ifndef SDL_AUDIO_BITSIZE +#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE) +#endif + #ifndef M_PI #define M_PI (3.14159265358979323846) #endif diff --git a/examples/alstream.c b/examples/alstream.c index d13899d0..68115e8d 100644 --- a/examples/alstream.c +++ b/examples/alstream.c @@ -39,6 +39,13 @@ #include "common/alhelpers.h" +#ifndef SDL_AUDIO_MASK_BITSIZE +#define SDL_AUDIO_MASK_BITSIZE (0xFF) +#endif +#ifndef SDL_AUDIO_BITSIZE +#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE) +#endif + /* Define the number of buffers and buffer size (in milliseconds) to use. 4 * buffers with 200ms each gives a nice per-chunk size, and lets the queue last * for almost one second. */ -- cgit v1.2.3