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