• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  *
15  * Description: CFBB version define. \n
16  *
17  */
18 
19 #ifndef CFBB_VERSION_H
20 #define CFBB_VERSION_H
21 
22 #ifdef __cplusplus
23 #if __cplusplus
24 extern "C" {
25 #endif
26 #endif
27 
28 
29 /* Major version number (X.y.z[.p]) */
30 #define CFBB_VER_MAJOR      0
31 
32 /* Minor version number (x.Y.z[.p]) */
33 #define CFBB_VER_MINOR      9
34 
35 /* Release version nubmer (x.y.Z[.p]) */
36 #define CFBB_VER_RELEASE    0
37 
38 /* Patch version number (x.y.z[.P]) */
39 #define CFBB_VER_PATCH      5
40 
41 
42 /**
43  * MACRO to convert CFBB version nubmer into an integer
44  * To be used in comparision, such as CFBB_VERION >= CFBB_VERSION_VALUE(1, 0, 0, 0)
45  */
46 #define CFBB_VERSION_VALUE(x, y, z, p)      (((x) << 24) | ((y) << 16) | ((z) << 8) | (p))
47 
48 /**
49  * Current CFBB version, as an integer
50  * To be used in comparision, such as CFBB_VERION >= CFBB_VERSION_VALUE(1, 0, 0, 0)
51  */
52 #define CFBB_VERSION    CFBB_VERSION_VALUE(CFBB_VER_MAJOR, CFBB_VER_MINOR, CFBB_VER_RELEASE, CFBB_VER_PATCH)
53 
54 /**
55  * Current CFBB version, as a string
56  */
57 #if CFBB_VER_PATCH == 0
58 #define MAKE_VERSION_STR_IMPL(x, y, z, p)   "CFBB "#x"."#y"."#z
59 #else
60 #define MAKE_VERSION_STR_IMPL(x, y, z, p)   "CFBB "#x"."#y"."#z"."#p
61 #endif
62 
63 #define MAKE_VERSION_STR(x, y, z, p)        MAKE_VERSION_STR_IMPL(x, y, z, p)
64 
65 #define CFBB_VERSION_STR    MAKE_VERSION_STR(CFBB_VER_MAJOR, CFBB_VER_MINOR, CFBB_VER_RELEASE, CFBB_VER_PATCH)
66 
67 /**
68  * @if Eng
69  * @brief   Current CFBB version, as a string.
70  * @retval  Version     CFBB version.
71  * @else
72  * @brief   CFBB版本号,字符串格式。
73  * @retval  Version     CFBB版本号.
74  * @endif
75  */
uapi_get_cfbb_version(void)76 static inline const char *uapi_get_cfbb_version(void)
77 {
78     return CFBB_VERSION_STR;
79 }
80 
81 
82 #ifdef __cplusplus
83 #if __cplusplus
84 }
85 #endif
86 #endif
87 
88 #endif /* CFBB_VERSION_H */
89