Closed reitermarkus closed 1 year ago
Just add a 4th argument and pass NULL (unless you want to get the detected plist type).
Just add a 4th argument and pass NULL
That's a compiler error for versions 2.0.0 to 2.2.0 though, unless I am missing something.
Obviously you need to increase version requirment for shairport-sync to 2.3.0 or add a version dependent compile time check.
add a version dependent compile time check
Okay, then I guess what I am asking is: What is the recommended compile-time check to use in configure.ac
?
In https://github.com/mikebrady/shairport-sync/pull/1675, I did come up with the following, but maybe there is a simpler way:
LIBPLIST_PACKAGE=libplist
PKG_CHECK_EXISTS(libplist-2.0, LIBPLIST_PACKAGE=libplist-2.0)
PKG_CHECK_MODULES(
[libplist], [${LIBPLIST_PACKAGE} >= 2.3.0],
[CFLAGS="${libplist_CFLAGS} ${CFLAGS}" LIBS="${libplist_LIBS} ${LIBS}" AC_DEFINE([HAVE_LIBPLIST_GE_2_3_0], 1, [libplist >= 2.3.0])],
[PKG_CHECK_MODULES(
[libplist], [${LIBPLIST_PACKAGE} >= 2.0.0],
[CFLAGS="${libplist_CFLAGS} ${CFLAGS}" LIBS="${libplist_LIBS} ${LIBS}"],
[AC_MSG_ERROR(AirPlay 2 support requires libplist 2.0.0 or later -- search for pkg libplist-dev on Debian or libplist-2.2.0 or later on FreeBSD!)]
)]
)
That would be the proper way I assume. If you want a hacky way you can dlsym the address of plist_from_memory and just define it with 4 parameters, as long as you don't call it with a non-Null 4th argument it should be fine I guess...
@reitermarkus does this need further clarification?
No, it's fixed now for my use case, thanks.
Version 2.3.0, a minor release, introduced a breaking change for
plist_from_memory
.I am trying to build
shairport-sync
, which usesplist_from_memory
with 3 arguments (https://github.com/mikebrady/shairport-sync/issues/1674).What is the migration path to support building with both 2.2.0 and 2.3.0?