]> git.proxmox.com Git - ceph.git/blame - ceph/src/spdk/include/spdk/version.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / include / spdk / version.h
CommitLineData
7c673cae
FG
1/*-
2 * BSD LICENSE
3 *
f67539c2
TL
4 * Copyright (c) Intel Corporation. All rights reserved.
5 * Copyright (c) 2019 Mellanox Technologies LTD. All rights reserved.
7c673cae
FG
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 * * Neither the name of Intel Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
11fdf7f2
TL
34/** \file
35 * SPDK version number definitions
7c673cae
FG
36 */
37
11fdf7f2
TL
38#ifndef SPDK_VERSION_H
39#define SPDK_VERSION_H
7c673cae
FG
40
41/**
11fdf7f2 42 * Major version number (year of original release minus 2000).
7c673cae 43 */
f67539c2 44#define SPDK_VERSION_MAJOR 20
7c673cae
FG
45
46/**
11fdf7f2 47 * Minor version number (month of original release).
7c673cae 48 */
9f95a23c 49#define SPDK_VERSION_MINOR 7
7c673cae
FG
50
51/**
11fdf7f2
TL
52 * Patch level.
53 *
54 * Patch level is incremented on maintenance branch releases and reset to 0 for each
55 * new major.minor release.
7c673cae 56 */
11fdf7f2 57#define SPDK_VERSION_PATCH 0
7c673cae
FG
58
59/**
11fdf7f2 60 * Version string suffix.
7c673cae 61 */
f67539c2 62#define SPDK_VERSION_SUFFIX ""
7c673cae
FG
63
64/**
11fdf7f2
TL
65 * Single numeric value representing a version number for compile-time comparisons.
66 *
67 * Example usage:
68 *
69 * \code
70 * #if SPDK_VERSION >= SPDK_VERSION_NUM(17, 7, 0)
9f95a23c 71 * Use feature from SPDK v17.07
11fdf7f2
TL
72 * #endif
73 * \endcode
7c673cae 74 */
11fdf7f2
TL
75#define SPDK_VERSION_NUM(major, minor, patch) \
76 (((major) * 100 + (minor)) * 100 + (patch))
7c673cae
FG
77
78/**
11fdf7f2 79 * Current version as a SPDK_VERSION_NUM.
7c673cae 80 */
11fdf7f2 81#define SPDK_VERSION SPDK_VERSION_NUM(SPDK_VERSION_MAJOR, SPDK_VERSION_MINOR, SPDK_VERSION_PATCH)
7c673cae 82
11fdf7f2
TL
83#define SPDK_VERSION_STRINGIFY_x(x) #x
84#define SPDK_VERSION_STRINGIFY(x) SPDK_VERSION_STRINGIFY_x(x)
7c673cae 85
11fdf7f2
TL
86#define SPDK_VERSION_MAJOR_STRING SPDK_VERSION_STRINGIFY(SPDK_VERSION_MAJOR)
87
88#if SPDK_VERSION_MINOR < 10
89#define SPDK_VERSION_MINOR_STRING ".0" SPDK_VERSION_STRINGIFY(SPDK_VERSION_MINOR)
90#else
91#define SPDK_VERSION_MINOR_STRING "." SPDK_VERSION_STRINGIFY(SPDK_VERSION_MINOR)
92#endif
93
94#if SPDK_VERSION_PATCH != 0
95#define SPDK_VERSION_PATCH_STRING "." SPDK_VERSION_STRINGIFY(SPDK_VERSION_PATCH)
96#else
97#define SPDK_VERSION_PATCH_STRING ""
98#endif
7c673cae 99
f67539c2
TL
100#ifdef SPDK_GIT_COMMIT
101#define SPDK_GIT_COMMIT_STRING SPDK_VERSION_STRINGIFY(SPDK_GIT_COMMIT)
102#define SPDK_GIT_COMMIT_STRING_SHA1 " git sha1 " SPDK_GIT_COMMIT_STRING
103#else
104#define SPDK_GIT_COMMIT_STRING ""
105#define SPDK_GIT_COMMIT_STRING_SHA1 ""
106#endif
107
7c673cae 108/**
11fdf7f2 109 * Human-readable version string.
7c673cae 110 */
11fdf7f2
TL
111#define SPDK_VERSION_STRING \
112 "SPDK v" \
113 SPDK_VERSION_MAJOR_STRING \
114 SPDK_VERSION_MINOR_STRING \
115 SPDK_VERSION_PATCH_STRING \
f67539c2
TL
116 SPDK_VERSION_SUFFIX \
117 SPDK_GIT_COMMIT_STRING_SHA1
7c673cae 118
7c673cae 119#endif