diff options
author | MarcDirven <31624073+MarcDirven@users.noreply.github.com> | 2020-10-11 16:49:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-11 07:49:54 -0700 |
commit | 01c37e0a4b571b011846ac3e7e4a6ff31ab426aa (patch) | |
tree | 5e33f7a759532977552b140b350f4c9a4c087e05 | |
parent | a5e7e7db95768bc2c39ac6c9bbd9cd0d3b87b723 (diff) | |
download | fmtlib-01c37e0a4b571b011846ac3e7e4a6ff31ab426aa.tar.gz |
Added check for `-mbig-obj` and ref qualifier check (#1929)
* Added check whether mingw has -mbig-obj flag
* Removed ref qualifiers
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | include/fmt/format.h | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1341e9f3..3fac2afc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,7 +199,10 @@ if (HAVE_STRTOD_L) endif () if (MINGW) - target_compile_options(fmt PUBLIC "-Wa,-mbig-obj") + check_cxx_compiler_flag("Wa,-mbig-obj" FMT_HAS_MBIG_OBJ) + if (${FMT_HAS_MBIG_OBJ}) + target_compile_options(fmt PUBLIC "-Wa,-mbig-obj") + endif() endif () if (FMT_WERROR) diff --git a/include/fmt/format.h b/include/fmt/format.h index 1fc57de1..83c7c54f 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -828,7 +828,7 @@ struct FMT_EXTERN_TEMPLATE_API uint128_wrapper { uint64_t high() const FMT_NOEXCEPT { return uint64_t(internal_ >> 64); } uint64_t low() const FMT_NOEXCEPT { return uint64_t(internal_); } - uint128_wrapper& operator+=(uint64_t n) & FMT_NOEXCEPT { + uint128_wrapper& operator+=(uint64_t n) FMT_NOEXCEPT { internal_ += n; return *this; } @@ -842,7 +842,7 @@ struct FMT_EXTERN_TEMPLATE_API uint128_wrapper { uint64_t high() const FMT_NOEXCEPT { return high_; } uint64_t low() const FMT_NOEXCEPT { return low_; } - uint128_wrapper& operator+=(uint64_t n) & FMT_NOEXCEPT { + uint128_wrapper& operator+=(uint64_t n) FMT_NOEXCEPT { # if defined(_MSC_VER) && defined(_M_X64) unsigned char carry = _addcarry_u64(0, low_, n, &low_); _addcarry_u64(carry, high_, 0, &high_); |