1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#include <wchar.h> #include "nonstd/assert.h" int wcscmp(const wchar_t * s1, const wchar_t * s2) { ASSERT_NONNULL(s1); ASSERT_NONNULL(s2); while (*s1 == *s2 && *s1 != L'\0') { s1++; s2++; } if (*s1 > *s2) { return 1; } else if (*s1 < *s2) { return -1; } return 0; } /* STDC(199409) */