diff options
| author | thewon86 <[email protected]> | 2022-07-04 09:43:08 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-07-04 09:43:08 +0800 |
| commit | 9359ab4fa82d43e30cb7c45d74cb186bdd002821 (patch) | |
| tree | bc098f7aef765433a5c2fe611314ff2fa3d60363 /include/rtdef.h | |
| parent | c8a73411f65f7107c4b5498b0ab10aaa840436c6 (diff) | |
add version check (#5850)
Diffstat (limited to 'include/rtdef.h')
| -rw-r--r-- | include/rtdef.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/rtdef.h b/include/rtdef.h index dd5dffc6c5..94c2466f0b 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -42,6 +42,7 @@ * 2022-01-07 Gabriel move some __on_rt_xxxxx_hook to dedicated c source files * 2022-01-12 Meco Man remove RT_THREAD_BLOCK * 2022-04-20 Meco Man change version number to v4.1.1 + * 2022-04-21 THEWON add macro RT_VERSION_CHECK * 2022-06-29 Meco Man add RT_USING_LIBC and standard libc headers */ @@ -71,8 +72,11 @@ extern "C" { #define RT_REVISION 1 /**< revise version number */ /* RT-Thread version */ -#define RTTHREAD_VERSION ((RT_VERSION * 10000) + \ - (RT_SUBVERSION * 100) + RT_REVISION) +#define RTTHREAD_VERSION RT_VERSION_CHECK(RT_VERSION, RT_SUBVERSION, RT_REVISION) + +/* e.g. #if (RTTHREAD_VERSION >= RT_VERSION_CHECK(4, 1, 0) */ +#define RT_VERSION_CHECK(major, minor, revise) ((major * 10000) + \ + (minor * 100) + revise) /* RT-Thread basic data type definitions */ #ifndef RT_USING_ARCH_DATA_TYPE |
