1/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3  Copyright (C) 2014 Red Hat, Inc.
4
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  Lesser General Public License for more details.
14
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef __SPICE_VERSION_H__
19#define __SPICE_VERSION_H__
20
21#if !defined(__SPICE_CLIENT_H_INSIDE__) && !defined(SPICE_COMPILATION)
22#warning "Only <spice-client.h> can be included directly"
23#endif
24
25/**
26 * SECTION:spice-version
27 * @short_description: Spice-Gtk version checking
28 * @title: Version Information
29 * @include: spice-version.h
30 *
31 * Spice-Gtk provides macros to check the version of the library
32 * at compile-time
33 */
34
35/**
36 * SPICE_GTK_MAJOR_VERSION:
37 *
38 * Spice-Gtk major version component (e.g. 1 if version is 1.2.3)
39 * Since: 0.24
40 */
41#define SPICE_GTK_MAJOR_VERSION              (@SPICE_GTK_MAJOR_VERSION@)
42
43/**
44 * SPICE_GTK_MINOR_VERSION:
45 *
46 * Spice-Gtk minor version component (e.g. 2 if version is 1.2.3)
47 * Since: 0.24
48 */
49#define SPICE_GTK_MINOR_VERSION              (@SPICE_GTK_MINOR_VERSION@)
50
51/**
52 * SPICE_GTK_MICRO_VERSION:
53 *
54 * Spice-Gtk micro version component (e.g. 3 if version is 1.2.3)
55 * Since: 0.24
56 */
57#define SPICE_GTK_MICRO_VERSION              (@SPICE_GTK_MICRO_VERSION@)
58
59/**
60 * SPICE_GTK_CHECK_VERSION:
61 * @major: required major version
62 * @minor: required minor version
63 * @micro: required micro version
64 *
65 * Compile-time version checking. Evaluates to %TRUE if the version
66 * of Spice-Gtk is greater than the required one.
67 * Since: 0.24
68 */
69#define SPICE_GTK_CHECK_VERSION(major, minor, micro)                    \
70        (SPICE_GTK_MAJOR_VERSION > (major) ||                           \
71         (SPICE_GTK_MAJOR_VERSION == (major) && SPICE_GTK_MINOR_VERSION > (minor)) || \
72         (SPICE_GTK_MAJOR_VERSION == (major) && SPICE_GTK_MINOR_VERSION == (minor) && \
73          SPICE_GTK_MICRO_VERSION >= (micro)))
74
75
76#endif /* __SPICE_VERSION_H__ */
77