cosmopolitan/libc/nexgen32e/hascharacter.internal.h
Justine Tunney fa20edc44d
Reduce header complexity
- Remove most __ASSEMBLER__ __LINKER__ ifdefs
- Rename libc/intrin/bits.h to libc/serialize.h
- Block pthread cancelation in fchmodat() polyfill
- Remove `clang-format off` statements in third_party
2023-11-28 14:39:42 -08:00

35 lines
677 B
C

#ifndef COSMOPOLITAN_LIBC_NEXGEN32E_HASCHARACTER_H_
#define COSMOPOLITAN_LIBC_NEXGEN32E_HASCHARACTER_H_
forceinline bool HasCharacter(char c, const char *s) {
unsigned i;
for (i = 0; s[i]; ++i) {
if (s[i] == c) {
return true;
}
}
return false;
}
forceinline bool HasCharacter16(char16_t c, const char16_t *s) {
unsigned i;
for (i = 0; s[i]; ++i) {
if (s[i] == c) {
return true;
}
}
return false;
}
forceinline bool HasCharacterWide(wchar_t c, const wchar_t *s) {
unsigned i;
for (i = 0; s[i]; ++i) {
if (s[i] == c) {
return true;
}
}
return false;
}
#endif /* COSMOPOLITAN_LIBC_NEXGEN32E_HASCHARACTER_H_ */