summaryrefslogtreecommitdiffstats
path: root/src/include/gtkmm_version.h
blob: a23223cc46ac431dd94119eecc1cf69c68fd3722 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// SPDX-License-Identifier: GPL-2.0-or-later
/** @file
 * macro for checking gtkmm version
 *//*
 * Authors:
 *   Patrick Storz <eduard.braun2@gmx.de>
 *
 * Copyright (C) 2018 Authors
 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
 */

#ifndef SEEN_GTKMM_VERSION
#define SEEN_GTKMM_VERSION

#include <gtkmm.h>

#ifndef GTKMM_CHECK_VERSION

#if !defined(GTKMM_MAJOR_VERSION) || !defined(GTKMM_MINOR_VERSION) || !defined(GTKMM_MICRO_VERSION)
    #error "Missing defines for gtkmm version (GTKMM_MAJOR_VERSION / GTKMM_MINOR_VERSION / GTKMM_MICRO_VERSION)"
#endif

/**
 * Check GtkMM version
 *
 * This is adapted from the upstream Gtk+ macro for use with GtkMM
 *
 * @major: major version (e.g. 1 for version 1.2.5)
 * @minor: minor version (e.g. 2 for version 1.2.5)
 * @micro: micro version (e.g. 5 for version 1.2.5)
 *
 * Returns %TRUE if the version of the GTK+ header files
 * is the same as or newer than the passed-in version.
 *
 * Returns: %TRUE if GTK+ headers are new enough
 */
#define GTKMM_CHECK_VERSION(major,minor,micro)                            \
    (GTKMM_MAJOR_VERSION > (major) ||                                     \
    (GTKMM_MAJOR_VERSION == (major) && GTKMM_MINOR_VERSION > (minor)) ||  \
    (GTKMM_MAJOR_VERSION == (major) && GTKMM_MINOR_VERSION == (minor) &&  \
     GTKMM_MICRO_VERSION >= (micro)))

#endif // #ifndef GTKMM_CHECK_VERSION

#endif // SEEN_GTKMM_VERSION