Skip to content

Commit a6eb4a5

Browse files
committed
Use memcpy consistently
1 parent 8b8fccd commit a6eb4a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/fmt/format.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@
4848

4949
#ifndef FMT_MODULE
5050
# include <stdlib.h> // malloc, free
51+
# include <string.h> // memcpy
5152

5253
# include <cmath> // std::signbit
5354
# include <cstddef> // std::byte
5455
# include <cstdint> // uint32_t
55-
# include <cstring> // std::memcpy
5656
# include <limits> // std::numeric_limits
5757
# include <new> // std::bad_alloc
5858
# if defined(__GLIBCXX__) && !defined(_GLIBCXX_USE_DUAL_ABI)
@@ -283,7 +283,7 @@ FMT_CONSTEXPR20 auto bit_cast(const From& from) -> To {
283283
#endif
284284
auto to = To();
285285
// The cast suppresses a bogus -Wclass-memaccess on GCC.
286-
std::memcpy(static_cast<void*>(&to), &from, sizeof(to));
286+
memcpy(static_cast<void*>(&to), &from, sizeof(to));
287287
return to;
288288
}
289289

0 commit comments

Comments
 (0)