Fixed build on OS/X.
This commit is contained in:
parent
591feb3545
commit
a08d11b25b
12
uif.c
12
uif.c
|
@ -25,7 +25,10 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
|
||||||
|
#if !(defined(__APPLE__) || defined(WIN32))
|
||||||
#include <linux/serial.h>
|
#include <linux/serial.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
@ -85,6 +88,7 @@ static void serial_destroy(transport_t tr_base)
|
||||||
free(tr);
|
free(tr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !(defined(__APPLE__) || defined(WIN32))
|
||||||
static int open_olimex_iso(const char *device)
|
static int open_olimex_iso(const char *device)
|
||||||
{
|
{
|
||||||
int fd = open(device, O_RDWR | O_NOCTTY);
|
int fd = open(device, O_RDWR | O_NOCTTY);
|
||||||
|
@ -112,6 +116,14 @@ static int open_olimex_iso(const char *device)
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
static int open_olimex_iso(const char *device)
|
||||||
|
{
|
||||||
|
printc_err("open_olimex_iso: this driver is only supported on "
|
||||||
|
"Linux\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
transport_t uif_open(const char *device, uif_type_t type)
|
transport_t uif_open(const char *device, uif_type_t type)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue