fmtlegacy/include/fmt
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
..
chrono.h Fix handling of invalid string in chrono formatting 2019-05-01 10:06:42 -07:00
color.h Move enable_if to template params 2019-03-16 15:15:38 -07:00
core.h 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) 2019-05-02 07:49:01 -07:00
format-inl.h Partially implement Grisu3 2019-04-27 12:17:21 -07:00
format.h 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) 2019-05-02 07:49:01 -07:00
locale.h basic_buffer -> buffer 2019-04-07 20:32:28 -07:00
ostream.h Add specialization test 2019-04-19 17:15:46 -07:00
posix.h Format the code using clang-format 2019-01-13 06:58:20 -08:00
prepare.h basic_buffer -> buffer 2019-04-07 20:32:28 -07:00
printf.h Convert negative precision to zero in printf (#1127) 2019-04-21 07:44:04 -07:00
ranges.h Move enable_if to template params 2019-03-16 15:15:38 -07:00
time.h Merge fmt/time.h into fmt/chrono.h 2019-03-14 18:07:42 -07:00