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.
This commit is contained in:
parent
c379e04628
commit
e46c23128e
1 changed files with 10 additions and 4 deletions
14
src/raudio.c
14
src/raudio.c
|
@ -218,8 +218,8 @@ typedef enum { AUDIO_BUFFER_USAGE_STATIC = 0, AUDIO_BUFFER_USAGE_STREAM } AudioB
|
||||||
|
|
||||||
// Audio buffer structure
|
// Audio buffer structure
|
||||||
// NOTE: Slightly different logic is used when feeding data to the playback device depending on whether or not data is streamed
|
// 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;
|
typedef struct rAudioBuffer rAudioBuffer;
|
||||||
struct AudioBuffer {
|
struct rAudioBuffer {
|
||||||
mal_dsp dsp; // Required for format conversion
|
mal_dsp dsp; // Required for format conversion
|
||||||
float volume;
|
float volume;
|
||||||
float pitch;
|
float pitch;
|
||||||
|
@ -230,11 +230,15 @@ struct AudioBuffer {
|
||||||
bool isSubBufferProcessed[2];
|
bool isSubBufferProcessed[2];
|
||||||
unsigned int frameCursorPos;
|
unsigned int frameCursorPos;
|
||||||
unsigned int bufferSizeInFrames;
|
unsigned int bufferSizeInFrames;
|
||||||
AudioBuffer *next;
|
rAudioBuffer *next;
|
||||||
AudioBuffer *prev;
|
rAudioBuffer *prev;
|
||||||
unsigned char buffer[1];
|
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
|
// mini_al global variables
|
||||||
static mal_context context;
|
static mal_context context;
|
||||||
static mal_device device;
|
static mal_device device;
|
||||||
|
@ -1961,3 +1965,5 @@ void TraceLog(int msgType, const char *text, ...)
|
||||||
if (msgType == LOG_ERROR) exit(1);
|
if (msgType == LOG_ERROR) exit(1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#undef AudioBuffer
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue