From 6dce8a3a8c4a8aa72d6be995bb496bfc172f96f8 Mon Sep 17 00:00:00 2001 From: Steffen Schuemann Date: Tue, 14 May 2019 06:09:48 +0200 Subject: [PATCH] Work on CI support for MingW --- .appveyor.yml | 2 +- .clang-format | 2 +- include/ghc/filesystem.hpp | 15 +++++++-------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index a7d8ed1..d403f37 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -54,7 +54,7 @@ build_script: - cd build - if [%compiler%]==[msvc] cmake -G"%generator%" .. - if [%compiler%]==[mingw] set PATH=%toolchain%/bin;%PATH% - - if [%compiler%]==[mingw] cmake -G"%generator%" -DCMAKE_SH=CMAKE_SH-NOTFOUND -DCMAKE_PREFIX_PATH=C:\mingw-w64\%toolchain% -DCMAKE_BUILD_TYPE=%configuration% .. + - if [%compiler%]==[mingw] cmake -G"%generator%" -DCMAKE_SH=CMAKE_SH-NOTFOUND -DCMAKE_PREFIX_PATH=%toolchain% -DCMAKE_BUILD_TYPE=%configuration% .. - cmake --build . --config %configuration% test_script: diff --git a/.clang-format b/.clang-format index c1c70f1..b24fe34 100644 --- a/.clang-format +++ b/.clang-format @@ -21,5 +21,5 @@ BraceWrapping: SplitEmptyNamespace: true BreakConstructorInitializers: BeforeComma ConstructorInitializerAllOnOneLineOrOnePerLine: false - +IndentPPDirectives: None ... diff --git a/include/ghc/filesystem.hpp b/include/ghc/filesystem.hpp index 3d8582f..f96731a 100644 --- a/include/ghc/filesystem.hpp +++ b/include/ghc/filesystem.hpp @@ -1057,7 +1057,7 @@ GHC_INLINE std::error_code make_error_code(portable_error err) return std::error_code(ERROR_INVALID_PARAMETER, std::system_category()); case portable_error::is_a_directory: #ifdef ERROR_DIRECTORY_NOT_SUPPORTED - return std::error_code(ERROR_DIRECTORY_NOT_SUPPORTED, std::system_category()); + return std::error_code(ERROR_DIRECTORY_NOT_SUPPORTED, std::system_category()); #else return std::error_code(ERROR_NOT_SUPPORTED, std::system_category()); #endif @@ -1388,15 +1388,15 @@ namespace detail { GHC_INLINE bool equals_simple_insensitive(const char* str1, const char* str2) { #ifdef GHC_OS_WINDOWS -# ifdef __GNUC__ +#ifdef __GNUC__ while (::tolower((unsigned char)*str1) == ::tolower((unsigned char)*str2++)) { if (*str1++ == 0) return true; } return false; -# else +#else return 0 == ::_stricmp(str1, str2); -# endif +#endif #else return 0 == ::strcasecmp(str1, str2); #endif @@ -1823,7 +1823,6 @@ GHC_INLINE u8arguments::u8arguments(int& argc, char**& argv) #endif } - //----------------------------------------------------------------------------- // 30.10.8.4.1 constructors and destructor @@ -3773,7 +3772,7 @@ GHC_INLINE void permissions(const path& p, perms prms, perm_options opts, std::e } } #ifdef GHC_OS_WINDOWS -# ifdef __GNUC__ +#ifdef __GNUC__ auto oldAttr = GetFileAttributesW(p.wstring().c_str()); if (oldAttr != INVALID_FILE_ATTRIBUTES) { DWORD newAttr = ((prms & perms::owner_write) == perms::owner_write) ? oldAttr & ~FILE_ATTRIBUTE_READONLY : oldAttr | FILE_ATTRIBUTE_READONLY; @@ -3782,7 +3781,7 @@ GHC_INLINE void permissions(const path& p, perms prms, perm_options opts, std::e } } ec = std::error_code(::GetLastError(), std::system_category()); -# else +#else int mode = 0; if ((prms & perms::owner_read) == perms::owner_read) { mode |= _S_IREAD; @@ -3793,7 +3792,7 @@ GHC_INLINE void permissions(const path& p, perms prms, perm_options opts, std::e if (::_wchmod(p.wstring().c_str(), mode) != 0) { ec = std::error_code(::GetLastError(), std::system_category()); } -# endif +#endif #else if ((opts & perm_options::nofollow) != perm_options::nofollow) { if (::chmod(p.c_str(), static_cast(prms)) != 0) {