Skip to content

Commit

Permalink
seastar.cc: include used header
Browse files Browse the repository at this point in the history
this allows all module implementation units to use a single definition
without worrying about using different definitions in different units.
without this change, clang-18 and libstdc++ shipped by GCC-13 fails
to build the tree like:

```
FAILED: src/CMakeFiles/seastar-module.dir/core/memory.cc.o
/home/kefu/.local/bin/clang++ -DFMT_SHARED -DSEASTAR_API_LEVEL=7 -DSEASTAR_COROUTINES_ENABLED -DSEASTAR_MODULE -DSEASTAR_SCHEDULING_GROUPS_COUNT=16 -DSEASTAR_SSTRING -Dseastar_module_EXPORTS -I/home/kefu/dev/seastar/include -I/home/kefu/d
ev/seastar/build/debug/gen/include -I/home/kefu/dev/seastar/src -g -std=c++23 -fPIC -U_FORTIFY_SOURCE -Wno-include-angled-in-module-purview -MD -MT src/CMakeFiles/seastar-module.dir/core/memory.cc.o -MF src/CMakeFiles/seastar-module.dir/c
ore/memory.cc.o.d @src/CMakeFiles/seastar-module.dir/core/memory.cc.o.modmap -o src/CMakeFiles/seastar-module.dir/core/memory.cc.o -c /home/kefu/dev/seastar/src/core/memory.cc
In module 'seastar' imported from /home/kefu/dev/seastar/src/core/memory.cc:111:
/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/unordered_set.h:1827:5: error: 'std::operator==' has different definitions in different modules; definition in module 'seastar' first difference is function body
 1826 |     inline bool
      |     ~~~~~~~~~~~
 1827 |     operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1828 |                const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1829 |     { return __x._M_h._M_equal(__y._M_h); }
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/unordered_set.h:1827:5: note: but in '' found a different body
 1826 |     inline bool
      |     ~~~~~~~~~~~
 1827 |     operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1828 |                const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1829 |     { return __x._M_h._M_equal(__y._M_h); }
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In module 'seastar' imported from /home/kefu/dev/seastar/src/core/memory.cc:111:
/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/unordered_set.h:1813:5: error: 'std::operator==' has different definitions in different modules; definition in module 'seastar' first difference is function body
 1812 |     inline bool
      |     ~~~~~~~~~~~
 1813 |     operator==(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1814 |                const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1815 |     { return __x._M_h._M_equal(__y._M_h); }
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
  • Loading branch information
tchaikov committed Apr 3, 2024
1 parent 1b66e41 commit da77409
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/seastar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ module;
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <variant>
#include <vector>
Expand Down

0 comments on commit da77409

Please sign in to comment.