changes for MSVC
This commit is contained in:
parent
432edf2101
commit
857fa0be76
|
@ -5,8 +5,8 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#endif
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#define __STDC_FORMAT_MACROS
|
#define __STDC_FORMAT_MACROS
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
@ -55,7 +55,7 @@ HANDLE openSerialPort(const char *portname)
|
||||||
if (portname[0] == 'C')
|
if (portname[0] == 'C')
|
||||||
fmt = "\\\\.\\%s";
|
fmt = "\\\\.\\%s";
|
||||||
else
|
else
|
||||||
fmt == "%s";
|
fmt = "%s";
|
||||||
snprintf(fullname, sizeof(fullname), fmt, portname);
|
snprintf(fullname, sizeof(fullname), fmt, portname);
|
||||||
DWORD accessdirection = GENERIC_READ | GENERIC_WRITE;
|
DWORD accessdirection = GENERIC_READ | GENERIC_WRITE;
|
||||||
HANDLE hSerial = CreateFile((LPCSTR)fullname,
|
HANDLE hSerial = CreateFile((LPCSTR)fullname,
|
||||||
|
|
Loading…
Reference in New Issue