Skip to content

Commit be8b2d1

Browse files
authored
Add explicit conversion to fix arm64 builds. (#82429)
Fixes issue preventing builds on ARM-based Macs. #82205. Co-authored-by: Moshe Berman <[email protected]>
1 parent 563ef30 commit be8b2d1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ LIBC_INLINE int set_except(int excepts) {
161161
LIBC_INLINE int raise_except(int excepts) {
162162
float zero = 0.0f;
163163
float one = 1.0f;
164-
float large_value = FPBits<float>::max_normal();
165-
float small_value = FPBits<float>::min_normal();
164+
float large_value = FPBits<float>::max_normal().get_val();
165+
float small_value = FPBits<float>::min_normal().get_val();
166166
auto divfunc = [](float a, float b) {
167167
__asm__ __volatile__("ldr s0, %0\n\t"
168168
"ldr s1, %1\n\t"
@@ -277,8 +277,8 @@ LIBC_INLINE int set_env(const fenv_t *envp) {
277277
return 0;
278278
}
279279
const FEnv::FPState *state = reinterpret_cast<const FEnv::FPState *>(envp);
280-
FEnv::set_control_word(state->ControlWord);
281-
FEnv::set_status_word(state->StatusWord);
280+
FEnv::set_control_word(static_cast<uint32_t>(state->ControlWord));
281+
FEnv::set_status_word(static_cast<uint32_t>(state->StatusWord));
282282
return 0;
283283
}
284284

0 commit comments

Comments
 (0)