X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=opt%2Fmincoll%2Fwcscoll.c;h=9c7c2a60352cfa971dbf8e6b4b324efae805a173;hp=2e79081df14cc7cb6db52cdf464672c4067e5880;hb=abc15df6b9fae3374d24c7cf5c3ab94c605b2a6d;hpb=8894c921674bb116d0a7b8f23a55311e7a768019 diff --git a/opt/mincoll/wcscoll.c b/opt/mincoll/wcscoll.c index 2e79081..9c7c2a6 100644 --- a/opt/mincoll/wcscoll.c +++ b/opt/mincoll/wcscoll.c @@ -1,36 +1,36 @@ -/* wcscoll( const wchar_t *, const wchar_t * ) - - This file is part of the Public Domain C Library (PDCLib). - Permission is granted to use, modify, and / or redistribute at will. -*/ - -#include - -#ifndef REGTEST - -/* I did much searching as to how various people implement this. - * - * OpenBSD, NetBSD and Musl libc for Linux implement this as a call to wcscmp - * and have various "todo" notices on this function, and on the other hand - * glibc implements it as a 500 line function. FreeBSD has an implementation - * which kind of uses their single byte character strcoll data for the first - * 256 characters, but looks incredibly fragile and likely to break. - * - * TL;DR: Nobody uses this, and this will probably work perfectly fine for you. - */ - -int wcscoll( const wchar_t * s1, const wchar_t * s2 ) -{ - return wcscmp(s1, s2); -} - -#endif - -#ifdef TEST -#include "_PDCLIB_test.h" - -int main( void ) -{ - return TEST_RESULTS; -} -#endif +/* wcscoll( const wchar_t *, const wchar_t * ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#include + +#ifndef REGTEST + +/* I did much searching as to how various people implement this. + * + * OpenBSD, NetBSD and Musl libc for Linux implement this as a call to wcscmp + * and have various "todo" notices on this function, and on the other hand + * glibc implements it as a 500 line function. FreeBSD has an implementation + * which kind of uses their single byte character strcoll data for the first + * 256 characters, but looks incredibly fragile and likely to break. + * + * TL;DR: Nobody uses this, and this will probably work perfectly fine for you. + */ + +int wcscoll( const wchar_t * s1, const wchar_t * s2 ) +{ + return wcscmp(s1, s2); +} + +#endif + +#ifdef TEST +#include "_PDCLIB_test.h" + +int main( void ) +{ + return TEST_RESULTS; +} +#endif