Fixed build on OS/X.

This commit is contained in:
Daniel Beer 2010-11-13 13:18:33 +13:00
parent 591feb3545
commit a08d11b25b
1 changed files with 12 additions and 0 deletions

12
uif.c
View File

@ -25,7 +25,10 @@
#include <unistd.h>
#include <termios.h>
#if !(defined(__APPLE__) || defined(WIN32))
#include <linux/serial.h>
#endif
#include <sys/ioctl.h>
#include <fcntl.h>
@ -85,6 +88,7 @@ static void serial_destroy(transport_t tr_base)
free(tr);
}
#if !(defined(__APPLE__) || defined(WIN32))
static int open_olimex_iso(const char *device)
{
int fd = open(device, O_RDWR | O_NOCTTY);
@ -112,6 +116,14 @@ static int open_olimex_iso(const char *device)
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)
{