From 7c273195215637a6754d0021ccff1b095eff9b3d Mon Sep 17 00:00:00 2001 From: rcitachi Date: Sat, 2 Nov 2024 06:44:16 +0800 Subject: [PATCH] [libc] modify function names to resolve naming conflicts --- components/libc/compilers/common/ctime.c | 10 +++++----- components/libc/compilers/musl/fcntl.h | 25 +++++++++++++++++++----- components/lwp/lwp_syscall.h | 1 - 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/components/libc/compilers/common/ctime.c b/components/libc/compilers/common/ctime.c index 7ea5975b41..7c236f3da8 100644 --- a/components/libc/compilers/common/ctime.c +++ b/components/libc/compilers/common/ctime.c @@ -801,7 +801,7 @@ RTM_EXPORT(rt_timespec_to_tick); struct timer_obj { struct rt_ktime_hrtimer hrtimer; - void (*sigev_notify_function)(union sigval val); + void (*sigev_notify_func)(union sigval val); union sigval val; struct timespec interval; /* Reload value */ struct timespec value; /* Reload value */ @@ -903,7 +903,7 @@ static void rtthread_timer_wrapper(void *timerobj) } #ifdef RT_USING_SMART /* this field is named as tid in musl */ - void *ptid = &timer->sigev_notify_function; + void *ptid = &timer->sigev_notify_func; int tid = *(int *)ptid; struct lwp_timer_event_param *data = rt_container_of(timer->work, struct lwp_timer_event_param, work); data->signo = timer->sigev_signo; @@ -922,9 +922,9 @@ static void rtthread_timer_wrapper(void *timerobj) if (rt_work_submit(timer->work, 0)) RT_ASSERT(0); #else - if(timer->sigev_notify_function != RT_NULL) + if(timer->sigev_notify_func != RT_NULL) { - (timer->sigev_notify_function)(timer->val); + (timer->sigev_notify_func)(timer->val); } #endif /* RT_USING_SMART */ } @@ -1012,7 +1012,7 @@ int timer_create(clockid_t clockid, struct sigevent *evp, timer_t *timerid) timer->work = work; #endif /* RT_USING_SMART */ - timer->sigev_notify_function = evp->sigev_notify_function; + timer->sigev_notify_func = evp->sigev_notify_function; timer->val = evp->sigev_value; timer->interval.tv_sec = 0; timer->interval.tv_nsec = 0; diff --git a/components/libc/compilers/musl/fcntl.h b/components/libc/compilers/musl/fcntl.h index 9388f10de1..51387f7beb 100644 --- a/components/libc/compilers/musl/fcntl.h +++ b/components/libc/compilers/musl/fcntl.h @@ -22,18 +22,33 @@ #define O_DSYNC 010000 #define O_SYNC 04010000 #define O_RSYNC 04010000 -#define O_DIRECTORY 040000 -#define O_NOFOLLOW 0100000 #define O_CLOEXEC 02000000 #define O_ASYNC 020000 -#define O_DIRECT 0200000 -#define O_LARGEFILE 0400000 #define O_NOATIME 01000000 #define O_PATH 010000000 -#define O_TMPFILE 020040000 #define O_NDELAY O_NONBLOCK +#ifndef O_LARGEFILE +#define O_LARGEFILE 0400000 +#endif + +#ifndef O_DIRECT +#define O_DIRECT 0200000 +#endif + +#ifndef O_TMPFILE +#define O_TMPFILE 020040000 +#endif + +#ifndef O_NOFOLLOW +#define O_NOFOLLOW 0100000 +#endif + +#ifndef O_DIRECTORY +#define O_DIRECTORY 040000 +#endif + #ifndef O_BINARY #define O_BINARY 00 #endif diff --git a/components/lwp/lwp_syscall.h b/components/lwp/lwp_syscall.h index 1527a764f1..45c95262f1 100644 --- a/components/lwp/lwp_syscall.h +++ b/components/lwp/lwp_syscall.h @@ -32,7 +32,6 @@ extern "C" { #endif -typedef long suseconds_t; /* microseconds (signed) */ typedef uint32_t id_t; /* may contain pid, uid or gid */ /*