mirror of
https://github.com/GOSTSec/sgminer
synced 2025-03-13 06:01:03 +00:00
Fix windows bitforce build.
This commit is contained in:
parent
be57725271
commit
0adbcd5d07
@ -141,17 +141,17 @@ static bool bitforce_detect_one(const char *devpath)
|
|||||||
#define LOAD_SYM(sym) do { \
|
#define LOAD_SYM(sym) do { \
|
||||||
if (!(sym = dlsym(dll, #sym))) { \
|
if (!(sym = dlsym(dll, #sym))) { \
|
||||||
applog(LOG_DEBUG, "Failed to load " #sym ", not using FTDI bitforce autodetect"); \
|
applog(LOG_DEBUG, "Failed to load " #sym ", not using FTDI bitforce autodetect"); \
|
||||||
goto nogood; \
|
goto out; \
|
||||||
} \
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
static int bitforce_autodetect_ftdi(void)
|
static int bitforce_autodetect_ftdi(void)
|
||||||
{
|
{
|
||||||
char buf[65 * numDevs];
|
|
||||||
char*bufptrs[numDevs + 1];
|
|
||||||
char devpath[] = "\\\\.\\COMnnnnn";
|
char devpath[] = "\\\\.\\COMnnnnn";
|
||||||
char *devpathnum = &devpath[7];
|
char *devpathnum = &devpath[7];
|
||||||
|
char **bufptrs;
|
||||||
|
char *buf;
|
||||||
int found = 0;
|
int found = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -173,7 +173,10 @@ static int bitforce_autodetect_ftdi(void)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
applog(LOG_DEBUG, "FTDI reports %u devices", (unsigned)numDevs);
|
applog(LOG_DEBUG, "FTDI reports %u devices", (unsigned)numDevs);
|
||||||
|
|
||||||
|
buf = alloca(65 * numDevs);
|
||||||
|
bufptrs = alloca(numDevs + 1);
|
||||||
|
|
||||||
for (i = 0; i < numDevs; ++i)
|
for (i = 0; i < numDevs; ++i)
|
||||||
bufptrs[i] = &buf[i * 65];
|
bufptrs[i] = &buf[i * 65];
|
||||||
bufptrs[numDevs] = NULL;
|
bufptrs[numDevs] = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user