From 7aa109ced80ae1016beeed1e4380fb13a27f3791 Mon Sep 17 00:00:00 2001 From: Stoneman <769442772@qq.com> Date: Tue, 30 Jul 2024 23:21:54 +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=EF=BC=8C=20?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E4=BB=8E=E4=B8=BB=E5=88=86=E6=94=AF=E7=9A=84?= =?UTF-8?q?=20commit=20#cef57d0=20rebase=E8=BF=87=E6=9D=A5=E3=80=82=20(#92?= =?UTF-8?q?65)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [armlibc] 修复AC6更新至6.19后_sys_tmpnam()函数编译报错 (#6647) * [armlibc] 修复AC6更新至6.19后_sys_tmpnam()函数编译报错 Co-authored-by: wdfk-prog <1425075683@qq.com> 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) {