Skip to content

Commit 6e52631

Browse files
authored
Merge pull request #576 from JohnSanpe/feat-port
feat port: added strcmp function port
2 parents c0376b6 + b008c42 commit 6e52631

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

include/bfdev/port/string.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ bfport_memset(void *s, int c, size_t n)
3434
}
3535
#endif
3636

37+
#ifndef bfport_strcmp
38+
# define bfport_strcmp bfport_strcmp
39+
static __bfdev_always_inline int
40+
bfport_strcmp(const char *s1, const char *s2)
41+
{
42+
return strcmp(s1, s2);
43+
}
44+
#endif
45+
3746
#ifndef bfport_strchr
3847
# define bfport_strchr bfport_strchr
3948
static __bfdev_always_inline char *

src/cache/cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ cache_algorithm_find(const char *name)
1717
bfdev_cache_algo_t *algo;
1818

1919
bfdev_list_for_each_entry(algo, &cache_algorithms, list) {
20-
if (!strcmp(algo->name, name))
20+
if (!bfport_strcmp(algo->name, name))
2121
return algo;
2222
}
2323

src/textsearch/textsearch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ textsearch_algorithm_find(const char *name)
1515
bfdev_ts_algorithm_t *algo;
1616

1717
bfdev_list_for_each_entry(algo, &textsearch_algorithms, list) {
18-
if (!strcmp(algo->name, name))
18+
if (!bfport_strcmp(algo->name, name))
1919
return algo;
2020
}
2121

0 commit comments

Comments
 (0)