]> sigrok.org Git - libserialport.git/blobdiff - serialport.c
Fix building on Cygwin.
[libserialport.git] / serialport.c
index 422b767a50366aeae3682b5a6124ecc5c06bcdcc..eda2d19250fdcc7316b9f1f60ffa21ff4d37655f 100644 (file)
@@ -1307,6 +1307,11 @@ SP_API enum sp_return sp_output_waiting(struct sp_port *port)
 {
        TRACE("%p", port);
 
+#ifdef __CYGWIN__
+       /* TIOCOUTQ is not defined in Cygwin headers */
+       RETURN_ERROR(SP_ERR_SUPP,
+                       "Getting output bytes waiting is not supported on Cygwin");
+#else
        CHECK_OPEN_PORT();
 
        DEBUG_FMT("Checking output bytes waiting on port %s", port->name);
@@ -1324,6 +1329,7 @@ SP_API enum sp_return sp_output_waiting(struct sp_port *port)
                RETURN_FAIL("TIOCOUTQ ioctl failed");
        RETURN_INT(bytes_waiting);
 #endif
+#endif
 }
 
 SP_API enum sp_return sp_new_event_set(struct sp_event_set **result_ptr)