]> sigrok.org Git - libserialport.git/commitdiff
Fix build for platforms without enumeration & port metadata support.
authorMartin Ling <redacted>
Sat, 14 Jun 2014 11:25:18 +0000 (12:25 +0100)
committerMartin Ling <redacted>
Sat, 14 Jun 2014 11:27:54 +0000 (12:27 +0100)
configure.ac
serialport.c

index 266879a5f1f56bdb912abde3bbc3e96f658a0e91..2df4865394e76b0e407aa7c76bdac726ee95c3b4 100644 (file)
@@ -101,6 +101,8 @@ mingw* | cygwin*)
        AM_CONDITIONAL([LINUX], false)
        AM_CONDITIONAL([WIN32], false)
        AM_CONDITIONAL([MACOSX], false)
+       AC_DEFINE(NO_ENUMERATION)
+       AC_DEFINE(NO_PORT_METADATA)
 esac
 
 AC_SUBST(SP_PKGLIBS)
index c75982165381cd28c426bfda6acd2a9d25d0cda1..290786a4c1ce92945baac78208033b54b6452e71 100644 (file)
@@ -99,10 +99,12 @@ enum sp_return sp_get_port_by_name(const char *portname, struct sp_port **port_p
        port->usb_serial = NULL;
        port->bluetooth_address = NULL;
 
+#ifndef NO_PORT_METADATA
        if ((ret = get_port_details(port)) != SP_OK) {
                sp_free_port(port);
                return ret;
        }
+#endif
 
        *port_ptr = port;
 
@@ -323,7 +325,11 @@ enum sp_return sp_list_ports(struct sp_port ***list_ptr)
 
        list[0] = NULL;
 
+#ifdef NO_ENUMERATION
+       ret = SP_ERR_SUPP;
+#else
        ret = list_ports(&list);
+#endif
 
        switch (ret) {
        case SP_OK: