#ifndef LIBSERIALPORT_LIBSERIALPORT_INTERNAL_H
#define LIBSERIALPORT_LIBSERIALPORT_INTERNAL_H
-#include "config.h"
#ifdef __linux__
-#define _BSD_SOURCE /* For timeradd, timersub, timercmp. */
+/* For timeradd, timersub, timercmp, realpath. */
+#define _BSD_SOURCE 1 /* for glibc < 2.19 */
+#define _DEFAULT_SOURCE 1 /* for glibc >= 2.20 */
#endif
#include <string.h>
static const GUID name = { l,w1,w2,{ b1,b2,b3,b4,b5,b6,b7,b8 } }
#include <usbioctl.h>
#include <usbiodef.h>
+#include "windows_ddk.h"
#else
#include <limits.h>
#include <termios.h>
#include <sys/ioctl.h>
#include <sys/time.h>
-#include <limits.h>
+#include <time.h>
#include <poll.h>
#endif
#ifdef __APPLE__
#include <IOKit/serial/IOSerialKeys.h>
#include <IOKit/serial/ioss.h>
#include <sys/syslimits.h>
+#include <mach/mach_time.h>
#endif
#ifdef __linux__
#include <dirent.h>
#include "linux_termios.h"
/* TCGETX/TCSETX is not available everywhere. */
-#if defined(TCGETX) && defined(TCSETX) && defined(HAVE_TERMIOX)
+#if defined(TCGETX) && defined(TCSETX) && defined(HAVE_STRUCT_TERMIOX)
#define USE_TERMIOX
#endif
#endif
#endif
/* Non-standard baudrates are not available everywhere. */
-#if (defined(HAVE_TERMIOS_SPEED) || defined(HAVE_TERMIOS2_SPEED)) && defined(HAVE_BOTHER)
+#if (defined(HAVE_TERMIOS_SPEED) || defined(HAVE_TERMIOS2_SPEED)) && HAVE_DECL_BOTHER
#define USE_TERMIOS_SPEED
#endif
OVERLAPPED read_ovl;
OVERLAPPED wait_ovl;
DWORD events;
- BYTE pending_byte;
+ BYTE *write_buf;
+ DWORD write_buf_size;
BOOL writing;
BOOL wait_running;
#else
#define TRACE(fmt, ...) DEBUG_FMT("%s(" fmt ") called", __func__, __VA_ARGS__)
#define TRACE_VOID() DEBUG_FMT("%s() called", __func__)
-#define TRY(x) do { int ret = x; if (ret != SP_OK) RETURN_CODEVAL(ret); } while (0)
+#define TRY(x) do { int retval = x; if (retval != SP_OK) RETURN_CODEVAL(retval); } while (0)
SP_PRIV struct sp_port **list_append(struct sp_port **list, const char *portname);