summaryrefslogtreecommitdiffstats
path: root/fluent-bit/lib/jansson-e23f558/src/version.c
blob: f1026af14baa76ee5de4d635ba1291a21be03e98 (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
/*
 * Copyright (c) 2019 Sean Bright <sean.bright@gmail.com>
 *
 * Jansson is free software; you can redistribute it and/or modify
 * it under the terms of the MIT license. See LICENSE for details.
 */

#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif

#include "jansson.h"

const char *jansson_version_str(void) { return JANSSON_VERSION; }

int jansson_version_cmp(int major, int minor, int micro) {
    int diff;

    if ((diff = JANSSON_MAJOR_VERSION - major)) {
        return diff;
    }

    if ((diff = JANSSON_MINOR_VERSION - minor)) {
        return diff;
    }

    return JANSSON_MICRO_VERSION - micro;
}