From ed4b50bb86dde1bd5d1ab340834491c1b125b604 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 21 Jun 2022 19:58:49 -0700 Subject: [PATCH] IWYU cleanup of detail/type_caster_odr_guard.h --- include/pybind11/detail/type_caster_odr_guard.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/include/pybind11/detail/type_caster_odr_guard.h b/include/pybind11/detail/type_caster_odr_guard.h index 0b9ad545d..b9e00212f 100644 --- a/include/pybind11/detail/type_caster_odr_guard.h +++ b/include/pybind11/detail/type_caster_odr_guard.h @@ -22,20 +22,13 @@ # include "descr.h" # include "typeid.h" -# include +# include # include -# include -# include -# include -# include # include # include -# include -# include # include # include # include -# include PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE) PYBIND11_NAMESPACE_BEGIN(detail) @@ -66,9 +59,9 @@ void odr_guard_impl(const std::type_index &it_ti, // std::cout cannot be used here: static initialization could be incomplete. # define PYBIND11_DETAIL_ODR_GUARD_IMPL_PRINTF_OFF # ifdef PYBIND11_DETAIL_ODR_GUARD_IMPL_PRINTF_ON - fprintf( + std::fprintf( stdout, "\nODR_GUARD_IMPL %s %s\n", type_id().c_str(), source_file_line); - fflush(stdout); + std::fflush(stdout); # endif std::string sflbn_str{source_file_line_basename(source_file_line)}; auto ins = odr_guard_registry().insert({it_ti, source_file_line}); @@ -84,8 +77,8 @@ void odr_guard_impl(const std::type_index &it_ti, + reg_iter->second + "\", SourceLocation2=\"" + source_file_line + "\""); if (throw_disabled) { - fprintf(stderr, "\nDISABLED std::system_error: %s\n", err.what()); - fflush(stderr); + std::fprintf(stderr, "\nDISABLED std::system_error: %s\n", err.what()); + std::fflush(stderr); } else { throw err; }