Control: tag -1 patch

I just ran into this and am attaching a patch for it.

Ben.

-- 
Ben Hutchings
Design a system any fool can use, and only a fool will want to use it.


From: Ben Hutchings <b...@decadent.org.uk>
Date: Mon, 07 Jan 2019 21:21:23 +0000
Subject: modem_main: Fix build with glibc 2.28

Starting with glibc 2.28, the major() and minor() macros are defined
in <sys/sysmacros.h> which is not included by another header.

<sys/sysmacros.h> does not exist in older glibc versions, so we
shouldn't include it unconditionally.  Add a check for availability of
the header to the Makefile and define a macro to tell modem_main.c the
result.

---
--- a/modem/Makefile
+++ b/modem/Makefile
@@ -44,6 +44,10 @@ CFLAGS+= -DSUPPORT_ALSA=1
 LDFLAGS+= -lasound
 endif
 
+ifeq ($(shell echo '\#include <sys/sysmacros.h>' | $(CC) $(CFLAGS) $(CPPFLAGS) $(EXTRA_CFLAGS) -E -x c -o /dev/null - 2>&1),)
+CFLAGS+= -DHAVE_SYS_SYSMACROS_H
+endif
+
 slmodemd:
 	$(CC) -o slmodemd modem_main.o $(all-objs) $(LDFLAGS)
 
--- a/modem/modem_main.c
+++ b/modem/modem_main.c
@@ -55,6 +55,9 @@
 #include <sys/mman.h>
 #include <sys/time.h>
 #include <sys/resource.h>
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
 #include <sched.h>
 #include <signal.h>
 #include <limits.h>

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to