Commit Graph

1325 Commits

Author SHA1 Message Date
Victor Zverovich
91ecb38a34 Localize negative integers 2022-09-03 07:01:11 -07:00
Victor Zverovich
fec5515c55 num_format_facet -> format_facet 2022-09-02 18:55:08 -07:00
Victor Zverovich
f187274d36 Add loc_value 2022-09-02 13:45:23 -07:00
Victor Zverovich
fc5e59fe4a Don't use stringstream 2022-09-02 13:05:26 -07:00
Victor Zverovich
d6a8704605 Improve locale support 2022-09-02 11:52:19 -07:00
Victor Zverovich
48327a82e3 Make format.h compile faster 2022-09-01 17:06:47 -07:00
Victor Zverovich
b79ed4105a Remove unnecessary type_identity 2022-09-01 16:29:08 -07:00
Victor Zverovich
64e29893cf Improve locale support 2022-09-01 14:48:43 -07:00
Victor Zverovich
0b0f7cfbfc hip workaround 2022-09-01 09:18:53 -07:00
Greg Sjaardema
40e414d823 Fix compilation error with gcc-7.2.0
Without the added line, the gcc-7.2.0 compiler will give the following error:
```
/opt/compiler-explorer/libs/fmt/trunk/include/fmt/format.h:1240:8: error: uninitialized variable 'buffer' in 'constexpr' function
   Char buffer[digits10<UInt>() + 1];
        ^~~~~~
```
See https://godbolt.org/z/fh7TMs9qs
2022-08-30 10:55:57 -07:00
Vladislav Shchapov
f98048b621 Fix bugs in utf8 decoder (#3056)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-08-26 15:37:15 -07:00
Vladislav Shchapov
489dabbd31 Fix decoder on broken utf8 sequences. (#3044)
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>

Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-08-24 07:13:27 -07:00
Victor Zverovich
1f95c34381 Fix sign handling with large code units 2022-08-20 07:46:58 -07:00
Olli Lupton
fbb568bce0 nvhpc/22.3: workaround for c++17 mode. (#3043) 2022-08-18 11:30:40 -07:00
Mark Santaniello
fd93b633b8 Constexpr formatted_size (#3026)
* Constexpr formatted_size

* Add C++20 tests for gcc 9 and 10

* Adjust unit test to require __cpp_lib_bit_cast
2022-08-10 09:35:30 -07:00
Hannes Friederich
b9087ee587 Suppress unused typedef warning 2022-08-05 15:27:01 -07:00
Vladislav Shchapov
36a25d75b4 Reuse detail::string_literal in the chrono formatter
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-08-05 06:15:59 -07:00
Victor Zverovich
e9ca7ea472 Suppress a bogus warning 2022-07-28 07:12:49 -07:00
Dimitrij Mijoski
81f1cc74a7 Improve Unicode handling when writing to an ostream on Windows (#2994)
* Refactor detail::print() by splitting into two functions.

The part with SetConsoleW is a separate function, without fwrite().

* Make Unicode handing when writing to std::ostream more robust.

Calls to print(ostream&) in the special Unicode case on Windows fallback
to writing via ostream::write instead of fwrite().

* Fix Unicode handling when writing to an ostream on GCC on Windows

* Add TODO note about detail::is_utf8()

* Fix warning -Wundef

* Fix for non-Windows OSs

* Fix building as DLL on Windows

* Refactor

* Suppress warning
2022-07-23 08:03:31 -07:00
Federico
bc5c7c50fd Fixes IBM XLC behavior with uint128 fallback (#2985)
* Fixes IBM XLC behavior with uint128 fallback

* Replace legacy xlc with clang-based xlc

* simplify xlc intrinsics handling

Co-authored-by: Federico Busato <fbusato@nvidia.com>
2022-07-22 13:49:17 -07:00
Victor Zverovich
371f9c71ca Fix even in format_dragon 2022-07-19 08:36:34 -07:00
Victor Zverovich
91abfcd6cf Suppress an msvc warning 2022-07-16 08:57:09 -07:00
Junekey Jeon
688a627d6c Remove unused constants. 2022-07-14 15:25:35 -07:00
Junekey Jeon
8061d9afbe Simplify Dragonbox implementation 2022-07-14 15:25:35 -07:00
Victor Zverovich
2a1b3ac629 Fix large shift in uint128_fallback 2022-07-10 08:27:21 -07:00
Vladislav Shchapov
115e00e0b9 Replace __cplusplus with FMT_CPLUSPLUS.
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-07-04 07:18:21 -07:00
Victor Zverovich
0c06c81da8 Deprecated implicit conversion of enums to ints for consistency with scoped enums 2022-07-03 09:02:22 -07:00
Victor Zverovich
9d60395953 Fix compilation on ppc64 2022-05-31 13:53:15 -07:00
Victor Zverovich
a2681aabcb Debug ppc failure 2022-05-31 11:30:22 -07:00
Victor Zverovich
798d09bb70 Debug ppc failure 2022-05-30 13:06:34 -07:00
Victor Zverovich
926ddd0631 Move compile string to detail 2022-05-30 07:06:36 -07:00
Victor Zverovich
e927149f8e Cleanup macros 2022-05-29 17:23:02 -07:00
Victor Zverovich
1761e2666a Remove FMT_CONSTEXPR_DECL 2022-05-29 16:42:58 -07:00
Victor Zverovich
c83a5d42bb FMT_MSC_VER -> FMT_MSC_VERSION 2022-05-29 15:39:08 -07:00
Victor Zverovich
27cd68c301 Cleanup macros 2022-05-29 14:45:59 -07:00
Victor Zverovich
08be4abb30 Remove FMT_NVCOMPILER_VERSION 2022-05-29 13:54:31 -07:00
Victor Zverovich
661b192545 Remove FMT_HEADER_ONLY_CONSTEXPR20 2022-05-29 13:22:45 -07:00
Victor Zverovich
d1026fa5d2 Remove extern format_float 2022-05-29 13:11:19 -07:00
Victor Zverovich
7e63b600b6 Make to_string work with __float128 2022-05-29 12:23:57 -07:00
Victor Zverovich
c2fcdc54e2 Move format_float to format.h for __float128 2022-05-29 11:30:33 -07:00
Victor Zverovich
2b9037a190 Move basic_fp to format.h for compile-time formatting 2022-05-29 07:32:52 -07:00
Ivan Shynkarenka
652fea45a9 Visual Studio 2022: fmt/format.h(1526,27): warning C4127: conditional expression is constant #2908 2022-05-27 10:38:13 -07:00
Vladislav Shchapov
1f9eae7e31 Add xchar support for write_escaped_string.
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
2022-05-27 08:36:38 -07:00
Victor Zverovich
ce246aaf74 Remove deprecated APIs 2022-05-22 07:10:09 -07:00
Victor Zverovich
f5cdf7cb04 Simplify snprintf_float 2022-05-21 12:34:21 -07:00
Victor Zverovich
440512f08d Remove deprecated APIs 2022-05-21 12:20:31 -07:00
Victor Zverovich
621eb80bbb Remove deprecated APIs 2022-05-21 11:34:07 -07:00
Victor Zverovich
c6324009ba Add initial double-double support 2022-05-21 07:32:54 -07:00
Ivan Shynkarenka
3e28dc021c VS2022 17.2: C4189: 'zero': local variable is initialized but not referenced #2891 (#2892)
VS2022 17.2: C4189: 'zero': local variable is initialized but not referenced #2891

Co-authored-by: Ivan Shynkarenka <Ivan_Shynkarenka@epam.com>
2022-05-13 07:04:34 -07:00
Victor Zverovich
ae963e444f Implement constexpr isfinite to avoid producing NaN 2022-05-11 08:43:22 -07:00