add option to enable/disable udev support

This commit is contained in:
Gwenhael Goavec-Merou
2020-03-14 19:42:07 +01:00
parent 35b56887de
commit 8f2d6cb1c9
5 changed files with 45 additions and 3 deletions
+16
View File
@@ -7,7 +7,9 @@
#include <iostream>
#ifdef USE_UDEV
#include <libudev.h>
#endif
#include <libusb.h>
#include "ftdipp_mpsse.hpp"
@@ -346,6 +348,7 @@ int FTDIpp_MPSSE::mpsse_read(unsigned char *rx_buff, int len)
return num_read;
}
#ifdef USE_UDEV
unsigned int FTDIpp_MPSSE::udevstufftoint(const char *udevstring, int base)
{
char *endp;
@@ -436,3 +439,16 @@ bool FTDIpp_MPSSE::search_with_dev(const string &device)
return true;
}
#else
unsigned int FTDIpp_MPSSE::udevstufftoint(const char *udevstring, int base)
{
(void)udevstring;
(void)base;
return 0;
}
bool FTDIpp_MPSSE::search_with_dev(const string &device)
{
(void)device;
return false;
}
#endif