aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2022-06-10 21:10:31 +0200
committerMattias Andrée <maandree@kth.se>2022-06-10 21:10:31 +0200
commit42ae2010eb816fad62d2ecbaa117bf0d37b262e1 (patch)
treeac5920df84123ce066d7d3c7fef851dee592fcdb
parentFix install path for license (diff)
downloadbus-3.1.9.tar.gz
bus-3.1.9.tar.bz2
bus-3.1.9.tar.xz
Assume libc (correctly) does not define union semun3.1.9
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--config.mk2
-rw-r--r--libbus.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/config.mk b/config.mk
index 6f9acdb..494927c 100644
--- a/config.mk
+++ b/config.mk
@@ -4,3 +4,5 @@ MANPREFIX = $(PREFIX)/share/man
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_GNU_SOURCE
CFLAGS = -std=c99 -Wall -Wextra -pedantic -O2 $(CPPFLAGS)
LDFLAGS = -s -lrt
+
+# Add -DSEMUN_ALREADY_DEFINED to CPPFLAGS if `union semun` is already defined by libc
diff --git a/libbus.c b/libbus.c
index 0a84353..5abb4e5 100644
--- a/libbus.c
+++ b/libbus.c
@@ -196,7 +196,7 @@
-#ifdef _SEM_SEMUN_UNDEFINED
+#ifndef SEMUN_ALREADY_DEFINED
union semun {
int val;
struct semid_ds *buf;