From fc34a039a3e7a0586c1cdf8ab03ca0831de9c024 Mon Sep 17 00:00:00 2001 From: "jiyong.min" Date: Fri, 22 Apr 2022 08:58:51 +0900 Subject: [PATCH] Fix build error when '__ARM_FP' is 0x02 - When '__ARM_FP' is 0x02(fpu support), '__fp16' or '_Float16' needs for 'float16_t'. But '__fp16' and '_Float16' are not declared in tizen. So we add 'float16_t' for tizen. Change-Id: I248119d666c6c30cf5609bfc9a050c93cbfa6257 --- CMakeLists.txt | 2 ++ third_party/highway/hwy/base.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c2790ab..3d54d56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -213,6 +213,8 @@ add_definitions( -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted" + # To avoid build error in tizen, add define for submodules + -D__TIZEN__ ) # Avoid log spam from fopen etc. diff --git a/third_party/highway/hwy/base.h b/third_party/highway/hwy/base.h index 009373f..c9e0d0c 100644 --- a/third_party/highway/hwy/base.h +++ b/third_party/highway/hwy/base.h @@ -231,10 +231,17 @@ static constexpr HWY_MAYBE_UNUSED size_t kMaxVectorSize = 16; #if defined(HWY_EMULATE_SVE) using float16_t = FarmFloat16; #elif HWY_NATIVE_FLOAT16 +// Avoid "'__fp16' and '_Float16' not declared" build error +#if defined(__TIZEN__) +struct float16_t { + uint16_t bits; +}; +#else using float16_t = __fp16; // Clang does not allow __fp16 arguments, but scalar.h requires LaneType // arguments, so use a wrapper. // TODO(janwas): replace with _Float16 when that is supported? +#endif #else struct float16_t { uint16_t bits; -- 2.7.4