From 10378f878a43d8a8f898661e67cc3b297a2c4ba6 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 22 Jan 2012 11:44:43 +1100 Subject: [PATCH] Fix windows build of bitforce blindly. Hopefully it works. --- bitforce.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bitforce.c b/bitforce.c index f548b072..82b3f776 100644 --- a/bitforce.c +++ b/bitforce.c @@ -13,7 +13,11 @@ #include #include #include +#ifndef WIN32 #include +#else +#define NAME_MAX 255 +#endif #include #include "elist.h" @@ -46,7 +50,7 @@ static bool bitforce_detect_one(const char *devpath) fclose(fileDev); if (unlikely(!strstr(pdevbuf, "SHA256"))) { - applog(LOG_DEBUG, "BitForce Detect: Didn't recognize BitForce on %s", devpath); + applog(LOG_DEBUG, "BitForce Detect: Didn't recognise BitForce on %s", devpath); return false; } @@ -110,9 +114,11 @@ static bool bitforce_thread_prepare(struct thr_info *thr) return false; } +#ifndef WIN32 { int nDevFD = fileno(fileDev); struct termios pattr; + tcgetattr(nDevFD, &pattr); pattr.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); pattr.c_oflag &= ~OPOST; @@ -121,6 +127,7 @@ static bool bitforce_thread_prepare(struct thr_info *thr) pattr.c_cflag |= CS8; tcsetattr(nDevFD, TCSANOW, &pattr); } +#endif setbuf(fileDev, NULL); bitforce->device_file = fileDev;