]> pd.if.org Git - pdclib/blob - opt/mincoll/wcscoll.c
PDCLib includes with quotes, not <>.
[pdclib] / opt / mincoll / wcscoll.c
1 /* wcscoll( const wchar_t *, const wchar_t * )\r
2 \r
3    This file is part of the Public Domain C Library (PDCLib).\r
4    Permission is granted to use, modify, and / or redistribute at will.\r
5 */\r
6 \r
7 #include <wchar.h>\r
8 \r
9 #ifndef REGTEST\r
10 \r
11 /* I did much searching as to how various people implement this.\r
12  *\r
13  * OpenBSD, NetBSD and Musl libc for Linux implement this as a call to wcscmp\r
14  * and have various "todo" notices on this function, and on the other hand\r
15  * glibc implements it as a 500 line function. FreeBSD has an implementation \r
16  * which kind of uses their single byte character strcoll data for the first\r
17  * 256 characters, but looks incredibly fragile and likely to break.\r
18  *\r
19  * TL;DR: Nobody uses this, and this will probably work perfectly fine for you.\r
20  */\r
21 \r
22 int wcscoll( const wchar_t * s1, const wchar_t * s2 )\r
23 {\r
24     return wcscmp(s1, s2);\r
25 }\r
26 \r
27 #endif\r
28 \r
29 #ifdef TEST\r
30 #include "_PDCLIB_test.h"\r
31 \r
32 int main( void )\r
33 {\r
34     return TEST_RESULTS;\r
35 }\r
36 #endif\r