libc: Change index/rindex from macro to function

to avoid the confliction with the same name variable

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2020-08-05 04:39:03 -07:00
committed by David Sidrane
parent 2eccc960a9
commit 5c67eac27f
4 changed files with 80 additions and 2 deletions
+3 -2
View File
@@ -59,8 +59,6 @@
#define bcmp(b1,b2,len) memcmp(b1,b2,(size_t)len)
#define bcopy(b1,b2,len) (void)memmove(b2,b1,len)
#define bzero(s,n) (void)memset(s,0,n)
#define index(s,c) strchr(s,c)
#define rindex(s,c) strrchr(s,c)
/****************************************************************************
* Inline Functions
@@ -91,6 +89,9 @@ int flsl(long j);
int flsll(long long j);
#endif
FAR char *index(FAR const char *s, int c);
FAR char *rindex(FAR const char *s, int c);
int strcasecmp(FAR const char *, FAR const char *);
int strncasecmp(FAR const char *, FAR const char *, size_t);