From 4e823d8db01570c216b6941341b623dcbef52cd5 Mon Sep 17 00:00:00 2001 From: Marcos Vives Del Sol Date: Sun, 22 Feb 2015 20:41:59 +0100 Subject: [PATCH] Use TIOCINQ instead of FIONREAD in Cygwin --- libnfc/buses/uart.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libnfc/buses/uart.c b/libnfc/buses/uart.c index 72594b0..3f41e19 100644 --- a/libnfc/buses/uart.c +++ b/libnfc/buses/uart.c @@ -83,9 +83,11 @@ const char *serial_ports_device_radix[] = { "ttyUSB", "ttyS", "ttyACM", "ttyAMA" # error "Can't determine serial string for your system" # endif +// As of 2015/Feb/22, Cygwin does not handle FIONREAD on physical serial devices. +// We'll use TIOCINQ instead which is pretty much the same. #ifdef __CYGWIN__ -// Under Cygwin, FIONREAD is defined in this file -# include +# include +# define FIONREAD TIOCINQ #endif // Work-around to claim uart interface using the c_iflag (software input processing) from the termios struct