diff --git a/.ci/unix-build.sh b/.ci/unix-build.sh new file mode 100755 index 0000000..914befa --- /dev/null +++ b/.ci/unix-build.sh @@ -0,0 +1,4 @@ +#!/bin/sh +mkdir build && cd build +cmake -DCMAKE_BUILD_TYPE=Release .. +cmake --build . diff --git a/.ci/unix-test.sh b/.ci/unix-test.sh new file mode 100755 index 0000000..3d6c865 --- /dev/null +++ b/.ci/unix-test.sh @@ -0,0 +1,6 @@ +#!/bin/sh +cd build +ctest -E Windows +if [ -f "test/std_filesystem_test" ]; then + test/std_filesystem_test || true +fi diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 0000000..6e4cd62 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,13 @@ +freebsd_instance: + image_family: freebsd-12-1 + +task: + install_script: | + pkg install -y cmake + pw groupadd testgrp + pw useradd testuser -g testgrp -w none -m + chown -R testuser:testgrp . + build_script: | + sudo -u testuser .ci/unix-build.sh + test_script: | + sudo -u testuser .ci/unix-test.sh diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..da967a4 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,43 @@ +kind: pipeline +name: arm + +platform: + os: linux + arch: arm + +steps: +- name: build + image: alpine + failure: ignore + commands: + - apk update + - apk add --no-cache build-base cmake sudo + - addgroup testgrp + - adduser --disabled-password testuser testgrp + - passwd testuser -u -d + - chown -R testuser:testgrp . + - sudo -u testuser .ci/unix-build.sh + - sudo -u testuser .ci/unix-test.sh + +--- + +kind: pipeline +name: arm64 + +platform: + os: linux + arch: arm64 + +steps: +- name: build + image: alpine + failure: ignore + commands: + - apk update + - apk add --no-cache build-base cmake + - addgroup testgrp + - adduser --disabled-password testuser testgrp + - passwd testuser -u -d + - chown -R testuser:testgrp . + - su -c "./.ci/unix-build.sh" testuser + - su -c "./.ci/unix-test.sh" testuser diff --git a/include/ghc/filesystem.hpp b/include/ghc/filesystem.hpp index a8cfb30..244647a 100644 --- a/include/ghc/filesystem.hpp +++ b/include/ghc/filesystem.hpp @@ -2951,7 +2951,8 @@ template inline std::basic_istream& operator>>(std::basic_istream& is, path& p) { std::basic_string tmp; - auto c = is.get(); + charT c; + is >> c; if (c == '"') { auto sf = is.flags(); is >> std::noskipws; @@ -3961,8 +3962,8 @@ GHC_INLINE void last_write_time(const path& p, file_time_type new_time, std::err struct ::timespec times[2]; times[0].tv_sec = 0; times[0].tv_nsec = UTIME_OMIT; - times[1].tv_sec = std::chrono::duration_cast(d).count(); - times[1].tv_nsec = std::chrono::duration_cast(d).count() % 1000000000; + times[1].tv_sec = static_cast(std::chrono::duration_cast(d).count()); + times[1].tv_nsec = static_cast(std::chrono::duration_cast(d).count() % 1000000000); if (::utimensat(AT_FDCWD, p.c_str(), times, AT_SYMLINK_NOFOLLOW) != 0) { ec = detail::make_system_error(); }