Use macro expansion to generate extern device_drv prototypes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
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 = " ";