summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStoneman <[email protected]>2024-07-30 23:21:54 +0800
committerGitHub <[email protected]>2024-07-30 23:21:54 +0800
commit7aa109ced80ae1016beeed1e4380fb13a27f3791 (patch)
treefdc7c0eb29e82731d19ddede625ef7e87fdb6638
parent9376074b155bb57ddebe3c63aac9ce4db21c0612 (diff)
[armlibc] 修复AC6更新至6.19后_sys_tmpnam()函数编译报错, 直接从主分支的 commit #cef57d0 rebase过来。 (#9265)lts-v4.1.x
[armlibc] 修复AC6更新至6.19后_sys_tmpnam()函数编译报错 (#6647) * [armlibc] 修复AC6更新至6.19后_sys_tmpnam()函数编译报错 Co-authored-by: wdfk-prog <[email protected]> Co-authored-by: Man, Jianting (Meco) <[email protected]>
-rw-r--r--components/libc/compilers/armlibc/syscalls.c7
1 files changed, 7 insertions, 0 deletions
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)
{