all repos — xyw @ c3c243426665133f31712e253f73e84e23881315

A minimal virtual machine and assembler for terminals.

Attempting to handle lack of audio backend.
h3rald h3rald@h3rald.com
Thu, 30 Jul 2026 09:33:27 +0200
commit

c3c243426665133f31712e253f73e84e23881315

parent

9b95f8c88d280f439af31a5aa65421325eed00f3

2 files changed, 17 insertions(+), 1 deletions(-)

jump to
M MakefileMakefile

@@ -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.cdevices/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>