mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 08:28:05 +02:00
nm-version: allow to define NM_VERSION_MAX_ALLOWED alone
Previously, if NM_VERSION_MIN_REQUIRED was not defined, it defaulted to
NM_VERSION. As a consequence, if NM_VERSION_MAX_ALLOWED was defined we
got a compilation error because MAX_ALLOWED < MIN_REQUIRED.
MAX_ALLOWED is used to get compilation warnings if you unintentionally
use a libnm's symbol introduced in a newer version. MIN_REQUIRED is used
to get rid of warnings about symbol deprecations.
Libnm users may want to use MAX_ALLOWED alone, because using a too new
symbol would fail to compile with older libnm. But they might want to
get deprecation warnings as soon as possible, so they want to leave
MIN_REQUIRED empty.
(cherry picked from commit f849163e82)
This commit is contained in:
parent
8f3b8e0200
commit
1bdcbdfd4f
1 changed files with 5 additions and 5 deletions
|
|
@ -12,16 +12,16 @@
|
||||||
|
|
||||||
/* Deprecation / Availability macros */
|
/* Deprecation / Availability macros */
|
||||||
|
|
||||||
#if !defined(NM_VERSION_MIN_REQUIRED) || (NM_VERSION_MIN_REQUIRED == 0)
|
|
||||||
#undef NM_VERSION_MIN_REQUIRED
|
|
||||||
#define NM_VERSION_MIN_REQUIRED (NM_API_VERSION)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(NM_VERSION_MAX_ALLOWED) || (NM_VERSION_MAX_ALLOWED == 0)
|
#if !defined(NM_VERSION_MAX_ALLOWED) || (NM_VERSION_MAX_ALLOWED == 0)
|
||||||
#undef NM_VERSION_MAX_ALLOWED
|
#undef NM_VERSION_MAX_ALLOWED
|
||||||
#define NM_VERSION_MAX_ALLOWED (NM_API_VERSION)
|
#define NM_VERSION_MAX_ALLOWED (NM_API_VERSION)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(NM_VERSION_MIN_REQUIRED) || (NM_VERSION_MIN_REQUIRED == 0)
|
||||||
|
#undef NM_VERSION_MIN_REQUIRED
|
||||||
|
#define NM_VERSION_MIN_REQUIRED (NM_VERSION_MAX_ALLOWED)
|
||||||
|
#endif
|
||||||
|
|
||||||
/* sanity checks */
|
/* sanity checks */
|
||||||
#if NM_VERSION_MIN_REQUIRED > NM_API_VERSION
|
#if NM_VERSION_MIN_REQUIRED > NM_API_VERSION
|
||||||
#error "NM_VERSION_MIN_REQUIRED must be <= NM_API_VERSION"
|
#error "NM_VERSION_MIN_REQUIRED must be <= NM_API_VERSION"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue