Make volume component work on FreeBSD
authormichaelbuch12@gmail.com <michaelbuch12@gmail.com>
Fri, 1 Jan 2021 15:52:57 +0000 (16:52 +0100)
committerdrkhsh <me@drkhsh.at>
Wed, 26 Oct 2022 19:24:14 +0000 (21:24 +0200)
- Edit compile instructions
- Reuse OpenBSD sndio implementation

components/volume.c
config.def.h
config.mk

index b6665daff2959ae9a9bd73a26149f952b112a78d..32f781797f4a806081f59afc4859c24dd956afbe 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "../util.h"
 
-#if defined(__OpenBSD__)
+#if defined(__OpenBSD__) | defined(__FreeBSD__)
        #include <sys/queue.h>
        #include <poll.h>
        #include <sndio.h>
index 93a875ae770bfe374d5eb080bc10dff557a3c295..f76b60cd5f71374b698d351f4cb82d7dfc8c341e 100644 (file)
@@ -59,7 +59,7 @@ static const char unknown_str[] = "n/a";
  * uptime              system uptime                   NULL
  * username            username of current user        NULL
  * vol_perc            OSS/ALSA volume in percent      mixer file (/dev/mixer)
- *                                                     NULL on OpenBSD
+ *                                                     NULL on OpenBSD/FreeBSD
  * wifi_perc           WiFi signal in percent          interface name (wlan0)
  * wifi_essid          WiFi ESSID                      interface name (wlan0)
  */
index 2516e6e893a8784b66c7bf066bc87eac2705dcb9..6cce6833bf1ced210a8acbf33fec26d90b35304d 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -15,7 +15,7 @@ CPPFLAGS = -I$(X11INC) -D_DEFAULT_SOURCE
 CFLAGS   = -std=c99 -pedantic -Wall -Wextra -Os
 LDFLAGS  = -L$(X11LIB) -s
 # OpenBSD: add -lsndio
-# FreeBSD: add -lkvm
+# FreeBSD: add -lkvm -lsndio
 LDLIBS   = -lX11
 
 # compiler and linker