From 529fcc30a85c15e96fc8cc5362e37725e42a2243 Mon Sep 17 00:00:00 2001 From: ado Date: Tue, 23 Feb 2021 20:27:54 +0100 Subject: [PATCH] try fix mingw i686 --- .github/workflows/msys2-clang.yml | 1 + include/ss/extract.hpp | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/msys2-clang.yml b/.github/workflows/msys2-clang.yml index 21a2abd..7827e94 100644 --- a/.github/workflows/msys2-clang.yml +++ b/.github/workflows/msys2-clang.yml @@ -51,6 +51,7 @@ jobs: - name: Install dependencies run: script/ci_install_deps.sh + run: clang++ -dM -E - < /dev/null - name: Configure run: cmake -DCMAKE_CXX_COMPILER=clang++ -S test -B build -DCMAKE_BUILD_TYPE=Debug diff --git a/include/ss/extract.hpp b/include/ss/extract.hpp index d33a323..0c0c3e1 100644 --- a/include/ss/extract.hpp +++ b/include/ss/extract.hpp @@ -35,9 +35,13 @@ inline std::optional from_char(char c) { return std::nullopt; } +#define MING32_CLANG \ + defined(__clang__) && defined(__MINGW32__) && !defined(__MINGW64__) + // mingw32 clang does not support some of the builtin functions -#if (defined(__clang__) && (!defined(_WIN32) || defined(_WIN64))) || \ - defined(__GNUC__) || defined(__GUNG__) +#if (defined(__clang__) || defined(__GNUC__) || defined(__GUNG__)) && \ + (MING32_CLANG == false) +#warning "using mul functions" //////////////// // mul overflow detection //////////////// @@ -195,7 +199,8 @@ std::enable_if_t, std::optional> to_num( } } -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) +#if (defined(__clang__) || defined(__GNUC__) || defined(__GUNG__)) && \ + (MING32_CLANG == false) auto add_last_digit_owerflow = (is_negative) ? sub_overflow : add_overflow; #else