diff --git a/include/fmt/format.h b/include/fmt/format.h index 238aa0b6..3c0f971f 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -159,36 +159,6 @@ FMT_END_NAMESPACE # define FMT_UDL_TEMPLATE 0 #endif -#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 - -#if FMT_USE_EXTERN_TEMPLATES -# if !defined(FMT_HEADER_ONLY) && defined(_WIN32) -# ifdef FMT_EXPORT -// When DLL exporting an "explicit class template instantiation declaration", -// we should not designate __declspec(dllexport) at both -// - class template definition -// - explicit class template instantiation declaration. -// -// (Instead, designate __declspec(dllexport) somewhere else -// and only at a single point where we have -// the "explicit class template instantiation definition.") -# define FMT_EXTERN_TEMPLATE_HEADER_FILE_API -# endif -# endif -#endif -#ifndef FMT_EXTERN_TEMPLATE_HEADER_FILE_API -// In other cases, we can just follow FMT_API there. -# define FMT_EXTERN_TEMPLATE_HEADER_FILE_API FMT_API -#endif - #if FMT_HAS_GXX_CXX11 || FMT_HAS_FEATURE(cxx_trailing_return) || \ FMT_MSC_VER >= 1600 # define FMT_USE_TRAILING_RETURN 1 @@ -732,7 +702,7 @@ template struct int_traits { // Static data is placed in this class template to allow header-only // configuration. -template struct FMT_EXTERN_TEMPLATE_HEADER_FILE_API basic_data { +template struct FMT_EXTERN_TEMPLATE_API basic_data { static const uint64_t POWERS_OF_10_64[]; static const uint32_t ZERO_OR_POWERS_OF_10_32[]; static const uint64_t ZERO_OR_POWERS_OF_10_64[]; @@ -746,9 +716,7 @@ template struct FMT_EXTERN_TEMPLATE_HEADER_FILE_API basic_da static const wchar_t WRESET_COLOR[5]; }; -#if FMT_USE_EXTERN_TEMPLATES extern template struct basic_data; -#endif // This is a struct rather than a typedef to avoid shadowing warnings in gcc. struct data : basic_data<> {};