diff options
author | Philippe Normand <philn@igalia.com> | 2022-05-05 13:30:54 +0100 |
---|---|---|
committer | Philippe Normand <philn@igalia.com> | 2022-05-05 17:25:10 +0100 |
commit | 22e5f5e5b0558a20d1740542718ae790541ae63c (patch) | |
tree | 02e836b924ecd7ed1da6cadb5603a7cd06a3a7c9 | |
parent | 2eb9633ca96b5d453d842bc95333e36869fb3a7a (diff) |
Add NICE_CHECK_VERSION macro
-rw-r--r-- | meson.build | 4 | ||||
-rw-r--r-- | nice/nice.h | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 7a18409..a4a5d3a 100644 --- a/meson.build +++ b/meson.build @@ -78,6 +78,10 @@ add_project_arguments('-D_GNU_SOURCE', '-DHAVE_CONFIG_H', '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_' + glib_req_minmax_str, '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_' + glib_req_minmax_str, + '-DNICE_VERSION_MAJOR=' + version_major, + '-DNICE_VERSION_MINOR=' + version_minor, + '-DNICE_VERSION_MICRO=' + version_micro, + '-DNICE_VERSION_NANO=' + version_nano, language: 'c') cdata = configuration_data() diff --git a/nice/nice.h b/nice/nice.h index 5587ec4..bb63129 100644 --- a/nice/nice.h +++ b/nice/nice.h @@ -39,6 +39,14 @@ #ifndef _NICE_H #define _NICE_H +#define NICE_CHECK_VERSION(major, minor, micro) \ + (NICE_VERSION_MAJOR > (major) || \ + (NICE_VERSION_MAJOR == (major) && NICE_VERSION_MINOR > (minor)) || \ + (NICE_VERSION_MAJOR == (major) && NICE_VERSION_MINOR == (minor) && \ + NICE_VERSION_MICRO >= (micro)) || \ + (NICE_VERSION_MAJOR == (major) && NICE_VERSION_MINOR == (minor) && \ + NICE_VERSION_MICRO + 1 == (micro) && NICE_VERSION_NANO > 0)) + #include "agent.h" #include "interfaces.h" |