Commit Graph

367 Commits

Author SHA1 Message Date
Alex Alabuzhev
77d6036cd5 Fix unexpected trailing decimal point (#1153) 2019-05-11 06:34:47 -07:00
mocabe
6828d549e8 Add FMT_ENABLE_IF_T
for definitions of functions which declared using FMT_ENABLE_IF
2019-05-08 11:20:55 -07:00
denchat
29c10fbf6e Fix DLL visibility of explicit instantiation "declaration" of internal::basic_data<void> in header format.h and the explicit instantiation "definition" in format.cc (#1134)
* Update format.cc

As the explicit instantiation *declaration* of `internal::basic_data<void>` in format.h, this explicit instantiation *definition* should mirror FMT_API also.

* Mirror visibility of explicit instantiation declaration 

explicit instantiation declaration of internal::basic_data<void> should mirror visibility of FMT_API

* Eliminate `__declspec(dllexport)` designation on extern template internal::basic_data<> when `extern` affected during exporting phase.

* Add `FMT_EXTERN_TEMPLATE_API` for designate DLL export `extern template`

When exporting DLL, do not designate `__declspec(dllexport)` any template that has any explicit class template declaration a.k.a. `extern template`. Instead, designate `__declspec(dllexport)` at single point where we have explicit class template definition a.k.a. normal instantiation without `extern`

Note: this is a c++11 feature.

* Delete whole `FMT_USE_EXTERN_TEMPLATES` block and its condition

1. Remove whole `FMT_USE_EXTERN_TEMPLATES` block
(trailing `FMT_UDL_TEMPLATE` block)
````
#ifndef FMT_USE_EXTERN_TEMPLATES
#  ifndef FMT_HEADER_ONLY
#    define FMT_USE_EXTERN_TEMPLATES                           \
      ((FMT_CLANG_VERSION >= 209 && __cplusplus >= 201103L) || \
       (FMT_GCC_VERSION >= 303 && FMT_HAS_GXX_CXX11))
#  else
#    define FMT_USE_EXTERN_TEMPLATES 0
#  endif
#endif
````

2. Delete `FMT_USE_EXTERN_TEMPLATES` condition, only condition, that trailing basic_data class template definition.
````
#if FMT_USE_EXTERN_TEMPLATES
extern template struct basic_data<void>;
#endif
````

3. Replace `FMT_API` with new `FMT_EXTERN_TEMPLATE_API` added in `core.h` for sake of extern template of `basic_data<void>`

* Add `#define FMT_EXTERN extern` only when not `FMT_HEADER_ONLY`

* Replace `extern` on basic_data<void> with the `FMT_EXTERN` condition in core.h

* replace misspelled if !define() with ifndef
2019-05-02 07:49:01 -07:00
Victor Zverovich
8d8ea21c69 Partially implement Grisu3 2019-04-27 12:17:21 -07:00
Victor Zverovich
40a7975640 Remove trailing zeros 2019-04-27 07:42:27 -07:00
Victor Zverovich
bd516e3429 Convert negative precision to zero in printf (#1127)
and remove redundant check in grisu2_prettify.
2019-04-21 07:44:04 -07:00
HE, Tao
6b20863918 fmt::ptr: support unique_ptr and shared_ptr. 2019-04-18 10:12:11 -07:00
Victor Zverovich
d306585a3f Don't inject internal names into std (#1120) 2019-04-17 13:25:31 -07:00
Victor Zverovich
dc94010fa5 Remove char_traits (#1117) 2019-04-16 17:08:24 -07:00
Victor Zverovich
bade46aae5 Optimize grisu using uint128_t 2019-04-13 13:44:41 -07:00
Victor Zverovich
41fbaeb3b1 Add <format> test 2019-04-13 11:37:52 -07:00
Victor Zverovich
718f60accb Fix shadowing warning (#1105) and clang format 2019-04-08 19:14:32 -07:00
Bruce Mitchener
aeb5ad3ce1 Enable [[noreturn]] some. 2019-04-08 07:53:59 -07:00
Victor Zverovich
2808395481 basic_buffer -> buffer
This reduces symbol sizes and gets rid of shadowing warnings.
2019-04-07 20:32:28 -07:00
Victor Zverovich
07d5a86a7c Fix warnings 2019-04-06 22:10:10 -07:00
Victor Zverovich
ab1474ef66 Workaround segfault in doxygen and apply clang-format 2019-04-06 15:55:14 -07:00
Victor Zverovich
bd8177177a Add support for platforms without uintptr_t 2019-04-06 08:11:03 -07:00
Victor Zverovich
0302927f56 Optimize pointer formatting 2019-04-05 20:36:37 -07:00
Victor Zverovich
bb6842ba35 Simplify to_string 2019-04-05 19:15:22 -07:00
Victor Zverovich
b23c8633fa Detect presence of uintptr_t 2019-04-05 07:43:00 -07:00
Ivan Shynkarenka
e979c782d3 Extend basic_writer with write() method for doubles with optional format_specs argument 2019-03-25 19:16:41 -07:00
Victor Zverovich
91acfe6852 Fix UBSAN warning 2019-03-22 07:56:02 -07:00
Victor Zverovich
b7e6bf9671 clang format 2019-03-21 20:51:37 -07:00
Victor Zverovich
da0ea4161a Make compile-time checks work with fallback formatter (#1088) 2019-03-21 19:26:53 -07:00
mwinterb
7ad3015f5b Added missing typename to FMT_STRING. (#1089)
* Added missing typename to FMT_STRING.

This is so that FMT_STRING can be used in a template.
2019-03-20 20:37:00 -07:00
Victor Zverovich
294fd7df96 Remove isinf workaround 2019-03-17 14:49:19 -07:00
Victor Zverovich
bc784d3625 Remove isnan workaround 2019-03-17 12:23:36 -07:00
Victor Zverovich
76d326a2a2 Enable grisu for general format 2019-03-17 09:48:50 -07:00
Victor Zverovich
c21c6b8c4b Move enable_if to template params 2019-03-16 15:15:38 -07:00
Bruce Mitchener
4523053e6f Fix typos. 2019-03-10 07:49:33 -07:00
Victor Zverovich
49d244c065 Don't emit more than precision digits (#1072) 2019-03-09 13:53:23 -08:00
Victor Zverovich
3466d9c845 Don't override fixed formatting depending on exponent (#1072) 2019-03-09 13:22:07 -08:00
Victor Zverovich
93d22dec35 Implement rounding up and clean up FP formatting 2019-03-09 10:40:36 -08:00
Victor Zverovich
d560ddac25 Temporarily disable Grisu for fixed formatting 2019-03-08 19:09:05 -08:00
Michael Winterberg
d8434baa03 Declare the size of RESET_COLOR.
This is so that the format with a text_tyle will compile even if
header-only mode isn't enabled. Addresses #1063.
2019-03-06 09:41:45 -10:00
gawain
79b79f329e Add support for '%' type to output floating point values as a
percentage.

This helps with compatibility with Python's format strings.
2019-03-05 17:36:20 -08:00
Alexander Bolz
287eaab3b2 Increment output iterator in basic_writer::write for character types (#1056) 2019-02-26 12:16:34 -10:00
Victor Zverovich
a97757736b Use grisu for fixed precision 2019-02-23 15:50:50 -10:00
Brian
327d4b6e9e Fixes for some pedantic warnings (#1054)
* Fix order of initializers

* Remove unused parameter

* Disable warning "-Wswitch-enum"
2019-02-23 09:40:08 -10:00
Victor Zverovich
8af651be39 Implement fixed precision 2019-02-22 10:47:27 -10:00
Victor Zverovich
82c24edcf6 Workaround a bogus Qt Creator warning 2019-02-19 06:33:55 -10:00
Victor Zverovich
442fa1bd46 Decouple format and parse contexts 2019-02-09 20:39:37 -08:00
Victor Zverovich
744e66bb08 Deprecate format_context::parse_context() 2019-02-09 16:15:20 -08:00
Victor Zverovich
5a314a5288 Eliminate extra copy on floating-point formatting 2019-02-06 10:17:50 -08:00
Victor Zverovich
355eb6d29a Enable grisu for shortest roundtrip (default) formatting 2019-02-03 10:38:28 -08:00
Victor Zverovich
b8d34e0db3 Fix rounding 2019-02-02 09:19:46 -08:00
Elias Kosunen
c3268f4e50 Remove use cases of deprecated functionality 2019-02-02 05:48:39 -08:00
Elias Kosunen
34951f1999 Replace comments regarding deprecation with attributes 2019-02-02 05:48:39 -08:00
Victor Zverovich
06c005b7b0 Clarify that compile-time checks don't support named arguments 2019-01-27 10:10:13 -08:00
Daniela Engert
9f70b034e1 Implement precision for floating-point durations.
The formatting syntax follows p1361r0, augmented by a precision field as proposed in #1004.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2019-01-23 07:17:00 -08:00