From cef57d006d6a1f46245c7829752498f8f7137ae8 Mon Sep 17 00:00:00 2001 From: wdfk-prog <1425075683@qq.com> Date: Thu, 24 Nov 2022 13:12:48 +0800 Subject: [PATCH] =?UTF-8?q?[armlibc]=20=E4=BF=AE=E5=A4=8DAC6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=87=B36.19=E5=90=8E=5Fsys=5Ftmpnam()=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E7=BC=96=E8=AF=91=E6=8A=A5=E9=94=99=20(#6647)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [armlibc] 修复AC6更新至6.19后_sys_tmpnam()函数编译报错 Co-authored-by: Man, Jianting (Meco) <920369182@qq.com> --- components/libc/compilers/armlibc/syscalls.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/libc/compilers/armlibc/syscalls.c b/components/libc/compilers/armlibc/syscalls.c index 26ba3796fa..74097da58f 100644 --- a/components/libc/compilers/armlibc/syscalls.c +++ b/components/libc/compilers/armlibc/syscalls.c @@ -282,11 +282,18 @@ int _sys_seek(FILEHANDLE fh, long pos) /** * used by tmpnam() or tmpfile() */ +#if __ARMCC_VERSION >= 6190000 +void _sys_tmpnam(char *name, int fileno, unsigned maxlength) +{ + rt_snprintf(name, maxlength, "tem%03d", fileno); +} +#else int _sys_tmpnam(char *name, int fileno, unsigned maxlength) { rt_snprintf(name, maxlength, "tem%03d", fileno); return 1; } +#endif /* __ARMCC_VERSION >= 6190000 */ char *_sys_command_string(char *cmd, int len) { -- GitLab