mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-19 02:53:02 +08:00
make this compile on macos
This commit is contained in:
parent
3b6d6b3465
commit
5b76f24f35
@ -25,23 +25,28 @@ namespace fs
|
|||||||
using stdfs::status;
|
using stdfs::status;
|
||||||
|
|
||||||
// we want to poison ADL with these niebloids
|
// we want to poison ADL with these niebloids
|
||||||
constexpr struct {
|
|
||||||
file_status operator()(const path& p, std::error_code& ec) const noexcept;
|
|
||||||
file_status operator()(const path& p) const noexcept;
|
|
||||||
} symlink_status{};
|
|
||||||
|
|
||||||
constexpr struct {
|
namespace detail {
|
||||||
inline bool operator()(file_status s) const {
|
struct symlink_status_t {
|
||||||
return stdfs::is_symlink(s);
|
file_status operator()(const path& p, std::error_code& ec) const noexcept;
|
||||||
}
|
file_status operator()(const path& p) const noexcept;
|
||||||
|
};
|
||||||
|
struct is_symlink_t {
|
||||||
|
inline bool operator()(file_status s) const {
|
||||||
|
return stdfs::is_symlink(s);
|
||||||
|
}
|
||||||
|
|
||||||
inline bool operator()(const path& p) const {
|
inline bool operator()(const path& p) const {
|
||||||
return stdfs::is_symlink(symlink_status(p));
|
return stdfs::is_symlink(symlink_status(p));
|
||||||
}
|
}
|
||||||
inline bool operator()(const path& p, std::error_code& ec) const {
|
inline bool operator()(const path& p, std::error_code& ec) const {
|
||||||
return stdfs::is_symlink(symlink_status(p, ec));
|
return stdfs::is_symlink(symlink_status(p, ec));
|
||||||
}
|
}
|
||||||
} is_symlink{};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr detail::symlink_status_t symlink_status{};
|
||||||
|
constexpr detail::is_symlink_t is_symlink{};
|
||||||
|
|
||||||
inline bool is_regular_file(file_status s) { return stdfs::is_regular_file(s); }
|
inline bool is_regular_file(file_status s) { return stdfs::is_regular_file(s); }
|
||||||
inline bool is_directory(file_status s) { return stdfs::is_directory(s); }
|
inline bool is_directory(file_status s) { return stdfs::is_directory(s); }
|
||||||
|
@ -190,7 +190,7 @@ namespace vcpkg::Strings
|
|||||||
// ignores padding, since one implicitly knows the length from the size of x
|
// ignores padding, since one implicitly knows the length from the size of x
|
||||||
template <class Integral>
|
template <class Integral>
|
||||||
std::string b64url_encode(Integral x) {
|
std::string b64url_encode(Integral x) {
|
||||||
static_assert(std::is_integral_v<Integral>);
|
static_assert(std::is_integral<Integral>::value, "b64url_encode must take an integer type");
|
||||||
auto value = static_cast<std::make_unsigned_t<Integral>>(x);
|
auto value = static_cast<std::make_unsigned_t<Integral>>(x);
|
||||||
|
|
||||||
// 64 values, plus the implicit \0
|
// 64 values, plus the implicit \0
|
||||||
|
@ -21,8 +21,8 @@
|
|||||||
#include <copyfile.h>
|
#include <copyfile.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace fs {
|
namespace fs::detail {
|
||||||
file_status decltype(symlink_status)::operator()(const path& p, std::error_code& ec) const noexcept {
|
file_status symlink_status_t::operator()(const path& p, std::error_code& ec) const noexcept {
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
/*
|
/*
|
||||||
do not find the permissions of the file -- it's unnecessary for the
|
do not find the permissions of the file -- it's unnecessary for the
|
||||||
@ -53,7 +53,7 @@ namespace fs {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
file_status decltype(symlink_status)::operator()(const path& p) const noexcept {
|
file_status symlink_status_t::operator()(const path& p) const noexcept {
|
||||||
std::error_code ec;
|
std::error_code ec;
|
||||||
auto result = symlink_status(p, ec);
|
auto result = symlink_status(p, ec);
|
||||||
if (ec) vcpkg::Checks::exit_with_message(VCPKG_LINE_INFO, "error getting status of path %s: %s", p.string(), ec.message());
|
if (ec) vcpkg::Checks::exit_with_message(VCPKG_LINE_INFO, "error getting status of path %s: %s", p.string(), ec.message());
|
||||||
|
Loading…
Reference in New Issue
Block a user