diff options
| author | Ray <raysan5@gmail.com> | 2019-02-12 15:53:34 +0100 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2019-02-12 15:53:34 +0100 |
| commit | e46c23128eb4765590e30751a9be51c76607ee07 (patch) | |
| tree | fb5df082cb17aec3fdab8ee21a7f91389b09da21 /src | |
| parent | c379e04628c7181918d54ebcff144b9149c262f1 (diff) | |
| download | raylib-e46c23128eb4765590e30751a9be51c76607ee07.tar.gz raylib-e46c23128eb4765590e30751a9be51c76607ee07.zip | |
Avoid AudioBuffer symbol collision on macOS
raudio AudioBuffer internal struct collides on macOS with CoreAudio same name struct. In this case struct has been renamed because is internal to raudio... but probably all system should be redesigned.
Diffstat (limited to 'src')
| -rw-r--r-- | src/raudio.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/raudio.c b/src/raudio.c index 53f3f25f..af4bc3a4 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -218,8 +218,8 @@ typedef enum { AUDIO_BUFFER_USAGE_STATIC = 0, AUDIO_BUFFER_USAGE_STREAM } AudioB // Audio buffer structure // NOTE: Slightly different logic is used when feeding data to the playback device depending on whether or not data is streamed -typedef struct AudioBuffer AudioBuffer; -struct AudioBuffer { +typedef struct rAudioBuffer rAudioBuffer; +struct rAudioBuffer { mal_dsp dsp; // Required for format conversion float volume; float pitch; @@ -230,11 +230,15 @@ struct AudioBuffer { bool isSubBufferProcessed[2]; unsigned int frameCursorPos; unsigned int bufferSizeInFrames; - AudioBuffer *next; - AudioBuffer *prev; + rAudioBuffer *next; + rAudioBuffer *prev; unsigned char buffer[1]; }; +// HACK: To avoid CoreAudio (macOS) symbol collision +// NOTE: This system should probably be redesigned +#define AudioBuffer rAudioBuffer + // mini_al global variables static mal_context context; static mal_device device; @@ -1961,3 +1965,5 @@ void TraceLog(int msgType, const char *text, ...) if (msgType == LOG_ERROR) exit(1); } #endif + +#undef AudioBuffer |
