Commit 2903028e6b6228366d270b6b673b5e6961a64a49

ckolivas 2013-09-28T11:45:58

Use macro expansion to generate extern device_drv prototypes.

diff --git a/miner.h b/miner.h
index 780b36b..bf932dd 100644
--- a/miner.h
+++ b/miner.h
@@ -248,6 +248,11 @@ enum drv_driver {
 };
 #undef DRIVER_ADD_COMMAND
 
+/* Use DRIVER_PARSE_COMMANDS to generate extern device_drv prototypes */
+#define DRIVER_ADD_COMMAND(X) extern struct device_drv X##_drv;
+DRIVER_PARSE_COMMANDS;
+#undef DRIVER_ADD_COMMAND
+
 enum alive {
 	LIFE_WELL,
 	LIFE_SICK,
diff --git a/usbutils.c b/usbutils.c
index 28933ef..2a20b7f 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -406,30 +406,6 @@ static struct usb_find_devices find_dev[] = {
 	{ DRV_LAST, NULL, 0, 0, 0, NULL, NULL, 0, 0, 0, 0, NULL }
 };
 
-#ifdef USE_BFLSC
-extern struct device_drv bflsc_drv;
-#endif
-
-#ifdef USE_BITFORCE
-extern struct device_drv bitforce_drv;
-#endif
-
-#ifdef USE_BITFURY
-extern struct device_drv bitfury_drv;
-#endif
-
-#ifdef USE_MODMINER
-extern struct device_drv modminer_drv;
-#endif
-
-#ifdef USE_ICARUS
-extern struct device_drv icarus_drv;
-#endif
-
-#ifdef USE_AVALON
-extern struct device_drv avalon_drv;
-#endif
-
 #define STRBUFLEN 256
 static const char *BLANK = "";
 static const char *space = " ";