]> git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/include/spdk/version.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / spdk / include / spdk / version.h
1 /*-
2 * BSD LICENSE
3 *
4 * Copyright (c) Intel Corporation.
5 * All rights reserved.
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
34 /** \file
35 * SPDK version number definitions
36 */
37
38 #ifndef SPDK_VERSION_H
39 #define SPDK_VERSION_H
40
41 /**
42 * Major version number (year of original release minus 2000).
43 */
44 #define SPDK_VERSION_MAJOR 18
45
46 /**
47 * Minor version number (month of original release).
48 */
49 #define SPDK_VERSION_MINOR 10
50
51 /**
52 * Patch level.
53 *
54 * Patch level is incremented on maintenance branch releases and reset to 0 for each
55 * new major.minor release.
56 */
57 #define SPDK_VERSION_PATCH 0
58
59 /**
60 * Version string suffix.
61 */
62 #define SPDK_VERSION_SUFFIX "-pre"
63
64 /**
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)
71 * // Use feature from SPDK v17.07
72 * #endif
73 * \endcode
74 */
75 #define SPDK_VERSION_NUM(major, minor, patch) \
76 (((major) * 100 + (minor)) * 100 + (patch))
77
78 /**
79 * Current version as a SPDK_VERSION_NUM.
80 */
81 #define SPDK_VERSION SPDK_VERSION_NUM(SPDK_VERSION_MAJOR, SPDK_VERSION_MINOR, SPDK_VERSION_PATCH)
82
83 #define SPDK_VERSION_STRINGIFY_x(x) #x
84 #define SPDK_VERSION_STRINGIFY(x) SPDK_VERSION_STRINGIFY_x(x)
85
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
99
100 /**
101 * Human-readable version string.
102 */
103 #define SPDK_VERSION_STRING \
104 "SPDK v" \
105 SPDK_VERSION_MAJOR_STRING \
106 SPDK_VERSION_MINOR_STRING \
107 SPDK_VERSION_PATCH_STRING \
108 SPDK_VERSION_SUFFIX
109
110 #endif