Ensure SDL_AUDIO_BITSIZE is defined for older SDL2 versions

This commit is contained in:
Chris Robinson 2017-04-07 03:33:03 -07:00
parent 70a097bf59
commit 710bbde09c
2 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -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. */