12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #include <string.h>
- #ifdef _TLIBC_USE_INTEL_FAST_STRING_
- extern int _intel_fast_strcmp(const char *, const char *);
- #endif
- int
- strcmp(const char *s1, const char *s2)
- {
- #ifdef _TLIBC_USE_INTEL_FAST_STRING_
- return _intel_fast_strcmp(s1, s2);
- #else
- while (*s1 == *s2++)
- if (*s1++ == 0)
- return (0);
- return (*(const unsigned char *)s1 - *(const unsigned char *)--s2);
- #endif
- }
|