diff --git a/include/mpd/client.h b/include/mpd/client.h index f14cecc..e12726e 100644 --- a/include/mpd/client.h +++ b/include/mpd/client.h @@ -58,6 +58,7 @@ #include "entity.h" #include "fingerprint.h" #include "idle.h" +#include "libmympdclient_version.h" #include "list.h" #include "message.h" #include "mixer.h" diff --git a/include/mpd/libmympdclient_version.h b/include/mpd/libmympdclient_version.h new file mode 100644 index 0000000..cf562ee --- /dev/null +++ b/include/mpd/libmympdclient_version.h @@ -0,0 +1,35 @@ +/* + SPDX-License-Identifier: GPL-2.0-or-later + myMPD (c) 2018-2019 Juergen Mang + https://github.com/jcorporation/libmpdclient +*/ + +/*! \file + * patched libmpdclient library for usage in myMPD + * + * Do not include this header directly. Use mpd/client.h instead. + */ + +#ifndef LIBMYMPDCLIENT_VERSION_H +#define LIBMYMPDCLIENT_VERSION_H + +#define LIBMYMPDCLIENT_MAJOR_VERSION 1 +#define LIBMYMPDCLIENT_MINOR_VERSION 0 +#define LIBMYMPDCLIENT_PATCH_VERSION 5 + +/** + * Preprocessor macro which allows you to check which version of + * libmpdclient you are compiling with. It can be used in + * preprocessor directives. + * + * @return true if this libmympdclient version equals or is newer than + * the specified version number + */ +#define LIBMYMPDCLIENT_CHECK_VERSION(major, minor, patch) \ + ((major) < LIBMYMPDCLIENT_MAJOR_VERSION || \ + ((major) == LIBMYMPDCLIENT_MAJOR_VERSION && \ + ((minor) < LIBMYMPDCLIENT_MINOR_VERSION || \ + ((minor) == LIBMYMPDCLIENT_MINOR_VERSION && \ + (patch) <= LIBMYMPDCLIENT_PATCH_VERSION)))) + +#endif diff --git a/meson.build b/meson.build index 6a311a1..2390f6d 100644 --- a/meson.build +++ b/meson.build @@ -190,6 +190,7 @@ install_headers( 'include/mpd/error.h', 'include/mpd/fingerprint.h', 'include/mpd/idle.h', + 'include/mpd/libmympdclient_version.h', 'include/mpd/list.h', 'include/mpd/mixer.h', 'include/mpd/mount.h',