From ab7365cc3184174c5d255751e1fd42847e1950ca Mon Sep 17 00:00:00 2001 From: ale Date: Sat, 1 May 2021 18:08:21 +0200 Subject: [PATCH] compatible with openbsd made the makefile compatible with openbsd, also since battery status is not exposed trough the filesystem, just printing "not supported" for now. --- makefile | 5 +++-- status.c | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile index 37ba9a7..1167827 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,7 @@ -CFLAGS = -Wall -Werror -pedantic -Ofast -std=c99 +INCS = -I/usr/X11R6/include +CFLAGS = -Wall -Werror -pedantic -Ofast -std=c99 ${INCS} LDFLAGS = -L/usr/X11R6/lib -lX11 -CC = gcc +CC ?= gcc PREFIX = /usr/local MANPREFIX = ${PREFIX}/share/man diff --git a/status.c b/status.c index 86b83d5..8699b97 100644 --- a/status.c +++ b/status.c @@ -73,6 +73,7 @@ static const char * get_date (void) return str; } +#if defined( __linux__ ) static const char * get_battery (void) { static char str[ELEMENT_SIZE] = {0}; static int init = 1; @@ -147,6 +148,11 @@ static const char * get_battery (void) { } return str; } +#elif defined( __OpenBSD__ ) +static const char * get_battery (void) { + return "not supported"; +} +#endif void die(const char *fmt, ...) {