mirror of https://github.com/AxioDL/nod.git
Merge branch 'lioncash-null-term'
This commit is contained in:
commit
7da7761afb
|
@ -6,20 +6,16 @@ namespace nod {
|
|||
|
||||
struct CaseInsensitiveCompare {
|
||||
bool operator()(std::string_view lhs, std::string_view rhs) const {
|
||||
#if _WIN32
|
||||
if (_stricmp(lhs.data(), rhs.data()) < 0)
|
||||
#else
|
||||
if (strcasecmp(lhs.data(), rhs.data()) < 0)
|
||||
#endif
|
||||
return true;
|
||||
return false;
|
||||
return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end(), [](char lhs, char rhs) {
|
||||
return std::tolower(static_cast<unsigned char>(lhs)) < std::tolower(static_cast<unsigned char>(rhs));
|
||||
});
|
||||
}
|
||||
|
||||
#if _WIN32
|
||||
bool operator()(std::wstring_view lhs, std::wstring_view rhs) const {
|
||||
if (_wcsicmp(lhs.data(), rhs.data()) < 0)
|
||||
return true;
|
||||
return false;
|
||||
return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end(), [](wchar_t lhs, wchar_t rhs) {
|
||||
return std::towlower(lhs) < std::towlower(rhs);
|
||||
});
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#if _WIN32 && UNICODE
|
||||
#include <wctype.h>
|
||||
#include <cwctype>
|
||||
#include <direct.h>
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
|
@ -16,20 +16,19 @@
|
|||
#define WINDOWS_STORE 0
|
||||
#endif
|
||||
#else
|
||||
#include <ctype.h>
|
||||
#include <sys/file.h>
|
||||
#include <unistd.h>
|
||||
#include <cctype>
|
||||
#include <cerrno>
|
||||
#include <sys/file.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
#include "logvisor/logvisor.hpp"
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4996)
|
||||
|
|
Loading…
Reference in New Issue