diff options
| author | Nicole Mazzuca <t-nimaz@microsoft.com> | 2019-07-10 16:28:56 -0700 |
|---|---|---|
| committer | Nicole Mazzuca <t-nimaz@microsoft.com> | 2019-07-11 18:20:36 -0700 |
| commit | 5b76f24f35976739991941d3b6289fb78fd93648 (patch) | |
| tree | 75aadd834e434064464322404990a0a8e4c79528 /toolsrc/include | |
| parent | 3b6d6b3465e0e79999e5995f0104a6e8c021088c (diff) | |
| download | vcpkg-5b76f24f35976739991941d3b6289fb78fd93648.tar.gz vcpkg-5b76f24f35976739991941d3b6289fb78fd93648.zip | |
make this compile on macos
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg/base/files.h | 39 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/base/strings.h | 2 |
2 files changed, 23 insertions, 18 deletions
diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h index 178fae541..33f464779 100644 --- a/toolsrc/include/vcpkg/base/files.h +++ b/toolsrc/include/vcpkg/base/files.h @@ -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); - } - - 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{}; + + 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)); + } + }; + } + + 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); } diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index 423ea2096..82145b826 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -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 |
