try fix mingw i686

This commit is contained in:
ado 2021-02-23 20:39:03 +01:00
parent 3b87136d37
commit 4939904f44
2 changed files with 6 additions and 5 deletions

View File

@ -50,7 +50,7 @@ jobs:
install: ${{ matrix.install }} install: ${{ matrix.install }}
- name: Install dependencies - name: Install dependencies
run: script/ci_install_deps.sh && clang++ -dM -E - < /dev/null run: script/ci_install_deps.sh
- name: Configure - name: Configure
run: cmake -DCMAKE_CXX_COMPILER=clang++ -S test -B build -DCMAKE_BUILD_TYPE=Debug run: cmake -DCMAKE_CXX_COMPILER=clang++ -S test -B build -DCMAKE_BUILD_TYPE=Debug

View File

@ -35,12 +35,13 @@ inline std::optional<short> from_char(char c) {
return std::nullopt; return std::nullopt;
} }
#define MING32_CLANG \ #if defined(__clang__) && defined(__MINGW32__) && !defined(__MINGW64__)
defined(__clang__) && defined(__MINGW32__) && !defined(__MINGW64__) #define MINGW32_CLANG
#endif
// mingw32 clang does not support some of the builtin functions // mingw32 clang does not support some of the builtin functions
#if (defined(__clang__) || defined(__GNUC__) || defined(__GUNG__)) && \ #if (defined(__clang__) || defined(__GNUC__) || defined(__GUNG__)) && \
(MING32_CLANG == false) !defined(MINGW32_CLANG)
#warning "using mul functions" #warning "using mul functions"
//////////////// ////////////////
// mul overflow detection // mul overflow detection
@ -200,7 +201,7 @@ std::enable_if_t<std::is_integral_v<T>, std::optional<T>> to_num(
} }
#if (defined(__clang__) || defined(__GNUC__) || defined(__GUNG__)) && \ #if (defined(__clang__) || defined(__GNUC__) || defined(__GUNG__)) && \
(MING32_CLANG == false) !defined(MINGW32_CLANG)
auto add_last_digit_owerflow = auto add_last_digit_owerflow =
(is_negative) ? sub_overflow<T> : add_overflow<T>; (is_negative) ? sub_overflow<T> : add_overflow<T>;
#else #else