1From 45c14ef4d5d7ced0fbf984208de44ced6d5ed898 Mon Sep 17 00:00:00 2001 2From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com> 3Date: Mon, 10 Sep 2018 15:52:09 +0200 4Subject: [PATCH] libusbgx: fix build with glibc-2.28 since <sys/sysmacros.h> 5 is no more included by <sys/types.h> 6 7Since https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html sys/sysmacros.h 8must be explicitly included. 9Without sys/sysmacros.h and with glibc-2.28 build fails with error like: 10src/.libs/libusbgx.so: undefined reference to minor' src/.libs/libusbgx.so: undefined reference tomajor' 11src/.libs/libusbgx.so: undefined reference to `makedev' 12 13Signed-off-by: Sid Spry <R030t1@gmail.com> 14Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com> 15--- 16 examples/gadget-acm-ecm.c | 1 + 17 examples/gadget-import.c | 1 + 18 examples/gadget-ms.c | 1 + 19 examples/show-gadgets.c | 1 + 20 examples/show-udcs.c | 1 + 21 include/usbg/usbg_internal_libconfig.h | 1 + 22 6 files changed, 6 insertions(+) 23 24diff --git a/examples/gadget-acm-ecm.c b/examples/gadget-acm-ecm.c 25index 1c5e2ca..29360da 100644 26--- a/examples/gadget-acm-ecm.c 27+++ b/examples/gadget-acm-ecm.c 28@@ -20,6 +20,7 @@ 29 30 #include <errno.h> 31 #include <stdio.h> 32+#include <sys/sysmacros.h> 33 #include <linux/usb/ch9.h> 34 #include <usbg/usbg.h> 35 36diff --git a/examples/gadget-import.c b/examples/gadget-import.c 37index e684fdb..63df449 100644 38--- a/examples/gadget-import.c 39+++ b/examples/gadget-import.c 40@@ -25,6 +25,7 @@ 41 #include <errno.h> 42 #include <string.h> 43 #include <stdio.h> 44+#include <sys/sysmacros.h> 45 #include <usbg/usbg.h> 46 47 int main(int argc, char **argv) 48diff --git a/examples/gadget-ms.c b/examples/gadget-ms.c 49index 478c370..a5c6681 100644 50--- a/examples/gadget-ms.c 51+++ b/examples/gadget-ms.c 52@@ -23,6 +23,7 @@ 53 54 #include <errno.h> 55 #include <stdio.h> 56+#include <sys/sysmacros.h> 57 #include <linux/usb/ch9.h> 58 #include <usbg/usbg.h> 59 #include <usbg/function/ms.h> 60diff --git a/examples/show-gadgets.c b/examples/show-gadgets.c 61index 707d448..a2a21c8 100644 62--- a/examples/show-gadgets.c 63+++ b/examples/show-gadgets.c 64@@ -21,6 +21,7 @@ 65 #include <errno.h> 66 #include <stdio.h> 67 #include <string.h> 68+#include <sys/sysmacros.h> 69 #include <netinet/ether.h> 70 #include <usbg/usbg.h> 71 #include <usbg/function/ms.h> 72diff --git a/examples/show-udcs.c b/examples/show-udcs.c 73index 66e950f..2f5cc45 100644 74--- a/examples/show-udcs.c 75+++ b/examples/show-udcs.c 76@@ -23,6 +23,7 @@ 77 78 #include <errno.h> 79 #include <stdio.h> 80+#include <sys/sysmacros.h> 81 #include <usbg/usbg.h> 82 83 int main(void) 84diff --git a/include/usbg/usbg_internal_libconfig.h b/include/usbg/usbg_internal_libconfig.h 85index ac51758..3fa55c0 100644 86--- a/include/usbg/usbg_internal_libconfig.h 87+++ b/include/usbg/usbg_internal_libconfig.h 88@@ -12,6 +12,7 @@ 89 #ifndef USBG_INTERNAL_LIBCONFIG_H 90 #define USBG_INTERNAL_LIBCONFIG_H 91 92+#include <sys/sysmacros.h> 93 #include <libconfig.h> 94 #ifdef __cplusplus 95 extern "C" { 96-- 972.16.4 98 99