From 47dec22c57adbb49d1bcfa3a45b3e270b2af223a Mon Sep 17 00:00:00 2001 From: Lizongdi <1210855344@qq.com> Date: Thu, 13 Aug 2026 10:05:06 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=B8=BB=E7=BA=BF=E5=BE=85=E5=90=88?= =?UTF-8?q?=E3=80=91=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E6=97=A5=E6=9C=9F=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/common/common.c | 7 +++++++ library/common/include/common.h | 1 + 2 files changed, 8 insertions(+) diff --git a/library/common/common.c b/library/common/common.c index 68e0e9a..03072eb 100644 --- a/library/common/common.c +++ b/library/common/common.c @@ -4,6 +4,8 @@ #include "common.h" #include // 必须包含此头文件以使用变参宏 +static char g_sBuildTime[64] = {0}; + WEAK void elog_output(uint8_t level, const char *tag, const char *file, const char *func, long line, const char *format, ...) { #ifdef BUILD_COMMON @@ -93,3 +95,8 @@ int Rd_RegularFileExists(const char *_psPath) return (stat(_psPath, &sb) == 0) && S_ISREG(sb.st_mode); } +char *Rd_GetBuildTime(void) +{ + snprintf(g_sBuildTime, sizeof(g_sBuildTime), "%s %s", __DATE__, __TIME__); + return g_sBuildTime; +} \ No newline at end of file diff --git a/library/common/include/common.h b/library/common/include/common.h index 607554b..ab36fbc 100644 --- a/library/common/include/common.h +++ b/library/common/include/common.h @@ -153,6 +153,7 @@ int Rd_String2Array(char *_pSrc, char *_pRes[], int _iNum, char *_Ptr); int Rd_Array2String(char *_pRes, int _iLen, char *_pSrc[], int _iNum, char *_Ptr); int Rd_FileExists(const char *_psPath); int Rd_RegularFileExists(const char *_psPath); +char *Rd_GetBuildTime(void); #ifdef BUILD_LOG extern void Rd_ElogEnableStrong(void);