1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2014-2015 Richard Hughes <richard@hughsie.com>
4 *
5 * Licensed under the GNU Lesser General Public License Version 2.1
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
20 */
21
22/**
23 * SECTION:dnf-version
24 * @short_description: Preprocessor macros for the libdnf version
25 * @include: libdnf.h
26 * @stability: Stable
27 *
28 * These functions are used in client code to conditionalize compilation
29 * depending on the version of libdnf headers installed.
30 */
31
32#ifndef __DNF_VERSION_H
33#define __DNF_VERSION_H
34
35/* compile time version
36 */
37#define LIBDNF_MAJOR_VERSION				(@LIBDNF_MAJOR_VERSION@)
38#define LIBDNF_MINOR_VERSION				(@LIBDNF_MINOR_VERSION@)
39#define LIBDNF_MICRO_VERSION				(@LIBDNF_MICRO_VERSION@)
40#define LIBDNF_VERSION                                  "@LIBDNF_VERSION@"
41
42/* check whether a As version equal to or greater than
43 * major.minor.micro.
44 */
45#define DNF_CHECK_VERSION(major,minor,micro)    \
46    (LIBDNF_MAJOR_VERSION > (major) || \
47     (LIBDNF_MAJOR_VERSION == (major) && LIBDNF_MINOR_VERSION > (minor)) || \
48     (LIBDNF_MAJOR_VERSION == (major) && LIBDNF_MINOR_VERSION == (minor) && \
49      LIBDNF_MICRO_VERSION >= (micro)))
50
51#endif /* __DNF_VERSION_H */
52