Permalink
Browse files

Build on FreeBSD

  • Loading branch information...
1 parent 42f77da commit 246358c631dd496ae7bfbf806c47bedb2d6b9c60 David Brownell committed Nov 1, 2007
Showing with 20 additions and 1 deletion.
  1. +3 −0 ChangeLog
  2. +17 −1 lsusb.c
View
@@ -1,3 +1,6 @@
+2007-10-31 Joe Peterson <lavajoe@gentoo.org>
+ * lsusb.c: compile on FreeBSD
+
2007-10-29 Robin H. Johnson <robbat2@gentoo.org>
* update-usbids.sh: add "-q" (quiet) option for cron jobs;
skip filesystems that are readonly
View
@@ -35,13 +35,29 @@
#include <errno.h>
#include <stdio.h>
#include <stdarg.h>
+
+#ifdef __FreeBSD__
+
+#include <machine/endian.h>
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+#define le16_to_cpu(x) (x)
+#else
+#define le16_to_cpu __bswap16
+#endif
+
+#else /* Linux */
+
#include <asm/byteorder.h>
#define le16_to_cpu __le16_to_cpu
+
+#endif
+
#include <usb.h>
/* NOTE: that should be <libusb.h> and it should include
- * <linux/usb_ch9.h> ... without it, we keep accumulating
+ * <linux/usb/ch9.h> ... without it, we keep accumulating
* potentially broken variants of standard types ...
+ * also <linux/usb/cdc.h>, <linux/usb/audio.h>, etc
*/
#include "names.h"

0 comments on commit 246358c

Please sign in to comment.