summaryrefslogtreecommitdiff
path: root/libgweather/gweather-version.h.in
blob: b5be4e6cd26e7e85d34ce395fa84cdce7ab1ae61 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* gweather-version.h - libgweather versioning information
 *
 * SPDX-FileCopyrightText: 2014  Javier Jardón <jjardon@gnome.org>
 * SPDX-License-Identifier: LGPL-2.0-or-later
 *
 * Based on json-version from json-glib
 * Authored by Emmanuele Bassi <ebassi@gnome.org>
 * Adapted for libgweather by Javier Jardón <jjardon@gnome.org>
 */

#pragma once

#if !(defined(IN_GWEATHER_H) || defined(GWEATHER_COMPILATION))
#error "gweather-version.h must not be included individually, include gweather.h instead"
#endif

#ifndef _GWEATHER_EXTERN
#define _GWEATHER_EXTERN extern
#endif

/* Backstop for all symbols available before the introduction of versioned macros */
#define GWEATHER_AVAILABLE_IN_ALL       _GWEATHER_EXTERN

/**
 * GWEATHER_DISABLE_DEPRECATION_WARNINGS:
 *
 * Disable deprecation warnings from GWeather API.
 *
 * Must be defined before including `libgweather/gweather.h`.
 */
#ifdef GWEATHER_DISABLE_DEPRECATION_WARNINGS
# define GWEATHER_DEPRECATED _GWEATHER_EXTERN
# define GWEATHER_DEPRECATED_FOR(f) _GWEATHER_EXTERN
#else
# define GWEATHER_DEPRECATED G_DEPRECATED _GWEATHER_EXTERN
# define GWEATHER_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _GWEATHER_EXTERN
#endif

/**
 * GWEATHER_MAJOR_VERSION:
 *
 * LibGweather major version component (e.g. 1 if %GWEATHER_VERSION is 1.2.3)
 */
#mesondefine GWEATHER_MAJOR_VERSION

/**
 * GWEATHER_MINOR_VERSION:
 *
 * LibGweather minor version component (e.g. 2 if %GWEATHER_VERSION is 1.2.3)
 */
#mesondefine GWEATHER_MINOR_VERSION

/**
 * GWEATHER_MICRO_VERSION:
 *
 * LibGweather micro version component (e.g. 3 if %GWEATHER_VERSION is 1.2.3)
 */
#mesondefine GWEATHER_MICRO_VERSION

/**
 * GWEATHER_VERSION
 *
 * LibGweather version.
 */
#mesondefine GWEATHER_VERSION

/**
 * GWEATHER_VERSION_HEX:
 *
 * LibGweather version, encoded as an hexadecimal number, useful for
 * integer comparisons.
 */
#define GWEATHER_VERSION_HEX                (GWEATHER_MAJOR_VERSION << 24 | \
                                             GWEATHER_MINOR_VERSION << 16 | \
                                             GWEATHER_MICRO_VERSION << 8)

/**
 * GWEATHER_CHECK_VERSION:
 * @major: required major version
 * @minor: required minor version
 * @micro: required micro version
 *
 * Compile-time version checking. Evaluates to %TRUE if the version
 * of LibGweather is greater than the required one.
 */
#define GWEATHER_CHECK_VERSION(major,minor,micro)   \
        (GWEATHER_MAJOR_VERSION > (major) || \
         (GWEATHER_MAJOR_VERSION == (major) && GWEATHER_MINOR_VERSION > (minor)) || \
         (GWEATHER_MAJOR_VERSION == (major) && GWEATHER_MINOR_VERSION == (minor) && \
          GWEATHER_MICRO_VERSION >= (micro)))