Browse Source

Bugfix: Fix warnings when built without libudev support

Luke Dashjr 13 years ago
parent
commit
c629cc5d79
1 changed files with 6 additions and 2 deletions
  1. 6 2
      fpgautils.c

+ 6 - 2
fpgautils.c

@@ -36,10 +36,10 @@
 #include "logging.h"
 #include "miner.h"
 
+#ifdef HAVE_LIBUDEV
 char
 serial_autodetect_udev(detectone_func_t detectone, const char*prodname)
 {
-#ifdef HAVE_LIBUDEV
 	if (total_devices == MAX_DEVICES)
 		return 0;
 
@@ -72,10 +72,14 @@ serial_autodetect_udev(detectone_func_t detectone, const char*prodname)
 	udev_unref(udev);
 
 	return found;
+}
 #else
+char
+serial_autodetect_udev(__maybe_unused detectone_func_t detectone, __maybe_unused const char*prodname)
+{
 	return 0;
-#endif
 }
+#endif
 
 char
 serial_autodetect_devserial(detectone_func_t detectone, const char*prodname)