1
0
mirror of git://sigrok.org/libserialport synced 2023-08-10 21:13:24 +03:00

Fix build for platforms without enumeration & port metadata support.

This commit is contained in:
Martin Ling 2014-06-14 12:25:18 +01:00
parent 48a4076f69
commit e4ce975a54
2 changed files with 8 additions and 0 deletions

View 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)

View 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: