|
| 1 | +# Fix CHAR_WIDTH glibc clash |
| 2 | +# see: https://github.com/Cantera/cantera/issues/369#issuecomment-254090244 |
| 3 | +# https://github.com/gabime/spdlog/issues/300 and https://github.com/3Hren/blackhole/pull/184 |
| 4 | +# SEP 24th 2020 by B. Hajgato (UGent) |
| 5 | +diff -ru sailfish-0.10.0.orig/include/spdlog/details/format.h sailfish-0.10.0/include/spdlog/details/format.h |
| 6 | +--- sailfish-0.10.0.orig/include/spdlog/details/format.h 2016-04-14 03:24:40.000000000 +0200 |
| 7 | ++++ sailfish-0.10.0/include/spdlog/details/format.h 2020-09-24 17:26:19.195521057 +0200 |
| 8 | +@@ -2053,29 +2053,29 @@ |
| 9 | + typedef typename BasicWriter<Char>::CharPtr CharPtr; |
| 10 | + Char fill = internal::CharTraits<Char>::cast(spec_.fill()); |
| 11 | + CharPtr out = CharPtr(); |
| 12 | +- const unsigned CHAR_WIDTH = 1; |
| 13 | +- if (spec_.width_ > CHAR_WIDTH) |
| 14 | ++ const unsigned CHAR_WIDTH_NOCLASH = 1; |
| 15 | ++ if (spec_.width_ > CHAR_WIDTH_NOCLASH) |
| 16 | + { |
| 17 | + out = writer_.grow_buffer(spec_.width_); |
| 18 | + if (spec_.align_ == ALIGN_RIGHT) |
| 19 | + { |
| 20 | +- std::uninitialized_fill_n(out, spec_.width_ - CHAR_WIDTH, fill); |
| 21 | +- out += spec_.width_ - CHAR_WIDTH; |
| 22 | ++ std::uninitialized_fill_n(out, spec_.width_ - CHAR_WIDTH_NOCLASH, fill); |
| 23 | ++ out += spec_.width_ - CHAR_WIDTH_NOCLASH; |
| 24 | + } |
| 25 | + else if (spec_.align_ == ALIGN_CENTER) |
| 26 | + { |
| 27 | + out = writer_.fill_padding(out, spec_.width_, |
| 28 | +- internal::check(CHAR_WIDTH), fill); |
| 29 | ++ internal::check(CHAR_WIDTH_NOCLASH), fill); |
| 30 | + } |
| 31 | + else |
| 32 | + { |
| 33 | +- std::uninitialized_fill_n(out + CHAR_WIDTH, |
| 34 | +- spec_.width_ - CHAR_WIDTH, fill); |
| 35 | ++ std::uninitialized_fill_n(out + CHAR_WIDTH_NOCLASH, |
| 36 | ++ spec_.width_ - CHAR_WIDTH_NOCLASH, fill); |
| 37 | + } |
| 38 | + } |
| 39 | + else |
| 40 | + { |
| 41 | +- out = writer_.grow_buffer(CHAR_WIDTH); |
| 42 | ++ out = writer_.grow_buffer(CHAR_WIDTH_NOCLASH); |
| 43 | + } |
| 44 | + *out = internal::CharTraits<Char>::cast(value); |
| 45 | + } |
| 46 | +@@ -4358,4 +4358,4 @@ |
| 47 | + # include "format.cc" |
| 48 | + #endif |
| 49 | + |
| 50 | +-#endif // FMT_FORMAT_H_ |
| 51 | +\ No newline at end of file |
| 52 | ++#endif // FMT_FORMAT_H_ |
0 commit comments