1 /* This source code was extracted from the Q8 package created and placed
2 in the PUBLIC DOMAIN by Doug Gwyn <gwyn@arl.mil>
3 last edit: 1999/11/05 gwyn@arl.mil
5 Implements subclause 7.24 of ISO/IEC 9899:1999 (E).
7 It supports an encoding where all char codes are mapped
8 to the *same* code values within a wchar_t or wint_t,
9 so long as no other wchar_t codes are used by the program.
17 register const wchar_t *s1;
18 register const wchar_t *s2;
21 if ( n == 0 || s1 == s2 )
22 return 0; /* even for NULL pointers */
24 if ( (s1 != NULL) != (s2 != NULL) )
25 return s2 == NULL ? 1 : -1; /* robust */
27 for ( ; n > 0; ++s1, ++s2, --n )