try fix mingw i686

This commit is contained in:
ado
2021-02-23 20:27:54 +01:00
parent 71e3acd1c4
commit 529fcc30a8
2 changed files with 9 additions and 3 deletions

View File

@@ -35,9 +35,13 @@ inline std::optional<short> 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::is_integral_v<T>, std::optional<T>> 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<T> : add_overflow<T>;
#else