mirror of
https://github.com/fmtlib/fmt.git
synced 2025-08-02 12:14:43 +02:00
Reduce binary size
This commit is contained in:
@@ -44,7 +44,7 @@
|
|||||||
#include "core.h"
|
#include "core.h"
|
||||||
|
|
||||||
#ifdef FMT_DEPRECATED_INCLUDE_OS
|
#ifdef FMT_DEPRECATED_INCLUDE_OS
|
||||||
# include "os.h"
|
# include "os.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __INTEL_COMPILER
|
#ifdef __INTEL_COMPILER
|
||||||
@@ -67,6 +67,12 @@
|
|||||||
# define FMT_HAS_BUILTIN(x) 0
|
# define FMT_HAS_BUILTIN(x) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if FMT_GCC_VERSION || FMT_CLANG_VERSION
|
||||||
|
# define FMT_NOINLINE __attribute__((noinline))
|
||||||
|
#else
|
||||||
|
# define FMT_NOINLINE
|
||||||
|
#endif
|
||||||
|
|
||||||
#if __cplusplus == 201103L || __cplusplus == 201402L
|
#if __cplusplus == 201103L || __cplusplus == 201402L
|
||||||
# if defined(__clang__)
|
# if defined(__clang__)
|
||||||
# define FMT_FALLTHROUGH [[clang::fallthrough]]
|
# define FMT_FALLTHROUGH [[clang::fallthrough]]
|
||||||
@@ -1392,7 +1398,7 @@ template <typename Char> struct nonfinite_writer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <typename OutputIt, typename Char>
|
template <typename OutputIt, typename Char>
|
||||||
OutputIt fill(OutputIt it, size_t n, const fill_t<Char>& fill) {
|
FMT_NOINLINE OutputIt fill(OutputIt it, size_t n, const fill_t<Char>& fill) {
|
||||||
auto fill_size = fill.size();
|
auto fill_size = fill.size();
|
||||||
if (fill_size == 1) return std::fill_n(it, n, fill[0]);
|
if (fill_size == 1) return std::fill_n(it, n, fill[0]);
|
||||||
for (size_t i = 0; i < n; ++i) it = std::copy_n(fill.data(), fill_size, it);
|
for (size_t i = 0; i < n; ++i) it = std::copy_n(fill.data(), fill_size, it);
|
||||||
|
Reference in New Issue
Block a user