make this compile on macos

This commit is contained in:
Nicole Mazzuca 2019-07-10 16:28:56 -07:00
parent 3b6d6b3465
commit 5b76f24f35
3 changed files with 24 additions and 19 deletions

View File

@ -25,23 +25,28 @@ namespace fs
using stdfs::status;
// 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 {
inline bool operator()(file_status s) const {
return stdfs::is_symlink(s);
}
namespace detail {
struct symlink_status_t {
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 {
return stdfs::is_symlink(symlink_status(p));
}
inline bool operator()(const path& p, std::error_code& ec) const {
return stdfs::is_symlink(symlink_status(p, ec));
}
} is_symlink{};
inline bool operator()(const path& p) const {
return stdfs::is_symlink(symlink_status(p));
}
inline bool operator()(const path& p, std::error_code& ec) const {
return stdfs::is_symlink(symlink_status(p, ec));
}
};
}
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_directory(file_status s) { return stdfs::is_directory(s); }

View File

@ -190,7 +190,7 @@ namespace vcpkg::Strings
// ignores padding, since one implicitly knows the length from the size of x
template <class Integral>
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);
// 64 values, plus the implicit \0

View File

@ -21,8 +21,8 @@
#include <copyfile.h>
#endif
namespace fs {
file_status decltype(symlink_status)::operator()(const path& p, std::error_code& ec) const noexcept {
namespace fs::detail {
file_status symlink_status_t::operator()(const path& p, std::error_code& ec) const noexcept {
#if defined(_WIN32)
/*
do not find the permissions of the file -- it's unnecessary for the
@ -53,7 +53,7 @@ namespace fs {
#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;
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());