Discussion:
[libusb] [libusb-compat][PATCH] fix a build issue on linux
Bartosz Golaszewski
2017-07-03 14:17:30 UTC
Permalink
On linux PATH_MAX is defined in linux/limits.h. If we include usb.h
without previously having indirectly included it, the build fails.

Signed-off-by: Bartosz Golaszewski <***@bgdev.pl>
---
libusb/usb.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/libusb/usb.h b/libusb/usb.h
index fa0e6c6..7823742 100644
--- a/libusb/usb.h
+++ b/libusb/usb.h
@@ -45,6 +45,11 @@ typedef unsigned __int32 uint32_t;
#include <stdint.h>
#endif

+/* On linux PATH_MAX is defined in linux/limits.h. */
+#if defined(__linux__)
+#include <linux/limits.h>
+#endif
+
/*
* USB spec information
*
--
2.9.3
Bartosz Golaszewski
2017-07-20 09:13:58 UTC
Permalink
Post by Bartosz Golaszewski
On linux PATH_MAX is defined in linux/limits.h. If we include usb.h
without previously having indirectly included it, the build fails.
---
libusb/usb.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libusb/usb.h b/libusb/usb.h
index fa0e6c6..7823742 100644
--- a/libusb/usb.h
+++ b/libusb/usb.h
@@ -45,6 +45,11 @@ typedef unsigned __int32 uint32_t;
#include <stdint.h>
#endif
+/* On linux PATH_MAX is defined in linux/limits.h. */
+#if defined(__linux__)
+#include <linux/limits.h>
+#endif
+
/*
* USB spec information
*
--
2.9.3
Hello,

are there any objections against merging this? Not including
linux/limits.h breaks the build in buildroot for some toolchains.

Thanks,
Bartosz

Continue reading on narkive:
Loading...