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:
parent
48a4076f69
commit
e4ce975a54
@ -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)
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user