Cleanup template instantiations

This commit is contained in:
Gabi Melman 2024-12-07 10:48:16 +02:00
parent 9bc69aa2f5
commit 4b787b3044
5 changed files with 31 additions and 30 deletions

View File

@ -4,9 +4,7 @@
#include "spdlog/sinks/base_sink.h"
#include <memory>
#include <mutex>
#include "spdlog/common.h"
#include "spdlog/details/null_mutex.h"
#include "spdlog/pattern_formatter.h"
namespace spdlog {
@ -54,9 +52,12 @@ void base_sink<Mutex>::set_formatter_(std::unique_ptr<formatter> sink_formatter)
formatter_ = std::move(sink_formatter);
}
// template instantiations
template class SPDLOG_API base_sink<std::mutex>;
template class SPDLOG_API base_sink<details::null_mutex>;
} // namespace sinks
} // namespace spdlog
// template instantiations
#include <mutex>
#include "spdlog/details/null_mutex.h"
template class SPDLOG_API spdlog::sinks::base_sink<std::mutex>;
template class SPDLOG_API spdlog::sinks::base_sink<spdlog::details::null_mutex>;

View File

@ -3,8 +3,6 @@
#include "spdlog/sinks/basic_file_sink.h"
#include "spdlog/common.h"
#include "spdlog/details/null_mutex.h"
#include <mutex>
namespace spdlog {
namespace sinks {
@ -32,9 +30,12 @@ void basic_file_sink<Mutex>::flush_() {
file_helper_.flush();
}
// template instantiations
template class SPDLOG_API basic_file_sink<std::mutex>;
template class SPDLOG_API basic_file_sink<details::null_mutex>;
} // namespace sinks
} // namespace spdlog
// template instantiations
#include <mutex>
#include "spdlog/details/null_mutex.h"
template class SPDLOG_API spdlog::sinks::basic_file_sink<std::mutex>;
template class SPDLOG_API spdlog::sinks::basic_file_sink<spdlog::details::null_mutex>;

View File

@ -12,7 +12,6 @@
#include "spdlog/common.h"
#include "spdlog/details/file_helper.h"
#include "spdlog/details/os.h"
#include "spdlog/details/null_mutex.h"
namespace spdlog {
namespace sinks {
@ -137,9 +136,12 @@ bool rotating_file_sink<Mutex>::rename_file_(const filename_t &src_filename, con
return details::os::rename(src_filename, target_filename);
}
// template instantiations
template class SPDLOG_API rotating_file_sink<std::mutex>;
template class SPDLOG_API rotating_file_sink<details::null_mutex>;
} // namespace sinks
} // namespace spdlog
// template instantiations
#include <mutex>
#include "spdlog/details/null_mutex.h"
template class SPDLOG_API spdlog::sinks::rotating_file_sink<std::mutex>;
template class SPDLOG_API spdlog::sinks::rotating_file_sink<spdlog::details::null_mutex>;

View File

@ -4,7 +4,6 @@
#include "spdlog/sinks/stdout_sinks.h"
#include <memory>
#include "spdlog/details/os.h"
#include "spdlog/pattern_formatter.h"
@ -81,11 +80,14 @@ template <typename Mutex>
stderr_sink<Mutex>::stderr_sink()
: stdout_sink_base<Mutex>(stderr) {}
// template installations
template class SPDLOG_API stdout_sink<std::mutex>;
template class SPDLOG_API stdout_sink<details::null_mutex>;
template class SPDLOG_API stderr_sink<std::mutex>;
template class SPDLOG_API stderr_sink<details::null_mutex>;
} // namespace sinks
} // namespace spdlog
// template instantiations
#include <mutex>
#include "spdlog/details/null_mutex.h"
template class SPDLOG_API spdlog::sinks::stdout_sink<std::mutex>;
template class SPDLOG_API spdlog::sinks::stdout_sink<spdlog::details::null_mutex>;
template class SPDLOG_API spdlog::sinks::stderr_sink<std::mutex>;
template class SPDLOG_API spdlog::sinks::stderr_sink<spdlog::details::null_mutex>;

View File

@ -135,15 +135,10 @@ wincolor_stderr_sink<Mutex>::wincolor_stderr_sink(color_mode mode)
} // namespace spdlog
// template instantiations
#include <mutex>
#include "spdlog/details/null_mutex.h"
// template instantiations
template class SPDLOG_API spdlog::sinks::wincolor_sink<std::mutex>;
template class SPDLOG_API spdlog::sinks::wincolor_sink<spdlog::details::null_mutex>;
template class SPDLOG_API spdlog::sinks::wincolor_stdout_sink<std::mutex>;
template class SPDLOG_API spdlog::sinks::wincolor_stdout_sink<spdlog::details::null_mutex>;
template class SPDLOG_API spdlog::sinks::wincolor_stderr_sink<std::mutex>;
template class SPDLOG_API spdlog::sinks::wincolor_stderr_sink<spdlog::details::null_mutex>;