streq(), wcseq(): New functions to compare strings for equality
Collin Funk
collin.funk1@gmail.com
Fri Aug 29 17:03:38 GMT 2025
Wilco Dijkstra <Wilco.Dijkstra@arm.com> writes:
> That's a lot of extra overhead, so most people would continue using
>
> #define streq(X,Y) strcmp(X,Y) == 0
>
> as that's simpler and faster.
I don't think it is too much of an issue to write this in projects if
they want them personally:
static inline bool
streq (char const *a, char const *b)
{
return ! strcmp (a, b);
}
static inline bool
strneq (char const *a, char const *b)
{
return !! strcmp (a, b);
}
Collin
More information about the Libc-alpha
mailing list