1/*
2** Copyright 2011, Oliver Tappe, zooey@hirschkaefer.de. All rights reserved.
3** Distributed under the terms of the Haiku License.
4*/
5
6#include <errno_private.h>
7#include <LocaleBackend.h>
8#include <wchar_private.h>
9
10
11using BPrivate::Libroot::gLocaleBackend;
12
13
14extern "C" int
15__wcscoll(const wchar_t* wcs1, const wchar_t* wcs2)
16{
17	if (gLocaleBackend != NULL) {
18		int result = 0;
19		status_t status = gLocaleBackend->Wcscoll(wcs1, wcs2, result);
20
21		if (status != B_OK)
22			__set_errno(EINVAL);
23
24		return result;
25	}
26
27	return wcscmp(wcs1, wcs2);
28}
29
30
31extern "C"
32B_DEFINE_WEAK_ALIAS(__wcscoll, wcscoll);
33