]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common: use inline for monostate dencoders
authorCasey Bodley <cbodley@redhat.com>
Tue, 5 Dec 2023 17:21:18 +0000 (12:21 -0500)
committerCasey Bodley <cbodley@redhat.com>
Tue, 5 Dec 2023 17:21:27 +0000 (12:21 -0500)
fix a 'multiple definition' error when included by multiple sources:

src/common/versioned_variant.h:31: multiple definition of `ceph::encode(std::monostate const&, ceph::buffer::v15_2_0::list&)';
rgw_main.cc.o:src/common/versioned_variant.h:31: first defined here

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/common/versioned_variant.h

index f7e46b7296e7f2dc3b21cf3a2585130271db3de0..124c588391691289ca7189024d49f19b86494f6b 100644 (file)
@@ -28,8 +28,8 @@
 namespace ceph {
 
 // null encoding for std::monostate
-void encode(const std::monostate&, bufferlist& bl) {}
-void decode(std::monostate&, bufferlist::const_iterator& p) {}
+inline void encode(const std::monostate&, bufferlist& bl) {}
+inline void decode(std::monostate&, bufferlist::const_iterator& p) {}
 
 // largest value that can be represented by `__u8 struct_v`
 inline constexpr size_t max_version = std::numeric_limits<__u8>::max();