Discussion:
[libusb] [PATCH] libusb.h: use __linux__ instead of __linux
Aurelien Jarno
2017-06-18 20:45:54 UTC
Permalink
From: Adrian Bunk <***@debian.org>

The check was added since sys/time.h is not available on Windows,
but breaks on PowerPC where __linux is not defined by GCC in strict
standards modes.

Signed-off-by: Adrian Bunk <***@debian.org>
Signed-off-by: Aurelien Jarno <***@aurel32.net>
---
libusb/libusb.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

This patch has been sent through the Debian BTS. See:
https://bugs.debian.org/865026

diff --git a/libusb/libusb.h b/libusb/libusb.h
index c562690..f0f6d71 100644
--- a/libusb/libusb.h
+++ b/libusb/libusb.h
@@ -54,7 +54,7 @@ typedef unsigned __int32 uint32_t;
#include <sys/types.h>
#endif

-#if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__HAIKU__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__HAIKU__)
#include <sys/time.h>
#endif
--
2.11.0
Ludovic Rousseau
2017-06-19 09:33:32 UTC
Permalink
Hello,

I created the Pull Request https://github.com/libusb/libusb/pull/315 to get
some automatic tests.
The patch looks OK to me.

Thanks
Post by Aurelien Jarno
The check was added since sys/time.h is not available on Windows,
but breaks on PowerPC where __linux is not defined by GCC in strict
standards modes.
---
libusb/libusb.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
https://bugs.debian.org/865026
diff --git a/libusb/libusb.h b/libusb/libusb.h
index c562690..f0f6d71 100644
--- a/libusb/libusb.h
+++ b/libusb/libusb.h
@@ -54,7 +54,7 @@ typedef unsigned __int32 uint32_t;
#include <sys/types.h>
#endif
-#if defined(__linux) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__HAIKU__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__CYGWIN__) || defined(__HAIKU__)
#include <sys/time.h>
#endif
--
2.11.0
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
libusb-devel mailing list
https://lists.sourceforge.net/lists/listinfo/libusb-devel
--
Dr. Ludovic Rousseau
Loading...