]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include/inline_memory.h: Add missing includes to fix build
authorAdam Emerson <aemerson@redhat.com>
Wed, 10 Jan 2024 17:37:15 +0000 (12:37 -0500)
committerAdam Emerson <aemerson@redhat.com>
Wed, 24 Jan 2024 20:51:46 +0000 (15:51 -0500)
Signed-off-by: Adam Emerson <aemerson@redhat.com>
src/include/inline_memory.h

index 6a1fe34800abe4fa4e3214421a1f9626b2210f0d..e2283830103c49c857b7528fe3d3f31770013883 100644 (file)
 #ifndef CEPH_INLINE_MEMORY_H
 #define CEPH_INLINE_MEMORY_H
 
+#include <cstdint>
+#include <cstddef> // For size_t
+#include <cstring> // for memcpy
+
 #if defined(__GNUC__)
 
 // optimize for the common case, which is very small copies
@@ -25,7 +29,7 @@ void *maybe_inline_memcpy(void *dest, const void *src, size_t l,
                         size_t inline_len)
 {
   if (l > inline_len) {
-    return memcpy(dest, src, l);
+    return std::memcpy(dest, src, l);
   }
   switch (l) {
   case 8:
@@ -63,7 +67,7 @@ void *maybe_inline_memcpy(void *dest, const void *src, size_t l,
 
 #else
 
-#define maybe_inline_memcpy(d, s, l, x) memcpy(d, s, l)
+#define maybe_inline_memcpy(d, s, l, x) std::memcpy(d, s, l)
 
 #endif