- use better ifdef blocks

This commit is contained in:
jasper 2010-12-02 11:40:53 +00:00
parent 211dfaec06
commit eda8250a16
2 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-olimex_c,v 1.1.1.1 2010/12/02 10:35:04 jasper Exp $
$OpenBSD: patch-olimex_c,v 1.2 2010/12/02 11:40:53 jasper Exp $
--- olimex.c.orig Wed Aug 4 04:08:43 2010
+++ olimex.c Thu Aug 12 13:04:12 2010
@@ -65,7 +65,7 @@ struct olimex_transport {
@ -6,7 +6,7 @@ $OpenBSD: patch-olimex_c,v 1.1.1.1 2010/12/02 10:35:04 jasper Exp $
struct usb_device *dev, int ino)
{
-#if !(defined (__APPLE__) || defined(WIN32))
+#if !(defined (__APPLE__) || defined(WIN32) || defined(__OpenBSD__))
+#if defined(__linux__)
int drv;
char drName[256];
#endif
@ -15,7 +15,7 @@ $OpenBSD: patch-olimex_c,v 1.1.1.1 2010/12/02 10:35:04 jasper Exp $
}
-#if !(defined(__APPLE__) || defined(WIN32))
+#if !(defined(__APPLE__) || defined(WIN32) || defined(__OpenBSD__))
+#if defined(__linux__)
drv = usb_get_driver_np(tr->handle, tr->int_number, drName,
sizeof(drName));
printf(__FILE__" : driver %d\n", drv);

View File

@ -1,4 +1,4 @@
$OpenBSD: patch-rf2500_c,v 1.1.1.1 2010/12/02 10:35:04 jasper Exp $
$OpenBSD: patch-rf2500_c,v 1.2 2010/12/02 11:40:53 jasper Exp $
- usb_bulk_read() returns 0 on timeout, not -1
@ -9,7 +9,7 @@ $OpenBSD: patch-rf2500_c,v 1.1.1.1 2010/12/02 10:35:04 jasper Exp $
}
-#if !(defined(__APPLE__) || defined(WIN32))
+#if !(defined(__APPLE__) || defined(WIN32) || defined(__OpenBSD__))
+#if defined(__linux__)
if (usb_detach_kernel_driver_np(tr->handle, tr->int_number) < 0)
perror("rf2500: warning: can't "
"detach kernel driver");