Attempting to handle lack of audio backend.
h3rald h3rald@h3rald.com
Thu, 30 Jul 2026 09:33:27 +0200
2 files changed,
17 insertions(+),
1 deletions(-)
M
Makefile
→
Makefile
@@ -20,6 +20,12 @@ HAVE_ALSA := $(shell echo '\#include <alsa/asoundlib.h>' | $(CC) -E - >/dev/null 2>&1 && echo 1)
ifeq ($(HAVE_ALSA),1) LDFLAGS += -lasound endif + # Fallback to libossaudio +else ifeq ($(HAVE_OSSAUDIO),1) + LDLIBS += -lossaudio +else + # No audio backend (beeper will throw an error) + CFLAGS += -DXYW_NO_AUDIO_BACKEND endif .PHONY: clean test
M
devices/beeper.c
→
devices/beeper.c
@@ -82,7 +82,17 @@ *out_frames = frames;
return buf; } -#if defined(_WIN32) +#if defined(XYW_NO_AUDIO_BACKEND) + +static void beep_play_tone(double frequency_hz, unsigned long duration_ms, double volume, xyw_byte *error) +{ + (void)frequency_hz; + (void)duration_ms; + (void)volume; + *error = BEEPER_ERROR_DEVICE; +} + +#elif defined(_WIN32) #include <windows.h> #include <mmsystem.h>