mirror of
https://github.com/vlang/v.git
synced 2025-09-11 16:36:20 -04:00
sokol: fix audio example to work on FreeBSD (#21558)
This commit is contained in:
parent
27833e0dbe
commit
5407dbbde7
6
thirdparty/sokol/sokol_audio.h
vendored
6
thirdparty/sokol/sokol_audio.h
vendored
@ -780,7 +780,13 @@ inline void saudio_setup(const saudio_desc& desc) { return saudio_setup(&desc);
|
|||||||
#include "aaudio/AAudio.h"
|
#include "aaudio/AAudio.h"
|
||||||
#endif
|
#endif
|
||||||
#elif defined(_SAUDIO_LINUX)
|
#elif defined(_SAUDIO_LINUX)
|
||||||
|
// __v_ start
|
||||||
|
#if !defined(__FreeBSD__)
|
||||||
|
// __v_ end
|
||||||
#include <alloca.h>
|
#include <alloca.h>
|
||||||
|
// __v_ start
|
||||||
|
#endif
|
||||||
|
// __v_ end
|
||||||
#define _SAUDIO_PTHREADS (1)
|
#define _SAUDIO_PTHREADS (1)
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#define ALSA_PCM_NEW_HW_PARAMS_API
|
#define ALSA_PCM_NEW_HW_PARAMS_API
|
||||||
|
@ -8,11 +8,15 @@ $if linux {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#flag -I @VEXEROOT/thirdparty/sokol
|
#flag -I @VEXEROOT/thirdparty/sokol
|
||||||
|
// FreeBSD requires the audio/alsa-lib to be installed
|
||||||
|
#flag freebsd -I/usr/local/include
|
||||||
#define SOKOL_IMPL
|
#define SOKOL_IMPL
|
||||||
#include "sokol_audio.h"
|
#include "sokol_audio.h"
|
||||||
#flag linux -lasound
|
#flag linux -lasound
|
||||||
#flag darwin -framework AudioToolbox
|
#flag darwin -framework AudioToolbox
|
||||||
#flag windows -lole32
|
#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)
|
// callback function for `stream_cb` in [[C.saudio_desc](#C.saudio_desc)] when calling [audio.setup()](#setup)
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user