Two small fixes:

1. memcpy is declared in <cstring>; make sure to include it if needed
2. asFloat's __cpp_lib_bit_cast was using the wrong name for its
   parameter (the param was renamed after testing and I never rebuilt)
   with `__cpp_lib_bit_cast` on. Oops :-(
This commit is contained in:
Harold Pratt (HAL)
2022-07-25 10:34:20 -07:00
parent 047d159996
commit 68b780fa37

View File

@@ -11,6 +11,8 @@
#ifdef __cpp_lib_bit_cast
#include <bit>
#else
#include <cstring>
#endif
#include "YGValue.h"
#include "YGMacros.h"
@@ -169,7 +171,7 @@ private:
static float asFloat(uint32_t u) {
#ifdef __cpp_lib_bit_cast
return std::bit_cast<float>(data);
return std::bit_cast<float>(u);
#else
float f;
static_assert(sizeof(f) == sizeof(u), "uint32_t and float must have the same size");