From f24cdb4b77c2dcccfb8774ea9432d62f58a48468 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 1 Nov 2024 20:08:45 +0800 Subject: [PATCH] treewide: include core/format.hh when appropriate before this change, we include core/print.hh for formatting and/or for printing. but core/print.hh includes `` which is a heavyweight header in the C++ standard library. under most circumstances, all we need is but `seastar::format()`, which is provided by a smaller header -- `core/format.hh`. in this change, we include `core/format.hh` instead of `core/print.hh` when appropriate. and adapt the translation units where `iostream` is used to include this header. this should reduce the header dependency of Seastar library and speed up the compilation. Signed-off-by: Kefu Chai --- apps/io_tester/ioinfo.cc | 1 + apps/rpc_tester/rpc_tester.cc | 1 + demos/rpc_demo.cc | 1 + include/seastar/core/internal/estimated_histogram.hh | 2 +- include/seastar/rpc/rpc_impl.hh | 2 +- include/seastar/util/backtrace.hh | 2 +- include/seastar/util/program-options.hh | 2 +- 7 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/io_tester/ioinfo.cc b/apps/io_tester/ioinfo.cc index 0f0909b4c5b..ec4e840a91d 100644 --- a/apps/io_tester/ioinfo.cc +++ b/apps/io_tester/ioinfo.cc @@ -18,6 +18,7 @@ /* * Copyright (C) 2021 ScyllaDB */ +#include #include #include #include diff --git a/apps/rpc_tester/rpc_tester.cc b/apps/rpc_tester/rpc_tester.cc index 805c5025ad4..99b6bd8daaf 100644 --- a/apps/rpc_tester/rpc_tester.cc +++ b/apps/rpc_tester/rpc_tester.cc @@ -19,6 +19,7 @@ * Copyright (C) 2022 ScyllaDB */ +#include #include #include #include diff --git a/demos/rpc_demo.cc b/demos/rpc_demo.cc index dd7abbfc8a7..9c683813387 100644 --- a/demos/rpc_demo.cc +++ b/demos/rpc_demo.cc @@ -19,6 +19,7 @@ * Copyright 2015 Cloudius Systems */ #include +#include #include #include #include diff --git a/include/seastar/core/internal/estimated_histogram.hh b/include/seastar/core/internal/estimated_histogram.hh index fff87dc70dc..636a3336d4f 100644 --- a/include/seastar/core/internal/estimated_histogram.hh +++ b/include/seastar/core/internal/estimated_histogram.hh @@ -25,8 +25,8 @@ #include #include #include +#include #include -#include #include #include #include diff --git a/include/seastar/rpc/rpc_impl.hh b/include/seastar/rpc/rpc_impl.hh index faf01f199db..6ca03c80c63 100644 --- a/include/seastar/rpc/rpc_impl.hh +++ b/include/seastar/rpc/rpc_impl.hh @@ -20,6 +20,7 @@ */ #pragma once +#include #include #include #include @@ -27,7 +28,6 @@ #include #include #include -#include #include // for compatibility diff --git a/include/seastar/util/backtrace.hh b/include/seastar/util/backtrace.hh index 675116cb7e0..5a4dbad54e6 100644 --- a/include/seastar/util/backtrace.hh +++ b/include/seastar/util/backtrace.hh @@ -21,8 +21,8 @@ #pragma once +#include #include -#include #include #include #include diff --git a/include/seastar/util/program-options.hh b/include/seastar/util/program-options.hh index 54e52ed7152..fd48c2603fd 100644 --- a/include/seastar/util/program-options.hh +++ b/include/seastar/util/program-options.hh @@ -21,8 +21,8 @@ #pragma once +#include #include -#include #include #ifndef SEASTAR_MODULE