Skip to content

Commit

Permalink
treewide: include required header files
Browse files Browse the repository at this point in the history
before this change, when building with C++20 modules enabled, some
symbols are not accessible, when compiling source files like
src/core/resource.cc if some features are enabled using macros like
SEASTAR_HAVE_HWLOC and SEASTAR_HAVE_URING.

in this change, we include the missing headers or move the include
precessor directives, so that the .cc files can have access to the
used declaration of the used symbols.

please note, this change not only enables us to build C++20 modules
with SEASTAR_HAVE_HWLOC and/or SEASTAR_HAVE_URING defined, it is also
necessary also from the correctness point of view.

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed May 19, 2024
1 parent 4054d81 commit bc2f324
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/core/reactor_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ module;
#include <sys/syscall.h>
#include <sys/resource.h>
#include <boost/container/small_vector.hpp>
#include <fmt/core.h>

#ifdef SEASTAR_HAVE_URING
#include <liburing.h>
Expand Down
8 changes: 4 additions & 4 deletions src/core/resource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ module;
#include <limits>
#include <filesystem>
#include <unordered_map>
#include <fmt/core.h>
#if SEASTAR_HAVE_HWLOC
#include <hwloc/glibc-sched.h>
#endif

#ifdef SEASTAR_MODULE
module seastar;
Expand All @@ -49,10 +53,6 @@ module seastar;
#include <seastar/core/print.hh>
#include "cgroup.hh"

#if SEASTAR_HAVE_HWLOC
#include <hwloc/glibc-sched.h>
#endif

#endif

namespace seastar {
Expand Down
4 changes: 3 additions & 1 deletion src/seastar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ module;
#include <fmt/ostream.h>
#include <fmt/printf.h>
#include <gnutls/crypto.h>

#ifdef SEASTAR_HAVE_HWLOC
#include <hwloc.h>
#endif
#if defined(__x86_64__) || defined(__i386__)
#include <xmmintrin.h>
#endif
Expand Down

0 comments on commit bc2f324

Please sign in to comment.