sokol: fix audio example to work on FreeBSD (#21558)

This commit is contained in:
Kim Shrier 2024-05-23 23:12:41 -06:00 committed by GitHub
parent 27833e0dbe
commit 5407dbbde7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -780,7 +780,13 @@ inline void saudio_setup(const saudio_desc& desc) { return saudio_setup(&desc);
#include "aaudio/AAudio.h"
#endif
#elif defined(_SAUDIO_LINUX)
// __v_ start
#if !defined(__FreeBSD__)
// __v_ end
#include <alloca.h>
// __v_ start
#endif
// __v_ end
#define _SAUDIO_PTHREADS (1)
#include <pthread.h>
#define ALSA_PCM_NEW_HW_PARAMS_API

View File

@ -8,11 +8,15 @@ $if linux {
}
#flag -I @VEXEROOT/thirdparty/sokol
// FreeBSD requires the audio/alsa-lib to be installed
#flag freebsd -I/usr/local/include
#define SOKOL_IMPL
#include "sokol_audio.h"
#flag linux -lasound
#flag darwin -framework AudioToolbox
#flag windows -lole32
#flag freebsd -L/usr/local/lib
#flag freebsd -lasound
// callback function for `stream_cb` in [[C.saudio_desc](#C.saudio_desc)] when calling [audio.setup()](#setup)
//