diff --git a/bsp/nuvoton/libraries/nu_packages/Demo/slcd_show_tick.c b/bsp/nuvoton/libraries/nu_packages/Demo/slcd_show_tick.c index 5b1141134d..f5ae9c4fde 100644 --- a/bsp/nuvoton/libraries/nu_packages/Demo/slcd_show_tick.c +++ b/bsp/nuvoton/libraries/nu_packages/Demo/slcd_show_tick.c @@ -118,7 +118,7 @@ void slcd_demo_hook(void) /* Show RTT version. */ { LCDLIB_SetSymbol(SYMBOL_VERSION, 1); - rt_snprintf(au8Str, sizeof(au8Str), "%d%02d%03d", RT_VERSION, RT_SUBVERSION, RT_REVISION); + rt_snprintf(au8Str, sizeof(au8Str), "%d%02d%03d", RT_VERSION_MAJOR, RT_VERSION_MINOR, RT_VERSION_PATCH); LCDLIB_Printf(ZONE_VER_DIGIT, &au8Str[0]); LCDLIB_SetSymbol(SYMBOL_VER_DIG_P1, 1); LCDLIB_SetSymbol(SYMBOL_VER_DIG_P2, 1); diff --git a/bsp/simulator/drivers/SConscript b/bsp/simulator/drivers/SConscript index d43216fa34..101b630ae1 100644 --- a/bsp/simulator/drivers/SConscript +++ b/bsp/simulator/drivers/SConscript @@ -21,8 +21,6 @@ if rtconfig.CROSS_TOOL == 'msvc': '_CRT_NO_TIME_T', # disable deprecation of unsafe functions, such as strncpy '_CRT_SECURE_NO_WARNINGS', - # RT_VESRION conflicts in winuser.h - 'NORESOURCE', # lean and mean for Windows.h, exclude winsock.h when include Windows.h # avoid conlicts between sys/select.h, time.h, and winsock.h # such as fd_set related, struct timeval... diff --git a/components/legacy/rtlegacy.h b/components/legacy/rtlegacy.h index df8463cdd2..19b7f38209 100644 --- a/components/legacy/rtlegacy.h +++ b/components/legacy/rtlegacy.h @@ -12,10 +12,12 @@ #define __RT_LEGACY_H__ #include +#include -/* rtlibc */ -#include -#include +/* legacy version macros */ +#define RT_VERSION RT_VERSION_MAJOR /**< major version number */ +#define RT_SUBVERSION RT_VERSION_MINOR /**< minor version number */ +#define RT_REVISION RT_VERSION_PATCH /**< revise version number */ /* IPC */ #ifdef RT_USING_DEVICE_IPC diff --git a/components/net/sal/src/sal_socket.c b/components/net/sal/src/sal_socket.c index 3256b9f4d6..e3dafd0cc8 100644 --- a/components/net/sal/src/sal_socket.c +++ b/components/net/sal/src/sal_socket.c @@ -238,9 +238,9 @@ static void check_netdev_internet_up_work(struct rt_work *work, void *work_data) { send_data[index + 1] = netdev->hwaddr[index] + moth_num; } - send_data[9] = RT_VERSION; - send_data[10] = RT_SUBVERSION; - send_data[11] = RT_REVISION; + send_data[9] = RT_VERSION_MAJOR; + send_data[10] = RT_VERSION_MINOR; + send_data[11] = RT_VERSION_PATCH; skt_ops->sendto(sockfd, send_data, SAL_INTERNET_BUFF_LEN, 0, (struct sockaddr *)&server_addr, sizeof(struct sockaddr)); diff --git a/include/rtdef.h b/include/rtdef.h index f04c3300b6..d69ec99297 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -68,15 +68,15 @@ extern "C" { /**@{*/ /* RT-Thread version information */ -#define RT_VERSION 5 /**< major version number */ -#define RT_SUBVERSION 0 /**< minor version number */ -#define RT_REVISION 0 /**< revise version number */ +#define RT_VERSION_MAJOR 5 /**< Major version number (X.x.x) */ +#define RT_VERSION_MINOR 0 /**< Minor version number (x.X.x) */ +#define RT_VERSION_PATCH 0 /**< Patch version number (x.x.X) */ /* 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 version */ -#define RTTHREAD_VERSION RT_VERSION_CHECK(RT_VERSION, RT_SUBVERSION, RT_REVISION) +#define RTTHREAD_VERSION RT_VERSION_CHECK(RT_VERSION_MAJOR, RT_VERSION_MINOR, RT_VERSION_PATCH) /* RT-Thread basic data type definitions */ diff --git a/src/kservice.c b/src/kservice.c index 6a8336b2db..2fd38d330e 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -640,7 +640,7 @@ void rt_show_version(void) rt_kprintf("\n \\ | /\n"); rt_kprintf("- RT - Thread Operating System\n"); rt_kprintf(" / | \\ %d.%d.%d build %s %s\n", - (rt_int32_t)RT_VERSION, (rt_int32_t)RT_SUBVERSION, (rt_int32_t)RT_REVISION, __DATE__, __TIME__); + (rt_int32_t)RT_VERSION_MAJOR, (rt_int32_t)RT_VERSION_MINOR, (rt_int32_t)RT_VERSION_PATCH, __DATE__, __TIME__); rt_kprintf(" 2006 - 2022 Copyright by RT-Thread team\n"); } RTM_EXPORT(rt_show_version); diff --git a/tools/building.py b/tools/building.py index d518441151..d9fecd1567 100644 --- a/tools/building.py +++ b/tools/building.py @@ -968,11 +968,11 @@ def GetVersion(): prepcessor.process_contents(contents) def_ns = prepcessor.cpp_namespace - version = int([ch for ch in def_ns['RT_VERSION'] if ch in '0123456789.']) - subversion = int([ch for ch in def_ns['RT_SUBVERSION'] if ch in '0123456789.']) + version = int([ch for ch in def_ns['RT_VERSION_MAJOR'] if ch in '0123456789.']) + subversion = int([ch for ch in def_ns['RT_VERSION_MINOR'] if ch in '0123456789.']) - if 'RT_REVISION' in def_ns: - revision = int([ch for ch in def_ns['RT_REVISION'] if ch in '0123456789.']) + if 'RT_VERSION_PATCH' in def_ns: + revision = int([ch for ch in def_ns['RT_VERSION_PATCH'] if ch in '0123456789.']) return '%d.%d.%d' % (version, subversion, revision) return '0.%d.%d' % (version, subversion)