From d67d6ac324ce00009fd33e92a74aeab2e4dc2f20 Mon Sep 17 00:00:00 2001 From: MagicXHouse <2858000522@qq.com> Date: Wed, 16 Sep 2026 15:07:53 +0800 Subject: [PATCH] fix CI error caused by native/cocos/base/Utils.h --- native/cocos/base/Utils.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/native/cocos/base/Utils.h b/native/cocos/base/Utils.h index 982a1e43bd..cc29740072 100644 --- a/native/cocos/base/Utils.h +++ b/native/cocos/base/Utils.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "base/Macros.h" #include "base/TypeDef.h" @@ -145,7 +146,7 @@ CC_FORCE_INLINE Tgt bit_cast(const Src &src) { // NOLINT(readability-identifier- Tgt tgt; // Load src into registers first. This allows the memcpy to be elided by CUDA. const Src staged = src; - memcpy(&tgt, &staged, sizeof(Tgt)); + std::memcpy(&tgt, &staged, sizeof(Tgt)); return tgt; } @@ -177,17 +178,18 @@ CC_FORCE_INLINE uint32_t floatToSortableUint(float value) { // Code from https://gitlab.com/libeigen/eigen/-/blob/master/Eigen/src/Core/arch/Default/Half.h#L586 struct HalfRaw { - constexpr HalfRaw() : x(0) {} // NOLINT(modernize-use-default-member-init) + constexpr HalfRaw() : x(0) {} #if defined(CC_HAS_ARM64_FP16_SCALAR_ARITHMETIC) explicit HalfRaw(uint16_t raw) : x(numext::bit_cast<__fp16>(raw)) { } - __fp16 x; + __fp16 x; // NOLINT(modernize-use-default-member-init) #else explicit constexpr HalfRaw(uint16_t raw) : x(raw) {} uint16_t x; // NOLINT(modernize-use-default-member-init) #endif }; + // Conversion routines, including fallbacks for the host or older CUDA. // Note that newer Intel CPUs (Haswell or newer) have vectorized versions of // these in hardware. If we need more performance on older/other CPUs, they are