Path: blob/main/system/lib/llvm-libc/src/string/strcoll.cpp
6175 views
//===-- Implementation of strcoll -----------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "src/string/strcoll.h"910#include "src/__support/common.h"11#include "src/__support/macros/config.h"12#include "src/__support/macros/null_check.h"1314namespace LIBC_NAMESPACE_DECL {1516// TODO: Add support for locales.17LLVM_LIBC_FUNCTION(int, strcoll, (const char *left, const char *right)) {18LIBC_CRASH_ON_NULLPTR(left);19LIBC_CRASH_ON_NULLPTR(right);20for (; *left && *left == *right; ++left, ++right)21;22return static_cast<int>(*left) - static_cast<int>(*right);23}2425} // namespace LIBC_NAMESPACE_DECL262728